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:

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

convert_bin_grid

Check a four-corner bin grid, optionally convert it, and square it up.

corners_from_p6

The four corners of a grid defined by its P6 parameters.

derive_p6

Derive the P6 parameters of the SDU note's rectangle through four corners.

outline

The outer ring of a bin grid.

outline_of

The outer ring through four points given in order A, B, C, D.

square_up

Fit the SDU note's rectangle through four corners and measure the misfit.

Classes

BinGridCorner

One corner: its bin grid numbers and its coordinates.

BinGridCorners

The four corners A, B, C and D of a bin grid, labelled by their numbers.

BinGridOutline

A closed, counterclockwise ring through the four corners.

BinGridResult

A bin grid checked, optionally converted, and squared up.

CornerResidual

How far one input corner is from the fitted rectangle.

Handedness

Which side of the J-axis the I-axis points to, seen from above.

MaxMislocation

The largest mis-location over the four corners.

P6Parameters

A bin grid as the parameters of EPSG method 9666 or 1049.

SquaringResult

The rectangle fitted through four corners, and how well it fits.

Exceptions

BinGridError

Base class for all bin grid failures.

DegenerateBinGridError

The corner coordinates cannot belong to the corners they are labelled as.

InvalidCornersError

The corners given do not state a bin grid.

InvalidParameterError

A bin grid parameter is outside the values it can take.

UnsupportedCRSError

The CRS is not one a bin grid can be defined on.