Simulate Compact-pol SAR (simulate_CP)#
- polsartools.simulate_CP(in_dir, chi=45, psi=0, win=1, fmt='tif', cog=False, ovr=[2, 4, 8, 16], comp=False, max_workers=None, block_size=(512, 512), progress_callback=None)[source]
This function simulates Compact polarimetric C2 matrix (RHV, LHV, pi/4 etc) from full polarimetric C3/T3 matrix.
Examples
>>> # Basic usage with default LC >>> simulate_CP("/path/to/C3")
>>> # With chi, psi and COG GeoTIFF output >>> simulate_CP("/path/to/C3", chi=-45, psi=0, fmt="tif", cog=True)
- Parameters:
in_dir (str) – Path to the input folder containing a supported polarimetric matrix.
chi (float, default=45) – Ellipticity angle chi of the transmitted wave in degrees. For circular polarization, chi = 45° (right circular) or -45° (left circular).
psi (float, default=0) – Orientation angle psi of the transmitted wave in degrees. For circular polarization, typically 0°.
fmt ({'tif', 'bin'}, default='tif') – Output format: - ‘tif’: Cloud-optimized GeoTIFF (if cog_flag is True) - ‘bin’: Raw binary format
cog (bool, default=False) – Enable Cloud Optimized GeoTIFF output with internal overviews and tiling.
ovr (list[int], default=[2, 4, 8, 16]) – Overview levels for pyramid generation (used with COGs).
comp (bool, default=False) – If True, uses LZW compression for GeoTIFF outputs.
max_workers (int | None, default=None) – Maximum number of parallel worker threads (defaults to all available CPUs).
block_size (tuple[int, int], default=(512, 512)) – Size of processing blocks for chunked and parallel execution.
- Returns:
The simulated CP C2 matrix elements
- Return type:
None