MazamaScience / PWFSLSmoke

Utilities for working with air quality monitoring data (e.g. federal regulatory monitors)
http://mazamascience.github.io/PWFSLSmoke/
GNU General Public License v3.0
19 stars 5 forks source link

additional fields in monitor_getCurrentStatus() #53

Closed jonathancallahan closed 5 years ago

jonathancallahan commented 5 years ago

Task

The consistent naming scheme in monitor_getCurrentStatus() is much better but we should add a couple of useful fields and one for consistency:

Having an overly complete set of summary variables means that we won't have to go back and add things later when someone at the forest service has some crazy new idea.

Details

Here is a comparison the column names of the tibble returned by the soon-to-be-deprecated monitor_currentData():

> setdiff(names(currentData), names(currentStatus))
[1] "datetime"                "lastValidTime"           "lastValidLocalTimestamp"
[4] "latency"                 "lastValid_PM2.5_nowcast" "lastValid_PM2.5_1hr"    
[7] "lastValid_PM2.5_3hr"     "yesterday_PM2.5_24hr"    "monitoringSiteUrl"      
> setdiff(names(currentStatus), names(currentData))
 [1] "monitorURL"            "endTime"               "last_validTime"        "last_latency"         
 [5] "previous_validTime"    "previous_latency"      "yesterday_AQI"         "last_nowcast_1hr"     
 [9] "last_pm25_1hr"         "last_pm25_3hr"         "last_nowcastLevel"     "previous_nowcastLevel"
[13] "USG6"                  "U6"                    "VU6"                   "HAZ6"                 
[17] "MOD6"                  "NR6"                   "NEW6"                  "MAL6"                 

The motivation for this is the desire to use the monitor_getCurrentStatus() function to replace monitor_currentData() in the monitor_writeCurrentGeoJSON() function. Output from this function can be seen at https://haze.airfire.org/monitoring/latest/geojson/PM2.5_latest10.geojson and will have chunks like:

      "properties": {
        "monitorID": "060773005_01",
        "siteName": "TracyAP",
        "agencyName": "San Joaquin Valley Unified APCD",
        "timezone": "America/Los_Angeles",
        "dataSource": "AIRNOW",
        "telemetryAggregator": null,
        "telemetryUnitID": null,
        "processingTime": "2019-01-17 22:45:04",
        "lastValidUTCTime": "2019-01-17 20:00:00",
        "lastValidLocalTime": "2019-01-17 12:00:00 PST",
        "PM2.5_nowcast": 5.8,
        "PM2.5_1hr": 6,
        "PM2.5_3hr": 5.3,
        "PM2.5_yesterday": null,
        "latency": 1,
        "monitoringSiteUrl": "http://tools.airfire.org/monitoring/v4/#!/?monitors=060773005_01"
      },