Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Basic Polarimetric Techniques with PolSARtools



This notebook introduces basic polarimetric analysis using NISAR quad-polarization GSLC (Geocoded Single-Look Complex) products and polSARtools. Full-polarimetric GSLC data contain complex measurements from the HH, HV, VH, and VV polarization channels, enabling analysis of different scattering mechanisms. Using polSARtools, this notebook utilizes both scene-wide and subsetted examples to demonstrate how to:

  • extract the C3 covariance matrix

  • apply a Refined-Lee speckle filter

  • create a Pauli decomposition RGB composite

  • create a HH/HV/VV RGB composite

This example uses NISAR GSLC products, which provide geocoded complex SAR imagery suitable for polarimetric analysis and other advanced SAR applications. For more information on NISAR GSLC data, refer to the NISAR Data User Guide.

1. Prerequisites

PrerequisiteImportanceNotes
The isce3 software environment for this cookbookNecessary
How to search and access NISAR data in your AOIHelpful
Familiarity with polSARtoolsHelpful
General knowledge of polarimetryHelpful
  • Rough Notebook Time Estimate: 45 mins


2. Search and Download Dara

Use asf_search to find NISAR data.

2a. Search for Data and Identify an Area of Interest (AOI)

Use the interactive map below to generate well-known-text (WKT) of your AOI. Copy the wkt and update the area_of_interest variable in the next code cell.

Found 1 GSLC products:
['https://nisar.asf.earthdatacloud.nasa.gov/NISAR/NISAR_L2_GSLC_PROVISIONAL_V1/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001.h5']

2b. Retain only the URL for the most recent version of each product in the search results

Data is occasionally re-released with an updated version. Versions are recorded as a Composite Release Identifier (CRID) in a product’s filename. We can use the CRID to retain only the most recent version of each product in the list of URLs.

Single GSLC product found. Skipping CRID filter.
Retained 1 GSLC products:
['https://nisar.asf.earthdatacloud.nasa.gov/NISAR/NISAR_L2_GSLC_PROVISIONAL_V1/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001.h5']

2c. Download the Data

data_dir: /home/jovyan/polSAR_GSLC_data
CPU times: user 161 μs, sys: 0 ns, total: 161 μs
Wall time: 156 μs
[PosixPath('/home/jovyan/polSAR_GSLC_data/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001.h5')]

3. Use polSARtools to Process Polarimetric Data

This notebook uses the polSARtools package to process and visualize full-polarization NISAR GSLC data. In the following sections, you’ll import the data, apply a speckle filter, and generate two commonly used RGB composites for interpretation.

/home/jovyan/polSAR_GSLC_data/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001.h5
<class 'str'>

4. Extract C3 Covariance Matrix

NISAR GSLC products can be represented in several polarimetric matrix formats. In this notebook, we’ll extract the C3 covariance matrix, which contains the information needed to create both the Pauli RGB decomposition and the HH/HV/VV RGB composite.

Creating the C3 matrix directly from a GSLC with PolSARtools provides more control over processing choices such as multilooking and filtering. However, PolSARtools does not apply NISAR’s radiometric terrain correction when creating the matrix. If RTC is an important part of your analysis, consider using a GCOV product or manually creating a C3 matrix.

More about the C3 covariance matrix

The C3 covariance matrix is derived from the full-polarimetric scattering matrix and organizes the information from the HH, HV, and VV polarization channels into a 3 × 3 covariance matrix. In addition to preserving the scattering information from each channel, it describes how the polarization channels are related to one another, providing a more robust description of the scattering behavior that is less sensitive to random noise. This matrix serves as the foundation for several polarimetric processing techniques, including speckle filtering, visualization, decomposition, and classification.

The C3 covariance matrix has the following structure:

C3=[C11C12C13C12∗C22C23C13∗C23∗C33]\mathbf{C}_3 = \begin{bmatrix} C_{11} & C_{12} & C_{13} \\ C_{12}^{*} & C_{22} & C_{23} \\ C_{13}^{*} & C_{23}^{*} & C_{33} \end{bmatrix}

