map_non_standard_calendar: Create map indices from non-standard calendars

View source: R/map_non_standard_calendar.R

map_non_standard_calendarR Documentation

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)

Arguments

times

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

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

See Also

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

Examples

# 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]


eurocordexr documentation built on Aug. 24, 2023, 9:07 a.m.