Download data from the MetNordic Re-Analysis v3 dataset
Source:R/metnorenal3.R
get_metno_reanalysis3.Rd
The MET Nordic rerun archive version 3 can be accessed using this function. Please see below for more details.
Usage
get_metno_reanalysis3(
area,
directory = NULL,
fromdate = "2012-09-01 10:00:00",
todate = "2012-09-01 20:00:00",
mn_variables = NULL,
area_buffer = 1500,
grid_resolution = NULL,
preview = TRUE
)
Arguments
- area
(string) path to geo-referenced shapefile (polygon or point) of the desired area
- directory
(string) path to desired working directory (default: working directory)
- fromdate
(string) date and time for start of time series (ie. "2012-09-01 10:00:00")
- todate
(string) date and time for end of time series (ie. "2013-09-01 10:00:00")
- mn_variables
(vector) Leave blank for deafault (tested) variables. See details for more
- area_buffer
desired buffer around the provided shapefile (in meters, default 1500)
- grid_resolution
(integer) desired resolution of downloaded grid in kilometers. (see help page for more details)
- preview
generate graphs showing previews of data download? (boolean)
Value
Function returns a path to where .csv files of the download were written. One .csv file for each grid point within the (buffered) shape file area. Additionally one metadata file (.csv) is written with the attributes of each other file
Details
For instructions on how to use this function, you can visit the article on the web page.
The MET Nordic Reanalysis Dataset is a reanalysis product from the Meteorologisk institutt (hourly from 2012-09 to 2023-01). Please inform yourself on the limitations of reanalysis data before applying this dataset to your needs.This function accesses the THREDDS server of met.no with download queries formatted from user input:
area
should be a path to a geo-referenced shapefile (of either a
polygon or a point geometry) of the area you would like data from.
This area must be at least twice the size of the chosen grid_resolution
,
which is by default 1 x 1 km. If a point shapefile is given, then the nearest
grid cell is chosen, and data is downloaded from there.
directory
is an optional parameter which lets you chose in which directory
the downloads will be stored. If this parameter is not defined, the current
working directory will be used.
fromdate
and todate
are the date and time by which to bound the download
by. required format is: "2012-09-01 10:00:00". The dataset spans from this
date til 2023-01.
mn_variables
are the MetNordic Variables which the function should
download, by default this includes the following:
"air_temperature_2m",
"integral_of_surface_downwelling_shortwave_flux_in_air_wrt_time",
"relative_humidity_2m",
"precipitation_amount",
"wind_speed_10m",
"wind_direction_10m"
There are a few more variables which are not downloaded, these have not been tested, and some are known to have data gaps which the function currently cannot deal with, and might cause it to fail. use at own risk, and post an issue if anything does not work.
You can read more about these variables on GitHub (MetNo)
area_buffer
is an optional convienient parameter in which you can buffer
your polygon shape file by the given amount of meters. This is useful for
downloading stations that are outside of the bounds of your polygon, but are
still relatively close to the border (due to the 1x1km grid). A good (and
default) value for this is 1500 m
grid_resolution
lets you choose how many stations to select from the grid.
If for example you pass a "3", then every 3 station will be selected in both
the horizontal and vertical axis, giving you a grid with stations placed 3km
apart from each other on a regular grid. This can help with downloading data
from huge catchments where 1x1km grid size is not necessary. Please note, no
averaging of the "non-selected" grid cells is performed, and the default
value is 1 x 1 km.
preview
prints information to the console as to what the function is doing,
as well as plotting interactive maps to the viewer which gives you an idea of
which grid cells were selected relative to the shapefile you provided.