The diagonal elements (C11C_{11}, C22C_{22}, and C33C_{33}) describe the strength of the polarization components, while the off-diagonal elements describe the relationships between them. The ∗^{*} indicates the complex conjugate of the corresponding element.

The C3 matrix can also be viewed in terms of the polarization combinations used to form it. Below, each C3 element shows either the strength of an individual polarization component or the relationship between two polarization components. The lower off-diagonal elements are complex conjugates of the corresponding upper elements.

C3=[⟨HH HH∗⟩⟨HH HV∗⟩⟨HH VV∗⟩⟨HV HH∗⟩⟨HV HV∗⟩⟨HV VV∗⟩⟨VV HH∗⟩⟨VV HV∗⟩⟨VV VV∗⟩]Black: Off-diagonal covariance termsGreen: Diagonal termsLight gray: Complex conjugates of the corresponding off-diagonal terms\mathbf{C}_3 = \left[ \begin{array}{ccc} \color{green}\langle HH\,HH^* \rangle & \langle HH\,HV^* \rangle & \langle HH\,VV^* \rangle \\[6pt] {\color{lightgray}\langle HV\,HH^* \rangle} & \color{green}\langle HV\,HV^* \rangle & \langle HV\,VV^* \rangle \\[6pt] {\color{lightgray}\langle VV\,HH^* \rangle} & {\color{lightgray}\langle VV\,HV^* \rangle} & \color{green}\langle VV\,VV^* \rangle \end{array} \right] \\[12pt] \textcolor{black}{\text{Black}}:\ \text{Off-diagonal covariance terms}\\ \textcolor{green}{\text{Green}}:\ \text{Diagonal terms}\\ \textcolor{lightgray}{\text{Light gray}}:\ \text{Complex conjugates of the corresponding off-diagonal terms}

5. Reduce Speckle with a Refined Lee Filter

Before creating RGB composites, apply the Refined Lee filter to reduce speckle while preserving important scattering features such as edges and boundaries. The implementation used by polsSARtools applies the same filter to all covariance terms, which is important for preserving the relationships between them while maintaining the ability to make relative comparisons between terms.

More about the Refined Lee Filter

The Refined Lee filter reduces speckle by analyzing the statistical properties of pixels in a local neighborhood. Rather than applying a fixed level of smoothing, it adjusts amounts of smoothing based on local image characteristics. The Refined Lee filter applies more smoothing in homogeneous areas while preserving edges, boundaries, and other important scattering features.

6. Create a Pauli RGB Composite

The Pauli decomposition combines the polarimetric channels to emphasize different scattering mechanisms:

  • Red: HH − VV (double-bounce scattering)

  • Green: HV (volume scattering)

  • Blue: HH + VV (surface scattering)

This composite is commonly used to distinguish scattering behavior across different land cover types.

Pauli RGB image saved as /home/jovyan/polSAR_GSLC_data/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001/rlee_3x3/C3/PauliRGB.tif
Pauli RGB image saved as /home/jovyan/polSAR_GSLC_data/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001/rlee_3x3/C3/PauliRGB.png
Execution time for pauli_rgb: 5.00 seconds
<Figure size 640x480 with 1 Axes>

7. Create an HH/HV/VV RGB Composite

This composite assigns each polarization channel directly to a color:

  • Red: HH

  • Green: HV

  • Blue: VV

Unlike the Pauli decomposition, this visualization displays the relative backscatter intensity of each polarization channel without combining them into scattering mechanisms. It is useful for examining differences in vegetation structure, surface roughness, and moisture while preserving the original polarization information.

Comparing Composites

This notebook produces both a Pauli RGB Composite and a HH/HV/VV RGB Composite

Both images use polarimetric SAR information to create an RGB visualization, however, they display information differently.

