Hourly SNOTEL data through fetchSCAN #260
-
Hello, I wanted to inquire about the functionality of using fetchSCAN to retrieve hourly SNOTEL site data. I've been very successful using fetchSCAN to deliver daily data from a SNOTEL site of interest; however, I cannot seem to access the hourly data. I know this site collects hourly T, precip, SWE data, but I had hoped to be able to use fetchSCAN to access it in a convenient way. Older documentation of this function indicates you can input "timeseries = 'hourly'" however that's been unsuccessful in attempts at yielding useful data. Any insights welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi Matthew, Thanks for asking. I'll check into it today and report back. It should be possible to return hourly data. |
Beta Was this translation helpful? Give feedback.
-
UPDATE: For instance: x <- fetchSCAN(2072, 2010:2020, timeseries='Hourly') There is still support for the old form of the function allowing arbitrary list of request parameters to be posted to form via
So, in the current version you can do something like this (with a deprecation warning): x <- fetchSCAN(req = c(intervalType=' View Historic ', report='SMS', timeseries='Hourly',
format='copy', sitenum='2072', interval='YEAR', year='2011', month='CY')) I made a small change that allows form variables to be specified as additional arguments (via Now in development version (after bf8b6da) you can equivalently do this: x <- fetchSCAN(intervalType=' View Historic ', report='SMS', timeseries='Hourly',
format='copy', sitenum='2072', interval='YEAR', year='2011', month='CY') I think this is what you were hoping would work i.e. timeseries='Hourly' can be specified directly as an argument. Note that for now you will need to manually iterate over sites/years with either syntax and then rbind the data.frame results. It will take a little bit more effort to get the generic request parameters working in the batched interface, but that shouldn't be too difficult to implement. I have added this as a TODO in the "fetchSCAN() upgrades" issue #184 |
Beta Was this translation helpful? Give feedback.
UPDATE:
now in development version you should be able to supply just the timeseries argument and get batched results.
For instance:
There is still support for the old form of the function allowing arbitrary list of request parameters to be posted to form via
req
argument; but this is not documented. In current soilDB for the backward compatible interface thatreq
argument needs to be named, and use of it will trigger a deprecation message.req
argument was deprecated primarily due to the fact that the newer interface changed first required arguments which are now a vector ofsite.code
/year
. These newer arguments facilitate batching/com…