geodetic_engine.bingrid¶
Seismic bin grids: P6 parameters, four-corner QC and squaring, conversion.
A bin grid maps the (inline, crossline) numbers of seismic bin centres onto the map grid of a projected CRS. This package knows two ways of stating one and converts between them:
P6Parameters– the IOGP P6/11 parameters of EPSG methods 9666 and 1049, with vectorised conversion between bin grid and map grid (to_map(),to_bin());BinGridCorners– the four-point definition, corners A, B, C, D.
Public entry points:
convert_bin_grid()– QC four corners, optionally convert them to another CRS, square them up, and give them in WGS 84.square_up()/derive_p6()– the same fit, without a CRS.corners_from_p6()– the four corners of a P6-defined grid.outline()– the grid’s outline as a counterclockwise polygon ring.
Nothing here reads or writes OSDU JSON.
Example
>>> from geodetic_engine.bingrid import convert_bin_grid
>>> result = convert_bin_grid(
... [(1, 1000, 500000.0, 3000000.0), (1, 2000, 500000.0, 3100000.0),
... (101, 1000, 600000.0, 3000000.0), (101, 2000, 600000.0, 3100000.0)],
... "EPSG:32615",
... )
>>> p = result.parameters
>>> round(p.scale_factor, 6), round(p.bin_width_i, 3), round(p.bin_width_j, 4)
(0.999631, 1000.369, 100.0369)
>>> round(result.max_mislocation.di, 9), round(result.max_mislocation.dj, 9)
(0.0, 0.0)
Functions¶
Check a four-corner bin grid, optionally convert it, and square it up. |
|
The four corners of a grid defined by its P6 parameters. |
|
Derive the P6 parameters of the SDU note's rectangle through four corners. |
|
The outer ring of a bin grid. |
|
The outer ring through four points given in order A, B, C, D. |
|
Fit the SDU note's rectangle through four corners and measure the misfit. |
Classes¶
One corner: its bin grid numbers and its coordinates. |
|
The four corners A, B, C and D of a bin grid, labelled by their numbers. |
|
A closed, counterclockwise ring through the four corners. |
|
A bin grid checked, optionally converted, and squared up. |
|
How far one input corner is from the fitted rectangle. |
|
Which side of the J-axis the I-axis points to, seen from above. |
|
The largest mis-location over the four corners. |
|
A bin grid as the parameters of EPSG method 9666 or 1049. |
|
The rectangle fitted through four corners, and how well it fits. |
Exceptions¶
Base class for all bin grid failures. |
|
The corner coordinates cannot belong to the corners they are labelled as. |
|
The corners given do not state a bin grid. |
|
A bin grid parameter is outside the values it can take. |
|
The CRS is not one a bin grid can be defined on. |