View source: R/map_non_standard_calendar.R
map_non_standard_calendar | R Documentation |
Interpolates non-standard calendars (360 and noleap) to the standard Gregorian. Assumes daily data as input.
map_non_standard_calendar(times)
times |
Vector of class PCICt (will be truncated to days). |
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
Can be used internally in rotpole_nc_point_to_dt
and
nc_grid_to_dt
by setting the respective arguments.
# 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]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.