pystamps.pipeline.ported

Public classes

  • PortedStageError(RuntimeError)
  • StageOptions
  • Parms
  • Stage5PatchBundle
  • Stage1MetadataResolution

resolve_stage1_metadata(patch_dir, ij)

def resolve_stage1_metadata(patch_dir: Path, ij: np.ndarray) -> Stage1MetadataResolution

Builds/locates required files day/master/bperp metadata. Synthesizes from SNAP-style diff0 metadata if needed.

Inferred: fallback raises if multiple master days in SNAP set.

Stage functions

FunctionSignatureReturnNotes
stage1_load_initialstage1_load_initial(patch_dir: Path, backend: str='auto') -> strstatus messagerequires pscands files; writes ps1/ph1/bp1/psver/da1/hgt1 as available
stage2_estimate_gammastage2_estimate_gamma(patch_dir: Path, backend: str='auto', checkpoint_mode: str='final', checkpoint_interval: int=1, debug: bool=False) -> strstatus messagewrites pm1, uses stage2 weighting and optional debug snapshot; default checkpoint mode is final-only
stage3_select_psstage3_select_ps(patch_dir: Path, backend: str='auto') -> strstatus messagereads pm1/ps1; writes select1
stage4_weed_psstage4_weed_ps(patch_dir: Path, backend: str='auto', debug: bool=False, strict_reference: bool=False) -> strstatus messagewrites weed1 and optional debug
stage5_correct_and_promotestage5_correct_and_promote(patch_dir: Path, backend: str='auto') -> strstatus messagewrites ph2/pm2/other patch artifacts
stage5_merge_and_ifgstdstage5_merge_and_ifgstd(dataset_root: Path, backend='auto', io_workers: int=0, mat_cache: dict|None=None, enable_mat_cache: bool=True) -> strstatus messagereads across patches and writes merged ps2/ph2/.../ifgstd2
stage6_unwrapstage6_unwrap(dataset_root: Path, backend='auto', io_workers: int=0, enable_mat_cache: bool=True, mat_cache: dict|None=None) -> strstatus messagewrites phuw2, uw_grid, uw_interp, uw_phaseuw
stage7_calc_sclastage7_calc_scla(dataset_root: Path, backend='auto', chunk_ps: int=0, enable_mat_cache: bool=True, io_workers: int=0, mat_cache: dict|None=None, triangle_path: str|None=None) -> strstatus messagecalls kernel stage7; writes raw scla2.mat and smoothed scla_smooth2.mat
stage8_filter_scnstage8_filter_scn(dataset_root: Path, backend='auto', chunk_edges: int=0, chunk_ps: int=0, enable_mat_cache: bool=True, io_workers: int=0, mat_cache: dict|None=None) -> strstatus messagereruns the final unwrap-backed products, exports mean_v.mat, and writes uw_space_time.mat

Exceptions & side effects

Most functions raise PortedStageError for missing prerequisite artifacts or invalid data shapes. Functions are file-oriented and mutate dataset directories with MAT artifacts. Optional mat_cache is a mutable in-memory dict for parsed matrices.