grib_cube | R Documentation |
grib_cube
creates a three-dimensional array from one variable along a
chosen vertical coordinate.
grib_cube(gribObj, shortName, typeOfLevel, decreasing = FALSE)
gribObj |
|
shortName |
The short name given in the GRIB file of the variable to select. |
typeOfLevel |
The vertical coordinate to use as given by the typeOfLevel key in the GRIB file. |
decreasing |
Parameter to tell the array's vertical coordinate to be increasing or decreasing. |
grib_cube
is a wrapper function for grib_select
to conveniently
create a three-dimensional cube. The user inputs a variable to search for and
the vertical coordinate to use when finding each level.
Because grib_cube
uses grib_select
, speed can become an issue.
This is meant as a convenience to "get the job done". If you want more speed,
it will always be better to know which message number you want, set up your
own loop, and use grib_get_message
as that will avoid the overhead of
searching through the GRIB file.
Returns a three-dimenional array.
grib_get_message
grib_list
grib_expand_grids
grib_latlons
grib_select
g <- grib_open(system.file("extdata", "lfpw.grib1", package = "gribr"))
cube <- grib_cube(g, 'u', 'isobaricInhPa', TRUE)
grib_close(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.