get.var.file.idx: Create mapping from variables to files.

View source: R/support_functions.R

get.var.file.idxR Documentation

Create mapping from variables to files.

Description

Create mapping from variables to files.

Usage

get.var.file.idx(variable.name.map, v.list)

Arguments

variable.name.map

A mapping from standardized names (tmax, tmin, prec) to NetCDF variable names.

v.list

A list containing a vector of variables in each file.

Details

Given a variable name map and list of variables in each file, determine a mapping from variables to files.

Value

A vector mapping standardized variable names (tmax, tmin, prec) to indices in the file list.

Examples

## Not run: 
## Get mapping for a single file.
input.files <- c("pr_NAM44_CanRCM4_ERAINT_r1i1p1_1989-2009.nc")
f <- lapply(input.files, ncdf4::nc_open)
v.list <- lapply(f, ncdf4.helpers::nc.get.variable.list, min.dims=2)
v.f.idx <- get.var.file.idx(variable.name.map, v.list)

## End(Not run)


ECA-D/ecad_indices_grid documentation built on Nov. 23, 2022, 6:04 a.m.