BritishNationalGrid
- class unifhy.BritishNationalGrid(projection_y_coordinate, projection_x_coordinate, projection_y_coordinate_bounds, projection_x_coordinate_bounds)
Bases:
unifhy.space.Grid
This class characterises the spatial dimension for a
Component
as a regular grid on a cartesian domain whose coordinates are northings and eastings covering Great Britain and Northern Ireland (EPSG:27700).Instantiation
- Parameters
- projection_y_coordinate: one-dimensional array-like object
The array of northing coordinates in metres defining a spatial dimension of the domain. May be any type that can be cast to a
numpy.ndarray
. Must contain numerical values. Coordinates must be ordered positively.Parameter example:
projection_y_coordinate=[12500, 13500, 14500]
Parameter example:
projection_y_coordinate=numpy.arange(12500, 15500, 1000)
- projection_x_coordinate: one-dimensional array-like object
The array of easting coordinates in metres defining a spatial dimension of the domain. May be any type that can be cast to a
numpy.ndarray
. Must contain numerical values. Coordinates must be ordered positively.Parameter example:
projection_x_coordinate=(80500, 81500, 82500, 83500)
Parameter example:
projection_x_coordinate=numpy.arange(80500, 84500, 1000)
- projection_y_coordinate_bounds: two-dimensional array-like object
The array of northing coordinate bounds in metres 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 projection_y_coordinate and the second dimension equal to 2. Must contain numerical values.Parameter example:
projection_y_coordinate_bounds=[ [12e3, 13e3], [13e3, 14e3], [14e3, 15e3] ]
Parameter example:
projection_y_coordinate_bounds=numpy.column_stack( (numpy.arange(12000, 15000, 1000), numpy.arange(13000, 16000, 1000)) )
- projection_x_coordinate_bounds: two-dimensional array-like object
The array of easting coordinate bounds in metres 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 projection_x_coordinate and the second dimension equal to 2. Must contain numerical values.Parameter example:
projection_x_coordinate_bounds=((80e3, 81e3), (81e3, 82e3), (82e3, 83e3), (83e3, 84e3))
Parameter example:
projection_x_coordinate_bounds=numpy.column_stack( (numpy.arange(80000, 84000, 1000), numpy.arange(81000, 85000, 1000)) )
Examples
Instantiating a 2D grid:
>>> import numpy >>> sd = BritishNationalGrid( ... projection_y_coordinate=[12500, 13500, 14500], ... projection_x_coordinate=(80500, 81500, 82500, 83500), ... projection_y_coordinate_bounds=numpy.column_stack( ... (numpy.arange(12000, 15000, 1000), ... numpy.arange(13000, 16000, 1000)) ... ), ... projection_x_coordinate_bounds=numpy.column_stack( ... (numpy.arange(80000, 84000, 1000), ... numpy.arange(81000, 85000, 1000)) ... ) ... ) >>> print(sd) BritishNationalGrid( shape {Y, X}: (3, 4) Y, projection_y_coordinate (3,): [12500, 13500, 14500] m X, projection_x_coordinate (4,): [80500, ..., 83500] m Y_bounds (3, 2): [[12000, ..., 15000]] m X_bounds (4, 2): [[80000, ..., 84000]] m )
Methods
Construction
Instantiate a |
|
Instantiate a |
Comparison
Compare equality between the BritishNationalGrid 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 SpaceDomain in square metres given as a |