RotatedLatLonGrid
- class unifhy.RotatedLatLonGrid(grid_latitude, grid_longitude, grid_latitude_bounds, grid_longitude_bounds, grid_north_pole_latitude, grid_north_pole_longitude, north_pole_grid_longitude=0.0)
Bases:
unifhy.space.Grid
This class characterises the spatial dimension for a
Component
as a regular grid on a spherical domain whose coordinates are latitudes and longitudes, and whose rotation axis is not aligned with the North pole. Its ellipsoid and datum are those of WGS 84 (see EPSG:4326).Instantiation
- Parameters
- grid_latitude: one-dimensional array-like object
The array of latitude coordinates in degrees defining a spatial dimension of the domain. May be any type that can be cast to a
numpy.ndarray
. Must contain numerical values.Parameter example:
grid_latitude=[0.88, 0.44, 0., -0.44, -0.88]
- grid_longitude: one-dimensional array-like object
The array of longitude coordinates in degrees defining a spatial dimension of the domain. May be any type that can be cast to a
numpy.ndarray
. Must contain numerical values.Parameter example:
grid_longitude=[-2.5, -2.06, -1.62, -1.18]
- grid_latitude_bounds: two-dimensional array-like object
The array of latitude coordinate bounds in degrees defining the extent of the grid cell around the coordinate. May be any type that can be cast to a
numpy.ndarray
. Must be two dimensional with the first dimension equal to the size of grid_latitude and the second dimension equal to 2. Must contain numerical values.Parameter example:
grid_latitude_bounds=[[1.1, 0.66], [0.66, 0.22], [0.22, -0.22], [-0.22, -0.66], [-0.66, -1.1]]
- grid_longitude_bounds: two-dimensional array-like object
The array of longitude coordinate bounds in degrees defining the extent of the grid cell around the coordinate. May be any type that can be cast to a
numpy.ndarray
. Must be two dimensional with the first dimension equal to the size of grid_longitude and the second dimension equal to 2. Must contain numerical values.Parameter example:
grid_longitude_bounds=[[-2.72, -2.28], [-2.28, -1.84], [-1.84, -1.4], [-1.4, -0.96]]
- grid_north_pole_latitude:
int
orfloat
The true latitude (i.e. in EPSG:4326) of the north pole of the rotated grid in degrees North. This parameter is required to project the rotated grid into a true latitude-longitude coordinate system.
- grid_north_pole_longitude:
int
orfloat
The true longitude (i.e. in EPSG:4326) of the north pole of the rotated grid in degrees East. This parameter is required to project the rotated grid into a true latitude-longitude coordinate system.
- north_pole_grid_longitude:
int
orfloat
, optional The longitude of the true north pole (i.e. in EPSG:4326) in the rotated grid in degrees. This parameter is optional to project the rotated grid into a true latitude-longitude coordinate system. If not provided, set to default value 0.
Examples
Instantiate 2D grid using lists:
>>> sd = RotatedLatLonGrid( ... grid_latitude=[-0.88, -0.44, 0., 0.44, 0.88], ... grid_longitude=[-2.5, -2.06, -1.62, -1.18], ... grid_latitude_bounds=[[-1.1, -0.66], [-0.66, -0.22], [-0.22, 0.22], ... [0.22, 0.66], [0.66, 1.1]], ... grid_longitude_bounds=[[-2.72, -2.28], [-2.28, -1.84], ... [-1.84, -1.4], [-1.4, -0.96]], ... grid_north_pole_latitude=38.0, ... grid_north_pole_longitude=190.0, ... ) >>> print(sd) RotatedLatLonGrid( shape {Y, X}: (5, 4) Y, grid_latitude (5,): [-0.88, ..., 0.88] degrees X, grid_longitude (4,): [-2.5, ..., -1.18] degrees Y_bounds (5, 2): [[-1.1, ..., 1.1]] degrees X_bounds (4, 2): [[-2.72, ..., -0.96]] degrees )
Methods
Construction
Instantiate a |
|
Instantiate a |
Comparison
Compare equality between the RotatedLatLonGrid and the spatial (X, Y, and Z) dimension coordinate in a |
|
Compare equality in region spanned between the RotatedLatLonGrid and another instance of RotatedLatLonGrid. |
|
Determine whether the horizontal cell bounds of the grid are overlapping with the cell bounds of another instance of |
Utility
Move the given values from their current location in the |
Attributes
Return the size of the |
|
Return the name of the properties to use to get access to the axes defined for the |
|
Return the X-axis of the |
|
Return the Y-axis of the |
|
Return the bounds of the X-axis of the |
|
Return the bounds of the Y-axis of the |
|
Return the name of the X-axis of the |
|
Return the name of the Y-axis of the |
|
The land-sea mask for the |
|
The information necessary to move any variable laterally (i.e. |
|
The horizontal area for the grid cells of the |