sidescanpy.export.windows.levels#
Export styles, render levels, and the backscatter variables each level reads.
A style is the window shape (chip: a tight single-channel crop;
single-swath: one full channel; dual-swath: both channels side by
side). A render level is the processing state and coordinate system the
window is rendered in: uncorrected/db/radiometric crop native
sample/ping pixels; geometric/georef resample onto a real-meters
grid.
Neither uncorrected nor backscatter_db is stored on disk: they are
derived per loaded neighborhood by with_uncorrected_var() and
with_db_var().
2026 rshomberg@uri.edu
Contents
Export window styles. |
|
Render levels, in correction order. |
|
Render levels cropped in native sample/ping pixels (no |
|
Value name (pixel render level, or geometric/georef |
|
|
|
Set dropout samples (recorded amplitude exactly zero) to NaN. |
|
Add |
|
Slant-range meters per sample at |
|
How one export style is rendered. |
- sidescanpy.export.windows.levels.CHIP_STYLES = ('chip', 'single-swath', 'dual-swath')#
Export window styles.
- sidescanpy.export.windows.levels.RENDER_LEVELS = ('uncorrected', 'db', 'radiometric', 'geometric', 'georef')#
Render levels, in correction order.
- sidescanpy.export.windows.levels.PIXEL_LEVELS = ('uncorrected', 'db', 'radiometric')#
Render levels cropped in native sample/ping pixels (no
resolution_m).
- sidescanpy.export.windows.levels.LEVEL_VARS#
Value name (pixel render level, or geometric/georef
value_var) -> backscatter variable.
- sidescanpy.export.windows.levels.mask_nadir_gap_with_uncorrected(ds)#
mask_nadir_gap(), plusuncorrected.uncorrectedis derived from the masked intensity, so both carry the same NaN nadir gap.
- sidescanpy.export.windows.levels.mask_dropouts(ds)#
Set dropout samples (recorded amplitude exactly zero) to NaN.
A sample recorded as zero carries no measurement. It is found on
uncorrected(every radiometric step undone; at or belowMIN_LINEAR), which works whatever the correction state, including files corrected before TVG kept such samples at the dB floor, and masked inbackscatter_intensityanduncorrected. Resampling then interpolates over it instead of spreading it into a dark spot.- Parameters:
- dsxr.Dataset
Loaded channel with
uncorrected(mask_nadir_gap_with_uncorrected()).
- Returns:
- xr.Dataset
dsitself when nothing is masked, otherwise a copy.
- sidescanpy.export.windows.levels.with_db_var(ds)#
Add
backscatter_db(20*log10of the uncorrected signal, no TVG gain).The same raw-to-dB step
apply_tvg_to_amplitude()takes before adding gain.
- sidescanpy.export.windows.levels.nominal_sample_interval_m(ds)#
Slant-range meters per sample at
ds’s first ping.Uses
sample_rate_hzfromds.attrs(block-averaged neighborhoods divide it by their sample factor, so this reports the averaged cell size). Invalid sound velocity falls back to 1500 m/s as insample_interval_m(), without its per-call warning (this is called once per exported window).
- class sidescanpy.export.windows.levels.WindowSpec(style, level, size_px, jitter_px=0, resolution_m=None, value_var='radiometric', resample_method='griddata', across_axis='ground', swath_fill=False)#
Bases:
objectHow one export style is rendered.
- Attributes:
- stylestr
One of
CHIP_STYLES.- levelstr
One of
RENDER_LEVELS.- size_pxint
Output size (both axes).
- jitter_pxint, default 0
Uniform center jitter, in output pixels.
- resolution_mfloat, optional
Geometric/georef meters per output pixel;
Nonechooses it per window (seeextract_geo_style_window()).- value_varstr, default “radiometric”
Geometric/georef value (a key of
LEVEL_VARS). Pixel levels read the level’s own variable.- resample_methodstr, default “griddata”
Geometric resampler.
- across_axisstr, default “ground”
Geometric across-track axis (
"ground"or"slant").- swath_fillbool, default False
Geometric swath styles: frame the across-track extent the data fills.
- property is_pixel#
Whether the level crops native sample/ping pixels.
- property backscatter_var#
Variable a geometric/georef window resamples.
- property needs_db#
Whether
backscatter_dbmust be derived for this spec.