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
| Function | Signature | Return | Notes |
|---|---|---|---|
| stage1_load_initial | stage1_load_initial(patch_dir: Path, backend: str='auto') -> str | status message | requires pscands files; writes ps1/ph1/bp1/psver/da1/hgt1 as available |
| stage2_estimate_gamma | stage2_estimate_gamma(patch_dir: Path, backend: str='auto', checkpoint_mode: str='final', checkpoint_interval: int=1, debug: bool=False) -> str | status message | writes pm1, uses stage2 weighting and optional debug snapshot; default checkpoint mode is final-only |
| stage3_select_ps | stage3_select_ps(patch_dir: Path, backend: str='auto') -> str | status message | reads pm1/ps1; writes select1 |
| stage4_weed_ps | stage4_weed_ps(patch_dir: Path, backend: str='auto', debug: bool=False, strict_reference: bool=False) -> str | status message | writes weed1 and optional debug |
| stage5_correct_and_promote | stage5_correct_and_promote(patch_dir: Path, backend: str='auto') -> str | status message | writes ph2/pm2/other patch artifacts |
| stage5_merge_and_ifgstd | stage5_merge_and_ifgstd(dataset_root: Path, backend='auto', io_workers: int=0, mat_cache: dict|None=None, enable_mat_cache: bool=True) -> str | status message | reads across patches and writes merged ps2/ph2/.../ifgstd2 |
| stage6_unwrap | stage6_unwrap(dataset_root: Path, backend='auto', io_workers: int=0, enable_mat_cache: bool=True, mat_cache: dict|None=None) -> str | status message | writes phuw2, uw_grid, uw_interp, uw_phaseuw |
| stage7_calc_scla | stage7_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) -> str | status message | calls kernel stage7; writes raw scla2.mat and smoothed scla_smooth2.mat |
| stage8_filter_scn | stage8_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) -> str | status message | reruns 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.