Degree of Polarization (dop_dp) — PolSARtools 0.10 documentation

Skip to main content
`Ctrl`+`K`

# Degree of Polarization (`dop_dp`)

polsartools.dop_dp(in_dir, win=1, fmt='tif', cog=False, ovr=[2, 4, 8, 16], comp=False, max_workers=None, block_size=(512, 512), progress_callback=None)

  Computes Barakat degree of polarization (DOP) from the input dual-polarization (dual-pol) C2 matrix data, and writes the output in various formats (GeoTIFF or binary). The computation is performed in parallel for efficiency.

  ## Example:

      >>> dop_dp("path_to_C2_folder", win=5, fmt="tif", cog=True)
      This will compute Barakat degree of polarization from the C2 matrix in the specified folder,
      generating output in Geotiff format with Cloud Optimized GeoTIFF settings enabled.

  ## Parameters:

  in_dirstr

    Path to the input folder containing C2 matrix data.

  winint, optional

    Size of the processing window (default is 1).

  fmtstr, optional

    Output format of the files; can be “tif” (GeoTIFF) or “bin” (binary) (default is “tif”).

  cogbool, optional

    If True, outputs Cloud Optimized GeoTIFF (COG) (default is False).

  ovrlist of int, optional

    List of overview levels to be used for COGs (default is [2, 4, 8, 16]).

  compbool, optional

    If True, applies LZW compression to reduce file size (default is False).

  max_workersint, optional

    Number of parallel workers for processing (default is None, which uses one less than the number of available CPU cores).

  block_sizetuple of int, optional

    Size of each processing block (default is (512, 512)), defining the spatial chunk dimensions used in parallel computation.

  ## Returns:

  None

    The function writes the computed Barakat degree of polarization to the specified output format.

  ## Output Files:

  - “dopdp.tif” or “dopdp.bin”

\[\text{DOP}_{dp}=\sqrt{1-\frac{4\times\text{det([C2])}}{\text{(Trace[C2])}^2}}\]

where, \(\text{[C2]}\) is co-variance matrix. Further details on the Barakat Degree of polarization can be found in [[10]](#10)