Open dognotdog opened 3 years ago
Some ESDR products have pretty names, units, and/or value ranges defined for their channels in the defaultChannelSpecs
field. That field gets copied into a feed's channelSpecs
field upon feed creation. Visualizations can then use the channelSpecs
field to display pretty channel names and units, as shown in the y-axis here: https://esdr.cmucreatelab.org/plot/?feed=26310&channel=tVOC
Same kinda thing is going on with the 90-degree rotated text to the left and right of the plots in https://airvizinc.com/monitor-explorer/
Anyway, we can dress up the most popular products/feeds with channelSpecs info to help implement this feature. Format is not enforced in any way--only my convention--but a couple example channelSpecs
are below.
CREATE Lab VOC Monitor:
{
"defaultChannelSpecs": {
"version": 1,
"channels": {
"temp": {
"prettyName": "Temperature",
"units": "C"
},
"temp_internal_0": {
"prettyName": "Temperature",
"units": "C"
},
"temp_internal_1": {
"prettyName": "Temperature",
"units": "C"
},
"humidity": {
"prettyName": "Relative Humidity",
"range": {
"min": 0,
"max": 100
}
},
"humidity_internal_0": {
"prettyName": "Relative Humidity",
"range": {
"min": 0,
"max": 100
}
},
"humidity_internal_1": {
"prettyName": "Relative Humidity",
"range": {
"min": 0,
"max": 100
}
},
"eCO2": {
"prettyName": "Equivalent CO2",
"units": "PPM"
},
"eCO2_internal_0": {
"prettyName": "Equivalent CO2",
"units": "PPM"
},
"eCO2_internal_1": {
"prettyName": "Equivalent CO2",
"units": "PPM"
},
"eCO2_internal_2": {
"prettyName": "Equivalent CO2",
"units": "PPM"
},
"tVOC": {
"prettyName": "tVOC",
"units": "PPB"
},
"tVOC_internal_0": {
"prettyName": "tVOC",
"units": "PPB"
},
"tVOC_internal_1": {
"prettyName": "tVOC",
"units": "PPB"
},
"tVOC_internal_2": {
"prettyName": "tVOC",
"units": "PPB"
}
}
}
}
RAMP:
{
"defaultChannelSpecs": {
"version": 1,
"channels": {
"PM2_5": {
"prettyName": "PM 2.5",
"units": "ug/m^3",
"range": {
"min": 0,
"max": null
}
},
"TEMP_DEGC": {
"prettyName": "Temperature",
"units": "C",
"range": {
"min": -273.15,
"max": null
}
},
"RHUM": {
"prettyName": "Relative Humidity",
"units": "%",
"range": {
"min": 0,
"max": 100
}
}
}
}
}
As the channelSpecs
are already ingested loading the feeds, pulling the "units" from that to display seems reasonable.
The question that remains is what to do about normalizing different scales?
Could we have a drop down next to each graph that lets you pick the most common units so a user can manually go through and set them the same across what they are looking at? So for example, next to temperature channels we have a choice of F or C. And for SO2 ones, we have PPM or PPB as choices.
@pdille I feel like we need a more extended general "settings" area to not clutter the data and map displays too much, maybe like CMU-CREATE-Lab/esdr#52 suggests, as being able to change these units could definitely be useful.
We should also think about how this should or should not affect the exported data, as it could be a source of confusion when exported values don't match.
Some types of data, like SO2, are reported in different units, eg. PPB vs. PPM, and it would be nice to normalize that for the plots to make similar data more easily comparable.
Also, showing known units in the plots could be useful