sample_range - bruno-beloff/scs_analysis GitHub Wiki
docs > software repositories > scs_analysis > commands > filtering and aggregating data
DESCRIPTION
The sample_range utility is used to add full range (max - min) and upper rage (max - mid) fields to the output documents - this is useful when analysing device outputs for correct zero offset and sensitivity.
The SUB_NODE argument indicates which input field(s) should be processed. In order to be processed the field must contain the SUB_NODE and have contiguous leaf nodes ending '.min', '.mid' and '.max'. Fields that do not meet this requirement are passed to the output with no additional '.full-range' and '.upper-range' fields.
SYNOPSIS
sample_range.py [-f] [-u] [-p PRECISION] [-v] SUB_NODE
Options | |
---|---|
--version | show program's version number and exit |
-h, --help | show this help message and exit |
-f, --full | report narrative to stderr |
-u, --upper | report narrative to stderr |
-p PRECISION, --prec=PRECISION | precision (default 1 decimal places) |
-v, --verbose | report narrative to stderr |
EXAMPLES
sample_range.py -f -u CO.cnc
DOCUMENT EXAMPLE - INPUT
{"tag": "scs-bgx-619", "rec": "2024-06-20T00:00:00Z", "val": {"CO": {"cnc": {"min": 104.2, "mid": 181.8, "max": 520.7}}}}
DOCUMENT EXAMPLE - OUTPUT
{"tag": "scs-bgx-619", "rec": "2024-06-20T00:00:00Z", "val": {"CO": {"cnc": {"min": 104.2, "mid": 181.8, "max": 520.7, "full-range": 416.5, "upper-range": 338.9}}}}