Skip to content

Instantly share code, notes, and snippets.

We can't make this file beautiful and searchable because it's too large.
track,frame,direction,fraction_land,epsg,crosses_dateline,min_lon,min_lat,max_lon,max_lat,produce_gunw,produce_gslc,produce_gcov
1,4,A,0.55598857958601,32629,0,-7.866927146911621,3.5777413845062256,-5.197324275970459,6.187122344970703,1,1,1
1,5,A,1.0,32629,0,-8.329588890075684,5.565021514892578,-5.644875526428223,8.181086540222168,1,1,1
1,6,A,1.0,32629,0,-8.803498268127441,7.551565647125244,-6.0999755859375,10.174551963806152,1,1,1
1,7,A,1.0,32629,0,-9.289656639099121,9.537314414978027,-6.56350564956665,12.16748332977295,1,1,1
1,8,A,1.0,32629,0,-9.789161682128906,11.522199630737305,-7.036413669586182,14.15983772277832,1,1,1
1,9,A,1.0,32629,0,-10.30320930480957,13.506141662597656,-7.519725322723389,16.15156364440918,1,1,1
1,10,A,1.0,32629,0,-10.833122253417969,15.489057540893555,-8.014552116394043,18.142602920532227,1,1,1
1,11,A,1.0,32629,0,-11.380358695983887,17.470840454101562,-8.522106170654297,20.132892608642578,1,1,1
1,12,A,1.0,32629,0,-11.94653606414795,19.45138168334961,-9.043722152709961,22.12235641479
@scottstanie
scottstanie / nisar_orbit_download.py
Created July 21, 2026 21:07
ownload the NISAR orbit ephemeris file(s) matching a list of NISAR granules
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["requests>=2.28"]
# ///
"""Download the NISAR orbit ephemeris file(s) matching a list of NISAR granules.
NISAR distributes four flavors of orbit ephemeris as ancillary XML files, which
differ in latency and accuracy:
@scottstanie
scottstanie / demo-plot-nisar.py
Last active January 23, 2026 23:22
Fetch a remote subset from a NISAR GSLC, plot
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "h5py",
# "matplotlib",
# "rich",
# "opera-utils[all]",
# ]
# ///
import time
@scottstanie
scottstanie / get_capella_orbit_stats.py
Last active January 14, 2026 19:09
Print the orbit source and stats for a set of Capella SLCs
#!/usr/bin/env python
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "capella-reader",
# ]
# ///
import sys
from typing import Literal
[project]
name = "mapping-313"
description = "Catch-all mapping env migrated from conda/mamba"
requires-python = "== 3.13"
version = "0.1.0"
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
@scottstanie
scottstanie / create-water-mask-natural-earth.py
Last active January 30, 2026 15:53
Create a water mask in EPSG:4326 using `esa_world_cover_2021` imagery or Natural Earth land polygons.
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "geopandas",
# "rasterio",
# "tyro",
# "requests",
# ]
# ///
"""Create a water mask in EPSG:4326 using Natural Earth land polygons.
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "numpy",
# "pyproj",
# "rioxarray",
# "tyro",
# ]
# ///
"""Stand-alone plate-motion utilities and CLI.
@scottstanie
scottstanie / build_virtual_reference.py
Last active September 8, 2025 16:35
Create a reference parquet file for one OPERA DISP-S1 frame
#!/usr/bin/env python
import argparse
import multiprocessing
import warnings
import xarray as xr
from dask import compute, delayed
from dask.distributed import Client
from obstore.store import S3Store
@scottstanie
scottstanie / create-disp-s1-subset.sh
Last active June 26, 2025 22:37
Download and reformat OPERA DISP-S1 data
#!/bin/bash
set -eo pipefail
# Go to https://conda-forge.org/download/ and download mamba the installer
mamba create -n opera-utils-env pip scipy opera-utils
# (will be unnecessary once version rolls into conda-forge from pypi)
mamba run -n opera-utils-env pip install "opera-utils[disp]>=0.23.3"
# Small machine: use only 4 workers
# Large: can use more
#!/usr/bin/bash
set -e
# uv can be set up with:
# curl -LsSf https://astral.sh/uv/install.sh | sh
# Credientials must be set as AWS_* env vars, or with ~/.netrc, or with EARTHDATA_USERNAME and EARTHDATA_PASSWORD
uvx --with "rasterio,opera-utils[disp]>=0.23.1" \