help me help you with NOAA NCDC metadata

rnoaa
Tags: #<Tag:0x00007f57f8350f00>

#1

You can get to NOAA NCDC data in rnoaa via various functions, including ncdc() and other functions starting with ncdc_*().

One issue we’ve not addressed adequately in rnoaa is units. There’s A LOT of data coming from NOAA NCDC and a lot of different kinds of data in different units.

We’re now trying to do a few things to help with this:

  1. Make NCDC metadata machine readable. For the purposes of rnoaa that’s R lists, but we could think about making JSON metadata if we think other folks want to use it outside of rnoaa
  2. Somehow comebine getting data back from NCDC with the new units metadata above. Right now, I’m thinking we add units information for each row of data based on the data type we find, then the user can programatically convert data as they see fit.

I need lots of help with Step 1 above. Changes are on branch https://github.com/ropensci/rnoaa/tree/ncdc-units . I’m adding a new file for each NCDC dataset, e.g., R/units-ghcnd.R, etc. Any help is appreciated with these units* files, checking them over, including especially the units field, but also their descriptions. Pointers/tips/PR’s welcome. I’m right now pulling the metadata from the PDFs in https://www1.ncdc.noaa.gov/pub/data/cdo/documentation/ but you can also get names of data fields using e.g. ncdc_datatypes(datasetid='NORMAL_MLY'), but it doesn’t include any info about units


For step 2, I’ve starting implementing changes so that a new units column is added to the output of a call to ncdc(). see e.g.,

ncdc(datasetid='GHCND', stationid='GHCND:USW00014895',
    startdate = '2013-10-01', enddate = '2013-12-01')$data
#> # A tibble: 25 x 9
#>    date                datatype station           value fl_m  fl_q  fl_so fl_t  units
#>    <chr>               <chr>    <chr>             <int> <chr> <chr> <chr> <chr> <chr>
#>  1 2013-10-01T00:00:00 AWND     GHCND:USW00014895    29 ""    ""    W     ""    meters_per_sec_tenths
#>  2 2013-10-01T00:00:00 PRCP     GHCND:USW00014895     0 ""    ""    W     2400  mm_tenths
#>  3 2013-10-01T00:00:00 SNOW     GHCND:USW00014895     0 ""    ""    W     ""    mm
#>  4 2013-10-01T00:00:00 SNWD     GHCND:USW00014895     0 ""    ""    W     ""    mm
#>  5 2013-10-01T00:00:00 TAVG     GHCND:USW00014895   179 H     ""    S     ""    celcius_tenths
#>  6 2013-10-01T00:00:00 TMAX     GHCND:USW00014895   250 ""    ""    W     2400  celcius_tenths
#>  7 2013-10-01T00:00:00 TMIN     GHCND:USW00014895   133 ""    ""    W     2400  celcius_tenths
#>  8 2013-10-01T00:00:00 WDF2     GHCND:USW00014895   210 ""    ""    W     ""    degrees
#>  9 2013-10-01T00:00:00 WDF5     GHCND:USW00014895   230 ""    ""    W     ""    degrees
#> 10 2013-10-01T00:00:00 WSF2     GHCND:USW00014895    76 ""    ""    W     ""    meters_per_sec_tenths