# /// script
# requires-python = ">=3.12"
# dependencies = [
# "earthaccess-auth[icechunk]>=0.4.0",
# "icechunk>=2.2.2",
# "matplotlib>=3.11.2",
# "xarray>=2026.7.0",
# ]
# ///
Quickstart: the ASDC bucket snapshot¶
NASA ASDC hosts an experimental copy of each store in its public bucket,
s3://asdc-prod-public/virtual-icechunk/, as TEMPO_HCHO_L3_V04 and
TEMPO_NO2_L3_V04. Each is a snapshot of the
Source Cooperative
copy at the time it was made, not a live store. Expect it to lag the
private store that the pipeline updates, and expect it to move or change
without notice.
The bucket is public, so opening the repository needs no credentials. This
notebook opens it through ASDC's HTTPS endpoint, which serves the bucket's
keys to anyone and so works from anywhere. The data is still virtual:
each chunk is a byte range in a granule in s3://asdc-prod-protected/,
which needs an Earthdata Login and a
machine in AWS us-west-2, exactly as in the
first quickstart. This snapshot stores its references as
absolute s3:// URLs rather than relative ones, so the HTTPS trick of the
second quickstart does not apply to it.
This notebook reads one point of the HCHO store. For NO2, swap HCHO for
NO2 in the URL below and pick a variable from
the stores. Run it with
juv: juv run docs/examples/quickstart-asdc.ipynb.
Authenticate¶
login() looks for credentials in EARTHDATA_USERNAME and
EARTHDATA_PASSWORD (or EARTHDATA_TOKEN), then ~/.netrc, then prompts.
Only the chunk reads below fetch S3 credentials through this login, when
they need them, and refresh them before they expire.
import earthaccess_auth
earthaccess_auth.set_default_auth(earthaccess_auth.login())
Open the store¶
http_storage reads the repository over HTTPS with no credentials. The
endpoint answers each request with a redirect to a signed CloudFront URL,
which Icechunk follows. Give it the repository root without a trailing
slash. The repository's config declares which bucket its virtual chunks
live in. earthdata_containers_credentials reads that config from the open
repository and authorizes Icechunk to fetch chunks from the bucket with
Earthdata credentials. reopen applies them without reading the config
from storage again. xarray opens the main branch as one dataset.
import icechunk
import xarray as xr
from earthaccess_auth.adapters.icechunk import earthdata_containers_credentials
storage = icechunk.http_storage(
"https://data.asdc.earthdata.nasa.gov/asdc-prod-public/virtual-icechunk/TEMPO_NO2_L3_V04"
)
repo = icechunk.Repository.open(storage)
repo = repo.reopen(
authorize_virtual_chunk_access=earthdata_containers_credentials(repo)
)
ds = xr.open_zarr(repo.readonly_session("main").store, consolidated=False, chunks=None)
ds
<xarray.Dataset> Size: 87TB
Dimensions: (time: 17228,
latitude: 2950,
longitude: 7750)
Coordinates:
* time (time) datetime64[ns] 138kB ...
* latitude (latitude) float32 12kB ...
* longitude (longitude) float32 31kB ...
Data variables: (12/39)
albedo (time, latitude, longitude) float32 2TB ...
amf_cloud_pressure (time, latitude, longitude) float32 2TB ...
amf_stratosphere (time, latitude, longitude) float32 2TB ...
amf_troposphere (time, latitude, longitude) float32 2TB ...
fitted_slant_column_uncertainty (time, latitude, longitude) float64 3TB ...
granule_stamp (time) StringDType() 276kB ...
... ...
vertical_column_troposphere (time, latitude, longitude) float64 3TB ...
viewing_zenith_angle (time, latitude, longitude) float32 2TB ...
tropopause_pressure (time, latitude, longitude) float32 2TB ...
vertical_column_total (time, latitude, longitude) float64 3TB ...
vertical_column_troposphere_uncertainty (time, latitude, longitude) float64 3TB ...
terrain_height (time, latitude, longitude) float32 2TB ...
Attributes: (12/22)
product_type: NO2
processing_level: 3
processing_version: 4
sdpc_version: TEMPO_SDPC_v4.8.4
version_id: 4
pge_version: 1.0.0
... ...
collection_shortname: TEMPO_NO2_L3
collection_version: 1
keywords: EARTH SCIENCE>ATMOSPHERE>AIR QUALITY>NITROGEN OXI...
summary: Nitrogen dioxide Level 3 files provide trace gas ...
tempo_store: {'schema': 'tempo-backfill-inventory/1', 'collect...
pending_ledger: []Load a single point¶
Selecting a point and a time, then asking for the value, reads the one
chunk that holds it, over HTTPS. main_data_quality_flag is 0 for normal
retrievals.
nyc = dict(latitude=40.7, longitude=-74.0, method="nearest")
scan = ds.sel(time="2026-09-03T18:00", method="nearest")
no2 = scan.vertical_column_troposphere.sel(**nyc)
flag = scan.main_data_quality_flag.sel(**nyc)
when = scan.time.values.astype("datetime64[m]")
print(f"{when}: {float(no2):.3g} {no2.units}, quality flag {int(flag)}")
2026-09-03T17:37: 7.57e+15 molecules/cm^2, quality flag 0
Plot a map¶
The same scan over the Northeast, keeping only normal-quality retrievals. One scan spans a few chunks per variable, so this reads a few tens of MB.
northeast = scan.sel(latitude=slice(36, 46), longitude=slice(-82, -66))
good = northeast.vertical_column_troposphere.where(
(northeast.main_data_quality_flag == 0)
& (northeast.eff_cloud_fraction < 0.5)
& (northeast.solar_zenith_angle < 80)
)
good.plot(robust=True, figsize=(9, 5));