🔸RADARSAT-2#

Full-pol (import_rs2_fp)#

The import_rs2_fp function extracts matrix elements (S2/C4/T4/C3/T3/C2/T2) from the given RADARSAT-2 folder and saves them into respective directories.

polsartools.import_rs2_fp(in_dir, mat='T3', azlks=8, rglks=2, fmt='tif', cog=False, ovr=[2, 4, 8, 16], comp=False, bsc='sigma0', out_dir=None, recip=False)[source]

Process radarsat-2 image data and generate the specified matrix (‘S2’, ‘C4’, ‘C3’, ‘T4’, ‘T3’, ‘C2HX’, ‘C2VX’, ‘C2HV’, ‘T2HV’) from the input imagery files.

This function reads radarsat-2 image data in the form of .tif files (HH, HV, VH, VV) from the input folder (in_dir) and calculates either the ‘S2’, ‘C4’, ‘C3’, ‘T4’, ‘T3’, ‘C2HX’, ‘C2VX’, ‘C2HV’, ‘T2HV’ matrix. The resulting matrix is then saved in a corresponding directory. The function uses lookup tables (lutSigma.xml, lutGamma.xml, lutBeta.xml) for scaling the data based on the chosen backscatter coefficient bsc (sigma0, gamma0, or beta0). The processed data is written into binary files in the output folder.

Example Usage:#

To process imagery and generate a T3 matrix:

import_rs2_fp("/path/to/data", mat="T3", bsc="sigma0")

To process imagery and generate a C3 matrix:

import_rs2_fp("/path/to/data", mat="C3", bsc="beta0", azlks=10, rglks=3)

Parameters:#

in_dirstr

Path to the folder containing the Radarsat-2 files and the lookup tables (lutSigma.xml, lutGamma.xml, lutBeta.xml).

matstr, optional (default=’T3’)

Type of matrix to extract. Valid options: ‘S2’, ‘C4, ‘C3’, ‘T4’, ‘T3’, ‘C2HX’, ‘C2VX’, ‘C2HV’,’T2HV’

azlksint, optional (default=8)

The number of azimuth looks to apply during the C/T processing.

rglksint, optional (default=2)

The number of range looks to apply during the C/Tprocessing.

fmt{‘tif’, ‘bin’}, optional (default=’tif’)

Output format: - ‘tif’: GeoTIFF - ‘bin’: Raw binary format

cogbool, optional (default=False)

If True, outputs will be saved as Cloud Optimized GeoTIFFs with internal tiling and overviews.

ovrlist of int, optional (default=[2, 4, 8, 16])

Overview levels for COG generation. Ignored if cog=False.

compbool, optional (default=False)

If True, applies LZW compression to GeoTIFF outputs.

bscstr, optional (default=’sigma0’)

The type of radar cross-section to use for scaling. Available options:

  • ‘sigma0’ : Uses lutSigma.xml for scaling.

  • ‘gamma0’ : Uses lutGamma.xml for scaling.

  • ‘beta0’ : Uses lutBeta.xml for scaling.

out_dirstr or None, optional (default=None)

Directory to save output files. If None, a folder named after the matrix type will be created in the same location as the input file.

recipbool, optional (default=False)

If True, scattering matrix reciprocal symmetry is applied, i.e, S_HV = S_VH.