🔸ALOS-2 PALSAR-2#
FBD L1.1 (import_alos2_fbd_l11)#
The import_alos2_fbd_l11 function extracts C2 matrix elements from the given ALOS-2 FBD mode folder and saves them into a C2 directory.
- polsartools.import_alos2_fbd_l11(in_dir, mat='C2', azlks=3, rglks=2, fmt='tif', cog=False, ovr=[2, 4, 8, 16], comp=False, out_dir=None, cf_dB=-83)[source]
Extracts the C2 matrix elements (C11, C22, and C12) from ALOS-2 Fine Beam Dual-Pol (FBD) CEOS data and saves them into respective binary files.
Example:#
>>> import_alos2_fbd_l11("path_to_folder", azlks=5, rglks=3) This will extract the C2 matrix elements from the ALOS-2 Fine Beam Dual-Pol data in the specified folder and save them in the 'C2' directory.
Parameters:#
- in_dirstr
The path to the folder containing the ALOS-2 Fine Beam Dual-Pol CEOS data files.
- matstr, optional (default = ‘S2’ or ‘Sxy)
Type of matrix to extract. Valid options: ‘Sxy’,’C2’, ‘T2’.
- azlksint, optional (default=3)
The number of azimuth looks for multi-looking.
- rglksint, optional (default=2)
The number of range looks for multi-looking.
- 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.
- 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.
- cf_dBfloat, optional (default=-83)
The calibration factor in dB used to scale the raw radar data. It is applied to the HH and HV polarization data before matrix computation.
Returns:#
- None
The function does not return any value. Instead, it creates a folder named C2 (if not already present) and saves the following binary files:
C11.bin: Contains the C11 matrix elements.
C22.bin: Contains the C22 matrix elements.
C12_real.bin: Contains the real part of the C12 matrix.
C12_imag.bin: Contains the imaginary part of the C12 matrix.
config.txt: A text file containing grid dimensions and polarimetric configuration.
Raises:#
- FileNotFoundError
If the required ALOS-2 data files (e.g., IMG-HH and IMG-HV) cannot be found in the specified folder.
- ValueError
If the calibration factor is invalid or if the files are not in the expected format.
HBQ L1.1 (import_alos2_hbq_l11)#
The import_alos2_hbq_l11 function extracts S2/T3/T4/C3/C4/C2/T2 matrix elements from the given ALOS-2 HBQ mode folder and saves them into a corresponding directories.
- polsartools.import_alos2_hbq_l11(in_dir, mat='T3', azlks=8, rglks=4, fmt='tif', cog=False, ovr=[2, 4, 8, 16], comp=False, out_dir=None, recip=False, cf_dB=-83)[source]
Extracts single look S2 or Multi-look T3/C3 matrix elements from ALOS-2 Quad-Pol (HBQ) CEOS data and saves them into respective binary files.
Example:#
>>> import_alos2_hbq_l11("path_to_folder", azlks=5, rglks=3) This will extract the T3 matrix elements from the ALOS-2 Full-pol data in the specified folder and save them in the selected matrix directory.
Parameters:#
- in_dirstr
The path to the folder containing the ALOS-2 Quad-Pol (HBQ) CEOS data folder.
- 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 for multi-looking.
- rglksint, optional (default=4)
The number of range looks for multi-looking.
- 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.
- 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.
- cf_dBfloat, optional (default=-83)
The calibration factor in dB used to scale the raw radar data. It is applied to the HH and HV polarization data before matrix computation.
Returns:#
- None
The function does not return any value. Instead, it creates a folders named ‘S2` or ‘C3` or ‘T3` (depending on the chosen matrix) and saves the corresponding binary files.
WBD L1.1 (import_alos2_wbd_l11)#
The import_alos2_wbd_l11 function extracts C2 matrix elements from the given ALOS-2 WBD mode folder (for any given swath) and saves them into a C2 directory.
- polsartools.import_alos2_wbd_l11(in_dir, mat='C2', azlks=25, rglks=5, swath=1, fmt='tif', cog=False, ovr=[2, 4, 8, 16], comp=False, out_dir=None, cf_dB=-83)[source]
Extracts the C2 matrix elements (C11, C22, and C12) from ALOS-2 Wide Beam Dual-Pol (WBD) CEOS data and saves them into respective binary files.
Example:#
>>> import_alos2_wbd_l11("path_to_folder", azlks=25, rglks=5) This will extract the C2 matrix elements from the ALOS-2 Wide Beam Dual-Pol data in the specified folder and save them in the 'C2' directory.
Parameters:#
- in_dirstr
The path to the folder containing the ALOS-2 Wide Beam Dual-Pol CEOS data files.
- matstr, optional (default = ‘S2’ or ‘Sxy)
Type of matrix to extract. Valid options: ‘Sxy’,’C2’, ‘T2’.
- azlksint, optional (default=25)
The number of azimuth looks for multi-looking.
- rglksint, optional (default=5)
The number of range looks for multi-looking.
- swathint, optional (default=1)
The swath number [1,2,3,4,5].
- 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.
- 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.
- cf_dBfloat, optional (default=-83)
The calibration factor in dB used to scale the raw radar data. It is applied to the HH and HV polarization data before matrix computation.
Returns:#
- None
The function does not return any value. Instead, it creates a folder named C2 (if not already present) and saves the following binary files:
C11.bin: Contains the C11 matrix elements.
C22.bin: Contains the C22 matrix elements.
C12_real.bin: Contains the real part of the C12 matrix.
C12_imag.bin: Contains the imaginary part of the C12 matrix.
config.txt: A text file containing grid dimensions and polarimetric configuration.
Raises:#
- FileNotFoundError
If the required ALOS-2 data files (e.g., IMG-HH and IMG-HV) cannot be found in the specified folder.
- ValueError
If the calibration factor is invalid or if the files are not in the expected format.