sample_max - bruno-beloff/scs_analysis GitHub Wiki
docs > software repositories > scs_analysis > commands > filtering and aggregating data
DESCRIPTION
The sample_max utility is used to find the record with the highest value for the given node.
Input data is typically in the form of a sequence of JSON documents. A command parameter specifies the path to the node within the document that is to be tested. The node is typically a leaf node integer or float. The output of the sample_max utility includes the whole input document.
SYNOPSIS
sample_max.py [{ -n | -i }] [-v] PATH
Options | |
---|---|
--version | show program's version number and exit |
-h, --help | show this help message and exit |
-n, --number | interpret values as numbers |
-i, --iso8601 | interpret values as ISO 8601 datetimes |
-v, --verbose | report narrative to stderr |
EXAMPLES
aws_topic_history.py -m60 /orgs/south-coast-science-demo/brighton/loc/1/gases | ./sample_max.py -n val.CO.cnc
DOCUMENT EXAMPLE - INPUT
{"tag": "scs-bgx-401", "rec": "2018-03-27T09:54:41.042+00:00", "val": {"NO2": {"weV": 0.29563, "aeV": 0.280879, "weC": 0.009569, "cnc": 61.0}, "Ox": {"weV": 0.406819, "aeV": 0.387443, "weC": -0.010706, "cnc": 34.7}, "NO": {"weV": 0.319692, "aeV": 0.292129, "weC": 0.028952, "cnc": 165.5}, "CO": {"weV": 0.395819, "aeV": 0.289317, "weC": 0.113108, "cnc": 311.3}, "sht": {"hmd": 82.4, "tmp": 12.6}}}
DOCUMENT EXAMPLE - OUTPUT
{"tag": "scs-bgx-401", "rec": "2018-03-27T09:54:41.042+00:00", "val": {"NO2": {"weV": 0.29563, "aeV": 0.280879, "weC": 0.009569, "cnc": 61.0}, "Ox": {"weV": 0.406819, "aeV": 0.387443, "weC": -0.010706, "cnc": 34.7}, "NO": {"weV": 0.319692, "aeV": 0.292129, "weC": 0.028952, "cnc": 165.5}, "CO": {"weV": 0.395819, "aeV": 0.289317, "weC": 0.113108, "cnc": 311.3}, "sht": {"hmd": 82.4, "tmp": 12.6}}}