🔸NISAR#
RSLC (nisar_rslc)#
The nisar_rslc function extracts C2 matrix elements from the given NISAR RSLC .h5 file and saves them into a C2 directory.
- polsartools.nisar_rslc(inFile, matrixType='C3', azlks=22, rglks=10, outType='tif', max_workers=None)[source]
Extracts the C2 (for dual-pol), S2/C3/T3 (for full-pol) matrix elements from a NISAR RSLC HDF5 file and saves them into respective binary files.
Example:#
>>> nisar_rslc("path_to_file.h5", azlks=30, rglks=15) This will extract the C2 (for dual-pol), S2/C3/T3 (for full-pol) matrix elements from the specified NISAR RSLC file and save them in the respective folders.
Parameters:#
- inFilestr
The path to the NISAR RSLC HDF5 file containing the radar data.
- azlksint, optional (default=22)
The number of azimuth looks for multi-looking.
- rglksint, optional (default=10)
The number of range looks for multi-looking.
- matrixTypestr, optional (default = C2 for dual-pol, C3 for full-pol)
Type of matrix to extract. Valid options are ‘C2’, ‘S2’, ‘C3’, and ‘T3’.
Returns:#
- None
The function does not return any value. Instead, it creates a folder named C2/S2/C3/T3 (if not already present) and saves the following binary files:
Raises:#
- Exception
If the RSLC HDF5 file is invalid or cannot be read.
GSLC (nisar_gslc)#
The nisar_gslc function extracts C2 matrix elements from the given NISAR GSLC .h5 file and saves them into a C2 directory.
- polsartools.nisar_gslc(inFile, matrixType='C3', azlks=2, rglks=2, outType='tif', max_workers=None)[source]
Extracts the C2 matrix elements (C11, C22, and C12) from a NISAR GSLC HDF5 file and saves them into respective binary files.
Example:#
>>> nisar_gslc("path_to_file.h5", azlks=30, rglks=15) This will extract the C2 matrix elements from the specified NISAR GSLC file and save them in the 'C2' folder.
Parameters:#
- inFilestr
The path to the NISAR GSLC HDF5 file containing the radar data.
- azlksint, optional (default=20)
The number of azimuth looks for multi-looking.
- rglksint, optional (default=10)
The number of range looks for multi-looking.
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:#
- Exception
If the GSLC HDF5 file is invalid or cannot be read.