m-χ decomposition (m_chi)#
- polsartools.m_chi(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]
Perform M-chi Decomposition for compact-pol SAR data.
This function implements the M-chi Decomposition for compact-polarimetric SAR data, decomposing the total backscattered power into surface (Ps), double-bounce (Pd), and volume (Pv) scattering components.
Examples
>>> # Basic usage with default parameters >>> m_chi("/path/to/cp_data")
>>> # Advanced usage with custom parameters >>> m_chi( ... in_dir="/path/to/cp_data", ... chi=-45, ... win=5, ... fmt="tif", ... cog=True, ... block_size=(1024, 1024) ... )
- Parameters:
in_dir (str) – Path to the input folder containing compact-pol C2 matrix files.
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°.
win (int, default=1) – Size of the spatial averaging window. Larger windows reduce speckle noise but decrease spatial resolution.
fmt ({'tif', 'bin'}, default='tif') – Output file format: - ‘tif’: GeoTIFF format with georeferencing information - ‘bin’: Raw binary format
cog (bool, default=False) – If True, creates Cloud Optimized GeoTIFF (COG) outputs with internal tiling and overviews for efficient web access.
ovr (list[int], default=[2, 4, 8, 16]) – Overview levels for COG creation. Each number represents the decimation factor for that overview level.
comp (bool, default=False) – If True, applies LZW compression to the output GeoTIFF files.
max_workers (int | None, default=None) – Maximum number of parallel processing workers. If None, uses CPU count - 1 workers.
block_size (tuple[int, int], default=(512, 512)) – Size of processing blocks (rows, cols) for parallel computation. Larger blocks use more memory but may be more efficient.
- Returns:
Ps_m_chi: Surface scattering power component
Pd_m_chi: Double-bounce scattering power component
Pv_m_chi: Volume scattering power component
m_cp: Degree of polarization
chi_cp: chi angle in degrees
- Return type:
Writes four output files to disk