Skip to content

Commit 7af1255

Browse files
committed
Add some NISAR exploration scripts
1 parent 43174a1 commit 7af1255

File tree

7 files changed

+1610
-0
lines changed

7 files changed

+1610
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@ site/*
8282

8383
# uv lock files
8484
uv.lock
85+
86+
# script output
87+
*.html

docs/examples/nisar/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# NISAR Data Access Examples
2+
3+
These scripts demonstrate obspec-utils for accessing NASA NISAR data via HTTPS with Earthdata authentication.
4+
5+
## Prerequisites
6+
7+
- NASA Earthdata account ([register here](https://urs.earthdata.nasa.gov/users/new))
8+
- `earthaccess` configured with your credentials
9+
10+
## Scripts
11+
12+
### `virtualize.py` (not functional)
13+
14+
Minimal example showing how to create a virtual datatree from a remote NISAR file.
15+
16+
> **Note:** This example currently fails due to upstream limitations:
17+
> 1. The "crosstalk" variable has a complex dtype not supported by Zarr
18+
> 2. `drop_variables` doesn't yet work for variables in nested HDF5 groups
19+
>
20+
> Fixes are needed in [VirtualiZarr](https://github.com/zarr-developers/VirtualiZarr).
21+
22+
```bash
23+
uv run --script docs/examples/nisar/virtualize.py
24+
```
25+
26+
### `benchmark.py`
27+
28+
Compare obspec-utils readers against fsspec for performance.
29+
30+
```bash
31+
uv run --script docs/examples/nisar/benchmark.py
32+
uv run --script docs/examples/nisar/benchmark.py --block-size 32
33+
```
34+
35+
### `waterfall.py`
36+
37+
Visualize HTTP range requests as a waterfall chart (byte position vs time).
38+
39+
```bash
40+
uv run --script docs/examples/nisar/waterfall.py
41+
uv run --script docs/examples/nisar/waterfall.py --block-size 8
42+
uv run --script docs/examples/nisar/waterfall.py --output my_waterfall.html
43+
```
44+
45+
### `analyze.py`
46+
47+
Analyze request patterns with timeline, size histogram, and byte coverage stats.
48+
49+
```bash
50+
uv run --script docs/examples/nisar/analyze.py
51+
uv run --script docs/examples/nisar/analyze.py --block-size 16
52+
uv run --script docs/examples/nisar/analyze.py --output my_analysis.html
53+
```
54+
55+
### `layout.py` (not functional)
56+
57+
Visualize file layout showing where data chunks vs metadata are located. Uses VirtualiZarr to extract chunk locations from the manifest.
58+
59+
```bash
60+
uv run --script docs/examples/nisar/layout.py
61+
uv run --script docs/examples/nisar/layout.py --output my_layout.html
62+
```
63+
64+
## Output
65+
66+
- `benchmark.py` prints results to stdout
67+
- `waterfall.py` generates `waterfall.html`
68+
- `analyze.py` generates `analyze.html`
69+
- `layout.py` generates `layout.html`

0 commit comments

Comments
 (0)