Gridding#
sidescanpy.grids resamples georeferenced backscatter onto a regular
raster. The input needs latitude_per_sample / longitude_per_sample
(the georef correction step).
from sidescanpy.grids import grid_channel, recommend_resolution, to_geotiff
res = recommend_resolution(ds) # half the finer of ping spacing and sample interval
raster = grid_channel(ds, resolution_m=res, method="median")
to_geotiff(raster, "survey.tif") # needs the [geo] extra
Functions and types#
Object |
Purpose |
|---|---|
|
bounding box, resolution and CRS of a grid |
|
a grid in the UTM zone containing the bbox centre |
|
a padded (south, west, north, east) box around the data |
|
the resampler |
|
the two steps above in one call, on a UTM grid fit to the data |
|
the result: an |
|
single-band GeoTIFF via rioxarray |
Methods#
ResamplingMethod: mean, median, max, nearest, idw. Each sample
is an independent observation; port and starboard are never averaged
together before gridding. Samples within a search radius of each cell
centre contribute (radius derived from the resolution unless
max_search_radius_m is given); empty cells are NaN.
Projected grids name their coordinates northing / easting (meters);
geographic grids use latitude / longitude.
Notes#
A UTM grid uses the zone containing the bbox centre. A survey wider than a zone puts its edges in a neighbouring zone’s frame.
bbox_from_channel_datasetpads by a fixed amount in degrees, which is negligible for a survey but large for a very small test dataset.Grid to a map grids a public line with inverse-distance weighting and writes the GeoTIFF.