Skip to content

Half Flight

Module: spectralbridge.half_flight.

Opt-in half-flight helpers for split_across_track=True.

Default full-flightline processing does not use this module. When split_across_track=True, one original H5 is shared and two renamed flight folders receive heading-aware half-route windows. Folder names are always _left / _right:

  • North–south elongated footprints → line windows (left = northern/first lines, right = southern/second lines)
  • East–west elongated footprints → sample windows (left = western/first samples, right = eastern/second samples)

This matches half of the flight route (not half of the sensor swath).

API glossary · Workflow / scientific context

Signatures and documentation below are collected from the current source. Advanced objects are not newly declared stable by inclusion here.

Audience: advanced.

HalfWindow dataclass

HalfWindow(side: HalfSide, orientation: FootprintOrientation, sample_start: int, sample_stop: int, line_start: int, line_stop: int, full_samples: int, full_lines: int)

Half-open raster window for one half-flight product.

sample_slice property

sample_slice: slice | None

line_slice property

line_slice: slice | None

Audience: advanced.

classify_footprint_orientation

classify_footprint_orientation(*, n_lines: int, n_samples: int, pixel_x: float = 1.0, pixel_y: float = 1.0) -> FootprintOrientation

Classify corridor orientation from geographic footprint extents.

North–south corridors are taller in northing and are halved along lines. East–west corridors are wider in easting and are halved along samples. Both modes still name products left / right.

Audience: advanced.

across_track_slices

across_track_slices(n_samples: int) -> dict[HalfSide, tuple[int, int]]

Return left/right column windows (east–west half-route mode).

The right half receives the extra column when n_samples is odd.

Audience: advanced.

along_track_slices

along_track_slices(n_lines: int) -> dict[HalfSide, tuple[int, int]]

Return left/right line windows (north–south half-route mode).

left is lines [0:mid] (north in standard NEON north-up map info). right is lines [mid:n] and receives the extra line when odd.

Audience: advanced.

half_flight_id

half_flight_id(original_flight_id: str, side: HalfSide) -> str

Append a validated left/right half-route suffix to the original flight identifier.

Audience: advanced.

plan_half_flight

plan_half_flight(h5_path: Path | str) -> tuple[FootprintOrientation, tuple[HalfWindow, HalfWindow]]

Plan heading-aware half-route windows for one NEON H5.