sidescanpy.export.georef_window#

Georeferenced (northing x easting meters) windowed export.

Resamples a bounded square region directly at an explicit (resolution_m, size_px), centered on a given real-world lat/lon — builds on the survey-wide georeferencing/gridding path already in sidescanpy.grids. Produces a SideScanGriddedRaster (an in-memory xarray-backed raster with northing/easting coordinates and CRS metadata), not a file; sidescanpy.grids.to_geotiff() writes it as a GeoTIFF (needs the geo extra).

2026 rshomberg@uri.edu

Contents

extract_georef_window

Resample a size_px x size_px square region, centered on (center_lat, center_lon), at exactly resolution_m meters/pixel on both axes — built directly in the auto-selected UTM CRS (not via a WGS84 bbox roundtrip), so size_px and resolution_m alone determine the real-world extent, matching sidescanpy.export.geometric_window.extract_geometric_window()'s contract exactly.

locate_point

Translate a real-world (lat, lon) point into pixel (row, col) coordinates within a raster produced by extract_georef_window(), using that call's own returned meta — for marking a different point than the one the window was centered on.

sidescanpy.export.georef_window.extract_georef_window(channel_ds, size_px, *, resolution_m, center_lat, center_lon, method=ResamplingMethod.MEAN, backscatter_var='backscatter_intensity', max_search_radius_m=None, interp_method=None)#

Resample a size_px x size_px square region, centered on (center_lat, center_lon), at exactly resolution_m meters/pixel on both axes — built directly in the auto-selected UTM CRS (not via a WGS84 bbox roundtrip), so size_px and resolution_m alone determine the real-world extent, matching sidescanpy.export.geometric_window.extract_geometric_window()’s contract exactly. Port and starboard are pooled as independent observations by design (resample_channel_to_grid’s own convention) — this is the one mode where a channel side can’t be selected.

Parameters:
channel_dsxr.Dataset

Already ping-sliced to a neighborhood comfortably containing the requested extent around the center.

size_pxint

Output side length in pixels.

resolution_mfloat

Meters per pixel, both axes.

center_lat, center_lonfloat

Real-world center of the requested window, WGS84 degrees (e.g. a target’s own position, read directly from latitude_per_sample/longitude_per_sample at its ping/sample/channel).

max_search_radius_mfloat, optional

Passed straight through to resample_channel_to_grid (defaults to its own 1.5 * resolution_m) – see sidescanpy.export.geometric_window.extract_geometric_window()’s own search_radius_m docstring for when a wider radius is needed (a survey whose along-track position updates far less often than its ping rate).

interp_method{“linear”, “cubic”, “nearest”}, optional

Interpolate with scipy.interpolate.griddata (interpolate_scattered()) instead of aggregating within a search radius (method). Cells farther than max_search_radius_m (default 1.5 * resolution_m) from every sample are NaN. Radius aggregation spreads each sample over a disk of that radius, which blurs a window finer than the ping spacing and turns isolated dark samples into dark disks; interpolation keeps the detail the samples have.

Returns:
(raster, meta)

meta has center_row/center_col (the requested center’s own pixel position — always the exact middle, by construction) for immediate use, plus enough to locate a different real-world point in this same raster later via locate_point().

sidescanpy.export.georef_window.locate_point(lat, lon, meta)#

Translate a real-world (lat, lon) point into pixel (row, col) coordinates within a raster produced by extract_georef_window(), using that call’s own returned meta — for marking a different point than the one the window was centered on.