grib_latlons | R Documentation |
grib_latlons
extracts the latitudes and longitudes from a GRIB message
and optionally expands them into matrix
form.
grib_latlons(gribMessage, expand = FALSE)
gribMessage |
|
expand |
optional |
grib_latlons
is a convenience function that returns the latitude and
longitudes after reversing projected coordinates (using the proj4
package) from the GRIB message. This makes it easy to use latitude and
longitude for the axes in plots intstead of eastings and northings. Use of
this function is optional given that the user can extract the PROJ.4 string
from the GRIB message using grib_proj4str
. From the user can
use whatever package/work flow to project the data. Not all grid types may be
supported at this time. New grid types may be added in the future.
This function is influenced by the latitude and longitude extraction method used in the pygrib Python module (see pygrib source).
a list
or a matrix
of the latitudes and longitudes
after projection.
grib_select
grib_get_message
grib_expand_grids
g <- grib_open(system.file("extdata", "lfpw.grib1", package = "gribr"))
gm <- grib_get_message(g, 1)
latlon <- grib_latlons(gm)
grib_close(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.