Description Usage Arguments Details Value Author(s) References See Also
Download data from the Catalan automatic weather station network (XEMA from Servei Meteorològic de Catalunya)
1 2 3 4 5 6 7 | downloadSMCvarmetadata(api, type = "current")
downloadSMCstationlist(api, date = NULL)
downloadSMCcurrentday(api, daily_meteoland = TRUE, variable_code=NULL,
station_id=NULL, date = Sys.Date(), verbose=TRUE)
downloadSMChistorical(api, dates, station_id=NULL, variable_code=NULL, export = FALSE,
exportDir = getwd(), exportFormat = "meteoland/txt",
metadatafile = "MP.txt", verbose=TRUE)
|
api |
String with the SMC API key (the procedure to apply for an api key is explained in https://apidocs.meteocat.gencat.cat/ ). |
type |
Either 'current' or 'historical' for current day variable metadata or historical variable metadata, respectively. |
daily_meteoland |
When |
variable_code |
A character vector with variable codes to be queried. If |
dates |
An object of class |
date |
An object of class |
station_id |
A string vector containing station ids (the list of stations for which climatic series are available is given by |
export |
If |
exportDir |
Output directory for downloaded meteorology. |
exportFormat |
Format of meteorological data. Current accepted formats are |
metadatafile |
The name of the file that will store the meta data describing all written files. |
verbose |
Boolean flag to print process information. |
API key needs to be requested from SMC (https://apidocs.meteocat.gencat.cat/).
Function downloadSMCstationlist returns a SpatialPointsDataFrame-class object containing the list of SMC operational weather stations for the date given.
Function downloadSMCvarmetadata returns a data frame with weather variables, their units and acronym to be used in queries (see parameter variable_code).
Function downloadSMCcurrentday downloads recent weather (the last 24h or the weather for a given date) from all currently available stations and returns data frame if daily_meteoland = FALSE or a SpatialPointsDataFrame-class object with observations aggregated at the daily scale otherwise.
Function downloadSMChistorical downloads historical daily weather corresponding to a given time period from a set (or all currently available) stations. Results are returned (or exported) after formatting data as a SpatialPointsMeteorology-class if variable_code = NULL, or as a data frame otherwise.
Antoine Cabon, CTFC
Miquel De Cáceres Ainsa, CTFC
Servei Meteorològic de Catalunya (SMC) should be acknowledged as author of information when accessing weather data with these functions.
SpatialPointsMeteorology-class
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.