getGrid | R Documentation |
Get the (regular) grid definition from an existing (gridded) dataset
getGrid(gridData)
gridData |
A grid data object coming from |
In case of irregular grid definitions, the function forces the grid to regularity.
The returned grid object inherits the attributes from the input xyCoords
definition.
A list of two named components, x
and y
, consisting of a vector of length two each one, defining
the x/y lower and upper bounds. The grid-cell resolution is given by the attributes 'resX'
and
'resY'
respectively.
S. Herrera and J. Bedia
Other get.helpers:
get2DmatCoordinates()
,
getCoordinates()
,
getDim()
,
getGridProj()
,
getGridVerticalLevels()
,
getRefDates()
,
getSeason()
,
getShape()
,
getStationID()
,
getVarNames()
,
getWT()
,
getYearsAsINDEX()
,
setGridProj()
,
typeofGrid()
,
which.leap()
require(climate4R.datasets)
# Regular grid
data("NCEP_Iberia_hus850")
str(getGrid(NCEP_Iberia_hus850))
# Regular rotated grid with correpondence with a non regular grid in the
# lat/lon domain.
data("CORDEX_Iberia_tas")
str(getGrid(CORDEX_Iberia_tas))
# Station data
data("VALUE_Iberia_tas")
str(getGrid(VALUE_Iberia_tas))
# Interpolate NCEP onto the System4 grid:
data("CFS_Iberia_pr")
NCEP_interpolated <- interpGrid(NCEP_Iberia_hus850, getGrid(CFS_Iberia_pr), "bilinear")
# Note the warnings because of the non-overlapping domain extents (longitudes)
require(visualizeR)
spatialPlot(climatology(NCEP_Iberia_hus850), backdrop.theme = "countries")
spatialPlot(climatology(NCEP_interpolated), backdrop.theme = "countries")
str(getGrid(NCEP_interpolated))
str(getGrid(CFS_Iberia_pr))
# The other way round, using nearest neighbour interpolation:
CFS_interpolated <- interpGrid(CFS_Iberia_pr, getGrid(NCEP_Iberia_hus850))
spatialPlot(climatology(CFS_interpolated), backdrop.theme = "countries")
# In this case, the mismatch in domain extent occurs in the longitudes and latitudes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.