Open source Python tools for working with NISAR datasets
Project description
nisar_pytools
Open source Python tools for working with NISAR datasets.
About
nisar_pytools provides utilities for searching, downloading, reading, and processing data products from NASA's NISAR (NASA-ISRO Synthetic Aperture Radar) mission.
Supported Products
- GSLC - Geocoded Single Look Complex
- GUNW - Geocoded Unwrapped Interferogram
Additional NISAR product types will be added over time.
Getting Started
Prerequisites
- Python 3.10+
- Miniforge (recommended)
- NASA Earthdata login (for downloading from ASF)
Installation
From PyPI:
pip install nisar-pytools
With optional extras:
pip install nisar-pytools[dem] # DEM fetching (dem_stitcher)
pip install nisar-pytools[viz] # Visualization (matplotlib)
pip install nisar-pytools[all] # Everything
From source (for development):
git clone https://github.com/zmhoppinen/nisar_pytools.git
cd nisar_pytools
mamba env create -f environment.yml
conda activate nisar_pytools
Usage
Search and Download
from nisar_pytools import find_nisar, download_urls
# Search ASF for GSLC products over an area of interest
urls = find_nisar(
aoi=[-115, 43, -114, 44],
start_date="2025-06-01",
end_date="2025-12-01",
product_type="GSLC",
path_number=77,
direction="ASCENDING",
)
# Download in parallel with automatic validation
fps = download_urls(urls, "local/gslcs/")
Read a Single File
from nisar_pytools import open_nisar
dt = open_nisar("NISAR_L2_PR_GSLC_...h5")
# Access a frequency/polarization group
freq_a = dt["science/LSAR/GSLC/grids/frequencyA"].dataset
hh = freq_a["HH"] # lazy dask-backed DataArray with CRS set
# Coordinates and CRS are assigned automatically
print(hh.rio.crs) # e.g. EPSG:32611
Stack GSLCs into a Time Series
from nisar_pytools import stack_gslcs
# Stack multiple same-track GSLCs into a (time, y, x) DataArray
stack = stack_gslcs(
["gslc_date1.h5", "gslc_date2.h5", "gslc_date3.h5"],
frequency="frequencyA",
polarization="HH",
)
# Sorted by time, grid-validated, dask-backed, CRS assigned
SAR Processing
from nisar_pytools.processing import (
interferogram, coherence, multilook, unwrap, calculate_phase
)
# Interferogram (validates matching grids)
ifg = interferogram(slc1, slc2)
# Multilooked interferogram
ml_ifg = multilook(ifg, looks_y=4, looks_x=4)
# Coherence estimation
coh = coherence(slc1, slc2, window_size=11)
# Phase unwrapping with SNAPHU
unw, conncomp = unwrap(ifg, coh, nlooks=20.0)
Phase Linking
from nisar_pytools.processing import phase_link
# EMI phase linking on a GSLC stack
linked, temporal_coh = phase_link(stack, window_size=11, confidence=0.95)
Polarimetric Decomposition
from nisar_pytools.processing import h_a_alpha
# H-A-alpha decomposition from quad-pol SLC channels
ds = h_a_alpha(hh, hv, vv)
# Returns Dataset with: entropy, anisotropy, alpha, mean_alpha
Local Incidence Angle
from nisar_pytools.utils.local_incidence_angle import local_incidence_angle
lia = local_incidence_angle(dem, los_x, los_y, los_z, heights, x_rg, y_rg, epsg=32611)
Roadmap
- Lazy HDF5 reader returning xarray DataTree with CRS
- GSLC and GUNW support
- ASF search and parallel download with validation
- GSLC time-series stacking
- Interferogram, coherence, multilooking, phase extraction
- Phase unwrapping (SNAPHU)
- Phase linking (EMI with SHP selection)
- Polarimetric decomposition (H-A-alpha)
- Local incidence angle computation
- Visualization helpers (amplitude, phase, interferogram, coherence)
- Support for additional NISAR product types
Contributing
Contributions are welcome! Please fork the repo and open a pull request, or open an issue to suggest improvements.
License
Distributed under the MIT License. See LICENSE.txt for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nisar_pytools-0.1.1.tar.gz.
File metadata
- Download URL: nisar_pytools-0.1.1.tar.gz
- Upload date:
- Size: 55.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b0299c9d3ecc151435564fb779759dc452689cf438aac71fdb1239f80863677
|
|
| MD5 |
18d5ae653b910b4582ab660d07e8f005
|
|
| BLAKE2b-256 |
d5fa118aee49fc0e03848fd6e407644b7a08a1f5282994c89c3bbdcd479356b0
|
Provenance
The following attestation bundles were made for nisar_pytools-0.1.1.tar.gz:
Publisher:
publish.yml on ZachHoppinen/nisar_pytools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nisar_pytools-0.1.1.tar.gz -
Subject digest:
7b0299c9d3ecc151435564fb779759dc452689cf438aac71fdb1239f80863677 - Sigstore transparency entry: 1219314749
- Sigstore integration time:
-
Permalink:
ZachHoppinen/nisar_pytools@61b6b19c7722e0e7f77fac0ebe0abf35fe158bbb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ZachHoppinen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61b6b19c7722e0e7f77fac0ebe0abf35fe158bbb -
Trigger Event:
release
-
Statement type:
File details
Details for the file nisar_pytools-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nisar_pytools-0.1.1-py3-none-any.whl
- Upload date:
- Size: 37.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1c0053e30be8f453ff4220c210c218aef63ee32563fbf55ea5ac22d0e5bca40
|
|
| MD5 |
d6e21ac34a77ff9059d79677f3ea1878
|
|
| BLAKE2b-256 |
f25ce082e04cda83d3399828eee652b2f00fffb0f576d88d3c8db16b376f1949
|
Provenance
The following attestation bundles were made for nisar_pytools-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on ZachHoppinen/nisar_pytools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nisar_pytools-0.1.1-py3-none-any.whl -
Subject digest:
d1c0053e30be8f453ff4220c210c218aef63ee32563fbf55ea5ac22d0e5bca40 - Sigstore transparency entry: 1219314820
- Sigstore integration time:
-
Permalink:
ZachHoppinen/nisar_pytools@61b6b19c7722e0e7f77fac0ebe0abf35fe158bbb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ZachHoppinen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@61b6b19c7722e0e7f77fac0ebe0abf35fe158bbb -
Trigger Event:
release
-
Statement type: