Skip to main content

Module normalise

Module normalise 

Source
Expand description

Normalisation: find a cheaper, equivalent mapping for what was stored.

Readers record the stored form (the “costume” in regular-in-what). Normalisation tests whether it is really a lower rung, within a stated tolerance, and if so adds the cheaper mapping alongside the stored one and marks it primary. Every test returns a Report, accepted or not, so it is always visible why a grid was labelled what it was.

Three tests are provided:

  • regular_axis: a 1D coordinate vector is evenly spaced (R2 to R1; GDAL’s IsRegularlySpaced and GuessGeoTransform);
  • regular_axis_through: evenly spaced after a 1D change of frame (AVISO’s latitude vector is regular in Mercator y);
  • regular_grid_through: 2D coordinate arrays are an affine grid after a change of frame (cryptic curvilinear to R1, the NSIDC case).

The frame change is a plain function supplied by the caller, so this crate needs no CRS backend.

Structs§

Report
The outcome of one normalisation test.

Enums§

Tolerance
How far stored coordinates may sit from the fitted mapping.

Functions§

affine_from_axes
An affine transform from the primary mappings of a row dim and a col dim, when both are R1 (Regular1) in the same frame.
normalise_domain
The conservative default (design doc 02, gate 2 default 3): every 1D rectilinear mapping that is evenly spaced within Float32 tolerance gains a regular mapping, marked primary. Stored mappings are kept.
normalise_domain_with
As normalise_domain, with a chosen tolerance.
regular_axis
Test whether a 1D coordinate vector is evenly spaced.
regular_axis_through
Test whether a 1D coordinate vector is evenly spaced after applying f to every value (for example latitude to Mercator y). through names the frame f maps into. On success the returned positions are in that frame.
regular_grid_through
Test whether 2D coordinate arrays (centres, shaped [nrow, ncol]) form an affine grid after mapping each (x, y) pair through f. through names the frame f maps into. None from f fails the test.