The HH/HV/VV composite assigns individual polarization channels directly to the red, green, and blue channels. The resulting colors show differences in the relative strength of the HH, HV, and VV radar returns. This provides a relatively direct view of the measured polarimetric backscatter.

The Pauli composite does not assign the individual HH, HV, and VV channels directly to colors. Instead, it combines the polarization measurements into components that emphasize different scattering behaviors. This makes differences in scattering behavior easier to distinguish visually.

In summary, the HH/HV/VV composite shows the polarization measurements more directly, while the Pauli composite reorganizes those measurements to emphasize differences in how the radar signal interacts with the surface.

RGB image saved as /home/jovyan/polSAR_GSLC_data/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001/rlee_3x3/C3/RGB.png
RGB GeoTIFF saved as /home/jovyan/polSAR_GSLC_data/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001/rlee_3x3/C3/RGB.tif
Execution time for rgb: 5.00 seconds
<Figure size 640x480 with 1 Axes>

8. Create and Process a High Resolution Subset

The full-scene workflow provides an efficient way to process large GSLC products. When a smaller area of interest is sufficient, creating a spatial subset allows the data to be processed at a higher spatial resolution without extending processing times and storage requirements. The following sections repeat the same polarimetric processing workflow using a subsetted GSLC.


8.1. Create a Subset

polsartools expects a standard NISAR GSLC HDF5 product as input. Here, we create a subset that preserves the original HDF5 structure and metadata.

/home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset.h5
CPU times: user 410 ms, sys: 360 ms, total: 770 ms
Wall time: 770 ms

8.2 Extract the C3 Covariance Matrix

Detected L-band polarization channels: ['HH' 'HV' 'VH' 'VV']
Extracting C3 matrix elements...
Processing chunks: 100%|██████████| 8/8 [00:00<00:00, 48.27it/s]
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C11.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C12_real.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C12_imag.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C13_real.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C13_imag.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C22.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C23_real.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C23_imag.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/C3/C33.tif
Execution time for import_nisar_gslc: 0.00 seconds

8.3 Reduce Speckle with the Refined Lee Filter

Progress: 100%|██████████| 2/2 [00:01<00:00,  1.88block/s]
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C11.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C12_real.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C12_imag.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C13_real.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C13_imag.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C22.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C23_real.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C23_imag.tif
Saved file /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/C33.tif
Execution time for filter_refined_lee: 1.00 seconds

8.4 Create a Pauli RGB Composite

Pauli RGB image saved as /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/PauliRGB.tif
Pauli RGB image saved as /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/PauliRGB.png
Execution time for pauli_rgb: 0.00 seconds
<Figure size 640x480 with 1 Axes>

8.5 Create an HH/HV/VV RGB Composite

RGB image saved as /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/RGB.png
RGB GeoTIFF saved as /home/jovyan/polSAR_GSLC_data/subset/NISAR_L2_PR_GSLC_024_116_D_055_2005_QPDH_A_20260704T055929_20260704T060006_P05023_N_F_J_001_subset/rlee_3x3/C3/RGB.tif
Execution time for rgb: 0.00 seconds
<Figure size 640x480 with 1 Axes>

9. Visualize the Scene-Wide and Subsetted Composites on an Interactive Map

polSARtools allows RGB composites to easily be saved as GeoTIFFs. Here, the both the scene-wide images and the higher-resolution subset are overlaid on a basemap to provide geographic context for the observed scattering patterns.


Loading...

10. Summary

You have now learned how to process full-polarimetric NISAR GSLC data using polsartools. This workflow demonstrated how to extract the C3 covariance matrix, reduce speckle with the Refined Lee filter, generate Pauli RGB and HH/HV/VV RGB composites, and create a high resolution spatial subset for more detailed polarimetric analysis.

Note: This workflow processes NISAR GSLC data for polarimetric analysis, but it does not perform radiometric terrain correction or create a GCOV-equivalent product. Users who require radiometrically terrain-corrected backscatter should consider using a NISAR GCOV product.