getGridVerticalLevels: Get grid vertical levels

View source: R/helpers.R

getGridVerticalLevelsR Documentation

Get grid vertical levels

Description

A helper function that returns a vector of the variable(s) vertical levels

Usage

getGridVerticalLevels(grid, var.index = NULL)

Arguments

grid

Input grid

var.index

A vector of indices indicating the positions of the variables whose level will be returned. This can be either an integer vector of positions, or a character vector with the short names of the variables contained in the multigrid (see the getVarNames helper for more details). Default to NULL (levels of all variables)

Value

A (short-)named vector with the vertical levels of the (multi)grid variable(s)

Author(s)

J Bedia

See Also

Other get.helpers: get2DmatCoordinates(), getCoordinates(), getDim(), getGrid(), getGridProj(), getRefDates(), getSeason(), getShape(), getStationID(), getVarNames(), getWT(), getYearsAsINDEX(), setGridProj(), typeofGrid(), which.leap()

Examples

 
require(climate4R.datasets)
data("CFS_Iberia_hus850")
getGridVerticalLevels(CFS_Iberia_hus850)
# Surface variables usually have an undefined vertical level <NA>
data("EOBS_Iberia_tas")
getGridVerticalLevels(EOBS_Iberia_tas)

data("NCEP_Iberia_hus850")
data("NCEP_Iberia_psl")
data("NCEP_Iberia_ta850")
mg <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_psl, NCEP_Iberia_ta850)
getGridVerticalLevels(mg)
# Use of var.index to select some variables:
# either by their shortname...
getGridVerticalLevels(mg, var.index = c("hus@850","ta@850"))
# ... or by index position in the multigrid
getGridVerticalLevels(mg, var.index = c(1,3))


SantanderMetGroup/transformeR documentation built on Nov. 25, 2024, 1:25 p.m.