senorge: Function to read seNorge daily temperature and precipitation...

View source: R/senorge.thredds.R

senorgeR Documentation

Function to read seNorge daily temperature and precipitation data from thredds.met.no

Description

The seNorge data set offers gridded fields of meteorological variables at a resolution of 1x1km. The 'senorge' function reads the seNorge data directly from the metno thredds server. As the resolution is very high, it may be necessary to limit the spatial and/or temporal scope (see input options 'it', 'lon', and 'lat') as you will otherwise run out of memory.

Usage

senorge(
  url = "https://thredds.met.no/thredds/catalog/senorge/seNorge_2018/Archive",
  param = "rr",
  lon = c(10.5, 11.5),
  lat = c(59.5, 60.5),
  it = 1961:2020,
  dt = 50,
  verbose = FALSE,
  plot = FALSE
)

Arguments

url

URL for the data on thredds.met.no

param

Variable name (rr = precipitation, tg = temperature)

lon

Longitude selection (=NULL reads all)

lat

Latitude selection (=NULL reads all)

it

Index time - a range of dates or years to select (e.g., it=as.Date(c("2010-01-01","2010-01-31")))

dt

Number of time steps to access at a time (default: 50). A smaller value can be set when requesting a large spatial domain as the server doesn't like to deal with large data amounts.

verbose

write out diagnostics

plot

plot the results while reading.

FUN

Function for daily aggregation. =NULL gives raw data

ncfile

netCDF file to access (path to a file or url)

path

path to ncfile (use only if ncfile doesn't contain the full path)

Value

A "zoo" "station" object with additional attributes used for further processing.

See Also

meta.thredds, station.thredds

Examples

## Not run: 
it <- as.Date(c("1962-12-01","1962-12-31"))
lon <- c(-2,15)
lat <- c(55,63)
rr <- senorge(param="rr", lon=lon, lat=lat, it=it, verbose=TRUE)
map(rr, FUN="mean")

## End(Not run)

metno/esd documentation built on April 29, 2024, 3:34 p.m.