Analyzer
The InSARHub analyzer module provides workflow for InSAR time-series analysis.
-
Import analyzer
Import the Analyzer class to access all time-series analysis functionality
-
View Available Analyzers
List all registered analyzer
Available Analyzers
Mintpy_SBAS_Base_Analyzer
InSARHub wrapped Mintpy as one of it's analysis backends. The Mintpy_SBAS_Base_Analyzer is implemented on top of a reusable base configuration class, which provides the full smallbaselineApp logic of Mintpy. Provides users with an experience similar to using MintPy directly, allowing full customization of processing parameters and steps.
Source code in src/insarhub/analyzer/mintpy_base.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
Usage
-
Create Analyzer with Parameters
Initialize a analyzer instance
ORanalyzer = Analyzer.create('Mintpy_SBAS_Base_Analyzer', workdir="/your/work/dir", load_processor= "hyp3", ....)ORparams = {"workdir":"/your/work/dir","load_processor": "hyp3" ....} analyzer = Analyzer.create('Mintpy_SBAS_Base_Analyzer', **params)from insarhub.config import Mintpy_SBAS_Base_Config cfg = Mintpy_SBAS_Base_Config(workdir="/your/work/dir", load_processor= "hyp3", ....) analyzer = Analyzer.create('Mintpy_SBAS_Base_Analyzer', config=cfg)The base configure
Mintpy_SBAS_Base_Configcontains all parameters from MintpysmallbaselineApp.cfg. For detailed descriptions and usage of each parameters, please refer to the official Mintpy config documentation.Source code in
src/insarhub/config/defaultconfig.py183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
@dataclass class Mintpy_SBAS_Base_Config: ''' Dataclass containing all configuration options for Mintpy SBAS jobs. ''' name: str = "Mintpy_SBAS_Base_Config" workdir: Path | str = field(default_factory=lambda: Path.cwd()) debug: bool = False ## computing resource configuration compute_maxMemory : float | int = _env['memory'] compute_cluster : str = 'local' # Mintpy's slurm parallel processing is buggy, so we will handle parallel processing with dask instead. Switch to none to turn off parallel processing to save memory. compute_numWorker : int = _env['cpu'] compute_config: str = 'none' ## Load data load_processor: str = 'auto' load_autoPath: str = 'auto' load_updateMode: str = 'auto' load_compression: str = 'auto' ##---------for ISCE only: load_metaFile: str = 'auto' load_baselineDir: str = 'auto' ##---------interferogram stack: load_unwFile: str = 'auto' load_corFile: str = 'auto' load_connCompFile: str = 'auto' load_intFile: str = 'auto' load_magFile: str = 'auto' ##---------ionosphere stack (optional): load_ionUnwFile: str = 'auto' load_ionCorFile: str = 'auto' load_ionConnCompFile: str = 'auto' ##---------offset stack (optional): load_azOffFile: str = 'auto' load_rgOffFile: str = 'auto' load_azOffStdFile: str = 'auto' load_rgOffStdFile: str = 'auto' load_offSnrFile: str = 'auto' ##---------geometry: load_demFile: str = 'auto' load_lookupYFile: str = 'auto' load_lookupXFile: str = 'auto' load_incAngleFile: str = 'auto' load_azAngleFile: str = 'auto' load_shadowMaskFile: str = 'auto' load_waterMaskFile: str = 'auto' load_bperpFile: str = 'auto' ##---------subset (optional): subset_yx: str = 'auto' subset_lalo: str = 'auto' ##---------multilook (optional): multilook_method: str = 'auto' multilook_ystep: str | int = 'auto' multilook_xstep: str | int= 'auto' # 2. Modify Network network_tempBaseMax: str | float = 'auto' network_perpBaseMax: str | float = 'auto' network_connNumMax: str | int = 'auto' network_startDate: str = 'auto' network_endDate: str = 'auto' network_excludeDate: str = 'auto' network_excludeDate12: str = 'auto' network_excludeIfgIndex: str = 'auto' network_referenceFile: str = 'auto' ## 2) Data-driven network modification network_coherenceBased: str = 'auto' network_minCoherence: str |float = 'auto' ## b - Effective Coherence Ratio network modification = (threshold + MST) by default network_areaRatioBased: str = 'auto' network_minAreaRatio: str |float= 'auto' ## Additional common parameters for the 2) data-driven network modification network_keepMinSpanTree: str = 'auto' network_maskFile: str = 'auto' network_aoiYX: str = 'auto' network_aoiLALO: str = 'auto' # 3. Reference Point reference_yx: str = 'auto' reference_lalo: str = 'auto' reference_maskFile: str = 'auto' reference_coherenceFile: str = 'auto' reference_minCoherence: str |float = 'auto' # 4. Correct Unwrap Error unwrapError_method: str = 'auto' unwrapError_waterMaskFile: str = 'auto' unwrapError_connCompMinArea: str |float = 'auto' ## phase_closure options: unwrapError_numSample: str | int= 'auto' ## bridging options: unwrapError_ramp: str = 'auto' unwrapError_bridgePtsRadius: str | int= 'auto' # 5. Invert Network networkInversion_weightFunc: str = 'auto' networkInversion_waterMaskFile: str = 'auto' networkInversion_minNormVelocity: str = 'auto' ## mask options for unwrapPhase of each interferogram before inversion (recommend if weightFunct=no): networkInversion_maskDataset: str = 'auto' networkInversion_maskThreshold: str | float = 'auto' networkInversion_minRedundancy: str | float = 'auto' ## Temporal coherence is calculated and used to generate the mask as the reliability measure networkInversion_minTempCoh: str | float = 'auto' networkInversion_minNumPixel: str | int = 'auto' networkInversion_shadowMask: str = 'auto' # 6. Correct SET (Solid Earth Tides) solidEarthTides: str = 'auto' # 7. Correct Ionosphere ionosphericDelay_method: str = 'auto' ionosphericDelay_excludeDate: str = 'auto' ionosphericDelay_excludeDate12: str = 'auto' # 8. Correct Troposphere troposphericDelay_method: str = 'auto' ## Notes for pyaps: troposphericDelay_weatherModel: str = 'auto' troposphericDelay_weatherDir: str = 'auto' ## Notes for height_correlation: troposphericDelay_polyOrder: str | int = 'auto' troposphericDelay_looks: str | int = 'auto' troposphericDelay_minCorrelation: str | float = 'auto' ## Notes for gacos: troposphericDelay_gacosDir: str = 'auto' # 9. Deramp deramp: str = 'auto' deramp_maskFile: str = 'auto' # 10. Correct Topography topographicResidual: str = 'auto' topographicResidual_polyOrder: str = 'auto' topographicResidual_phaseVelocity: str = 'auto' topographicResidual_stepDate: str = 'auto' topographicResidual_excludeDate: str = 'auto' topographicResidual_pixelwiseGeometry: str = 'auto' # 11.1 Residual RMS residualRMS_maskFile: str = 'auto' residualRMS_deramp: str = 'auto' residualRMS_cutoff: str | float = 'auto' # 11.2 Reference Date reference_date: str = 'auto' # 12. Velocity timeFunc_startDate: str = 'auto' timeFunc_endDate: str = 'auto' timeFunc_excludeDate: str = 'auto' ## Fit a suite of time functions timeFunc_polynomial: str | int = 'auto' timeFunc_periodic: str = 'auto' timeFunc_stepDate: str = 'auto' timeFunc_exp: str = 'auto' timeFunc_log: str = 'auto' ## Uncertainty quantification methods: timeFunc_uncertaintyQuantification: str = 'auto' timeFunc_timeSeriesCovFile: str = 'auto' timeFunc_bootstrapCount: str | int = 'auto' # 13.1 Geocode geocode: str = 'auto' geocode_SNWE: str = 'auto' geocode_laloStep: str = 'auto' geocode_interpMethod: str = 'auto' geocode_fillValue: str | float = 'auto' # 13.2 Google Earth save_kmz: str = 'auto' # 13.3 HDFEOS5 save_hdfEos5: str = 'auto' save_hdfEos5_update: str = 'auto' save_hdfEos5_subset: str = 'auto' # 13.4 Plot plot: str = 'auto' plot_dpi: str | int = 'auto' plot_maxMemory: str | int = 'auto' def __post_init__(self): if isinstance(self.workdir, str): self.workdir = Path(self.workdir).expanduser().resolve() def write_mintpy_config(self, outpath: Union[Path, str]): """ Writes the dataclass to a mintpy .cfg file, excluding operational parameters that MintPy doesn't recognize. """ outpath = Path(outpath).expanduser().resolve() exclude_fields = ['name', 'workdir', 'debug'] with open(outpath, 'w') as f: f.write("## MintPy Config File Generated via InSARHub\n") for key, value in asdict(self).items(): if key in exclude_fields: continue parts = key.split('_') if len(parts) > 1: mintpy_key = f"mintpy.{parts[0]}.{'.'.join(parts[1:])}" else: mintpy_key = f"mintpy.{parts[0]}" f.write(f"{mintpy_key:<40} = {value}\n") return Path(outpath).resolve() -
Run
Run the Mintpy time-series analysis based on provid configurationParameters:
Name Type Description Default stepslist[str] | NoneList of MintPy processing steps to execute. If None, the default full workflow is executed: [ 'load_data', 'modify_network', 'reference_point', 'invert_network', 'correct_LOD', 'correct_SET', 'correct_ionosphere', 'correct_troposphere', 'deramp', 'correct_topography', 'residual_RMS', 'reference_date', 'velocity', 'geocode', 'google_earth', 'hdfeos5' ]
NoneRaises:
Type Description RuntimeErrorIf tropospheric delay method requires CDS authorization and authorization fails.
ExceptionPropagates exceptions raised during MintPy execution.
-
Clean up
Remove intermediate processing files generated during the time-series process
Hyp3_SBAS
The Hyp3_SBAS is specialized analyzer that extends Mintpy_SBAS_Base_Analyzer, preconfigured specifically for processing Time-series data for Hyp3 InSAR product.
Source code in src/insarhub/analyzer/hyp3_sbas.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
Usage
-
Create Analyzer with Parameters
Initialize a analyzer instance
OR ORfrom insarhub.config import Mintpy_SBAS_Base_Config cfg = Mintpy_SBAS_Base_Config(workdir="/your/work/dir") analyzer = Analyzer.create('Hyp3_SBAS', config=cfg)- Prepare data Prepare interferogram data download from hyp3 server to mintpy
Raises:
Type Description FileNotFoundErrorIf required input files are missing.
ValueErrorIf no common overlap region can be determined among rasters.
ExceptionPropagates any unexpected errors during preprocessing.
Source code in
src/insarhub/analyzer/hyp3_sbas.py- Run
Run the Mintpy time-series analysis based on provid configuration
Parameters:
Name Type Description Default stepslist[str] | NoneList of MintPy processing steps to execute. If None, the default full workflow is executed: [ 'load_data', 'modify_network', 'reference_point', 'invert_network', 'correct_LOD', 'correct_SET', 'correct_ionosphere', 'correct_troposphere', 'deramp', 'correct_topography', 'residual_RMS', 'reference_date', 'velocity', 'geocode', 'google_earth', 'hdfeos5' ]
NoneRaises:
Type Description RuntimeErrorIf tropospheric delay method requires CDS authorization and authorization fails.
ExceptionPropagates exceptions raised during MintPy execution.
Source code in
src/insarhub/analyzer/mintpy_base.py- Clean up
Remove intermediate processing files generated during the time-series process