P6Parameters¶
- class geodetic_engine.bingrid.P6Parameters[source]¶
Bases:
objectA bin grid as the parameters of EPSG method 9666 or 1049.
- origin_i¶
Inline number of the origin bin node.
- origin_j¶
Crossline number of the origin bin node.
- origin_easting¶
Map grid easting of the origin bin node.
- origin_northing¶
Map grid northing of the origin bin node.
- bin_width_i¶
Distance between adjacent bin nodes along the I-axis, as a ground distance in the CRS’s linear unit.
- bin_width_j¶
Distance between adjacent bin nodes along the J-axis.
- bearing_j¶
Map grid bearing of the J-axis, clockwise from grid north, in degrees, normalised to
[0, 360).
- handedness¶
Whether the I-axis is 90 degrees clockwise (right-handed) or counterclockwise (left-handed) from the J-axis.
- scale_factor¶
Bin grid scale factor
k: map grid distance per ground distance at the grid. 1 when the grid was designed on the map grid.
- increment_i¶
Change of the inline number between adjacent bin nodes.
- increment_j¶
Change of the crossline number between adjacent bin nodes.
- Raises:
InvalidParameterError – On construction, if a value is outside its domain (see the attribute descriptions).
Example
>>> grid = P6Parameters( ... origin_i=1, origin_j=1, ... origin_easting=456781.0, origin_northing=5836723.0, ... bin_width_i=25.0, bin_width_j=12.5, bearing_j=20.0, ... handedness=Handedness.RIGHT, scale_factor=0.99984, ... ) >>> grid.to_map(300, 247).round(2) array([[ 464855.62, 5837055.9 ]])
- to_map(i, j=None)[source]¶
Map grid coordinates of bin grid positions.
- Parameters:
i (
Iterable[Iterable[float]] |Iterable[float] |float) – Either every position in one go – one(inline, crossline)pair given flat, a sequence of pairs, or an array of shape(n, 2)– whenjis omitted; or the inline numbers, as a scalar or a sequence, whenjis given.j (
Iterable[float] |float|None, default:None) – Crossline numbers, matchingi.
- Return type:
- Returns:
Array of shape
(n, 2)– easting and northing per position.
- to_bin(easting, northing=None)[source]¶
Bin grid positions of map grid coordinates.
- Parameters:
easting (
Iterable[Iterable[float]] |Iterable[float] |float) – Either every point in one go – one(easting, northing)pair given flat, a sequence of pairs, or an array of shape(n, 2)– whennorthingis omitted; or the eastings, as a scalar or a sequence, when it is given.northing (
Iterable[float] |float|None, default:None) – Northings, matchingeasting.
- Return type:
- Returns:
Array of shape
(n, 2)– fractional inline and crossline numbers.
- reanchored(i, j)[source]¶
The same grid with its origin moved to another bin node.
- Parameters:
- Return type:
- Returns:
Parameters that map every position exactly as these do.
- __init__(origin_i, origin_j, origin_easting, origin_northing, bin_width_i, bin_width_j, bearing_j, handedness, scale_factor=1.0, increment_i=1, increment_j=1)¶