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
Resample a |
|
Translate a real-world |
- 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_pxsquare region, centered on(center_lat, center_lon), at exactlyresolution_mmeters/pixel on both axes — built directly in the auto-selected UTM CRS (not via a WGS84 bbox roundtrip), sosize_pxandresolution_malone determine the real-world extent, matchingsidescanpy.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_sampleat its ping/sample/channel).- max_search_radius_mfloat, optional
Passed straight through to
resample_channel_to_grid(defaults to its own1.5 * resolution_m) – seesidescanpy.export.geometric_window.extract_geometric_window()’s ownsearch_radius_mdocstring 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 thanmax_search_radius_m(default1.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)
metahascenter_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 vialocate_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 byextract_georef_window(), using that call’s own returnedmeta— for marking a different point than the one the window was centered on.