Learn R Programming

eurocordexr (version 0.2.5)

map_non_standard_calendar: Create map indices from non-standard calendars

Description

Interpolates non-standard calendars (360 and noleap) to the standard Gregorian. Assumes daily data as input.

Usage

map_non_standard_calendar(times)

Value

A data.table with columns:

  • dates_full: sequence of standard dates from min to max date in input times as data.table::IDate

  • dates_pcict_inter: which dates in PCICt from times correspond to the standard dates

  • idx_pcict: the index associated to the input times to be used for mapping e.g. values

Arguments

times

Vector of class PCICt (will be truncated to days).

See Also

Can be used internally in rotpole_nc_point_to_dt and nc_grid_to_dt by setting the respective arguments.

Examples

Run this code
# example data from EURO-CORDEX (cropped for size)
# non-standard calendar (360)
fn2 <- system.file("extdata", "test2.nc", package = "eurocordexr")
ncobj <- ncdf4::nc_open(fn2)

# read as PCICt-class
times <- ncdf4.helpers::nc.get.time.series(ncobj, "tasmin")
str(times)

dtx <- map_non_standard_calendar(times)
dtx[58:64]

Run the code above in your browser using DataLab