Metrics selection
A metrics selector is a useful notation for controlling which metrics are returned in the measurement. When you request measurements -- either recent or historical -- you can limit which metrics get returned with the metricSelect
parameter. Here are some examples, following by a more complete description of the notation:
Examples
Desired metrics | metricSelect value |
---|---|
The metrics that are returned by the API by default | absent or default |
Every metric | all |
Only metrics that start with “no2” (or similarly, only the category of NO2 pollutants) |
only no2* or only :no2 |
Only metrics that are in the category of pollutants (thus leaving out environmentals like temperature and humidity) |
only :pollutant |
Only what a Node2 reports (no accessory module metrics) | only :node2 |
Defaults but not AQIs | default - *aqi* |
Only Nowcasts | only *nowcast* |
Metrics select language
The metrics selector creates a set, progressing left-to-right. The language is case-insensitive.
Start
A selection starts with
default
or absent - set of default metricsall
- all the metrics for the given output frequencynone
oronly
- the empty set
Add and remove
Then the language adds to or removes from the set. If not specified, you are adding. The selector only xxx
starts with the empty set and then adds xxx
.
Plus +
and minus -
toggle between add-to-set and remove-from-set. The selector none + no2* - *aqi
starts empty, adds metrics that begin with "no2" and then remove metrics ending with "aqi".
Star matching
An asterisk *
matches any text sequence.
*
matches any text (so, all metrics)temperature*
matchings all text that starts with "temperature"*rolling*
matching any text with the word "rolling" in it. This would select all the rolling means.
Category matching
There are predefined categories of metrics that can be indicated with a leading colon :
For example, only :blackcarbon
selects only the black carbon netrics
Categories
Broad
:pollutant
- the PMs, NO2, ozone, black carbon:met
- meteorological: ambient temperature & RH, wind, atmosperic pressure:internal
- internal temperature & RH:particulate
- the PMs, black carbon:gas
- ozone, NO2
Specific pollutants
:pm1
:pm25
:pm10
:no2
:ozone
:blackcarbon
Non-pollutant
:temperature
:rh
:wind
Only sensed by the Node2 itself (does not include accessory modules)
:node2