get_navigation: Retrieve a navigation structure for extracting slabs.

View source: R/nc.R

get_navigationR Documentation

Retrieve a navigation structure for extracting slabs.

Description

Handy if you are doing multiple extractions - just compute the extraction navigation once and resuse it (not that computing is slow.)

Usage

get_navigation(
  x,
  bb = get_bounds(x),
  time = get_loc(x, "time")[1:3],
  lev = get_loc(x, "lev")[1:5]
)

Arguments

x

ncdf4 object

bb

a 4 element bounding box for subsetting ordered as [xmin, xmax, ymin, ymax]

time

POSIXct vector of one or more times to retrieve. These are matched the closest known times in the object. See get_time Default is the first recorded time in the object.

lev

numeric vector of one or more levels. These are matched the closest known levels in the object. See get_lev Default is the first level time in the object. Ignored if lev is not a dimension of the variable.

Value

a list of extraction navigation elements

  • obb, otime, olev: original request inputs

  • ilon, ilat, itime, ilev: index into dimensions for obb, otime and olev

  • lons, lats, times, levs: full real world dimension values

  • dx, dy: x and y resolution

  • xlim, ylim: limits envelope

  • index: list of array (slab) indices as in [start, count] form

  • stbb: st_bbox object

  • time_index, lev_index: full sequential indices into times and levs


BigelowLab/nam218grads documentation built on Oct. 4, 2022, 2:01 a.m.