Raw granules (experimental)¶
Experimental — a different contract than every other dataset
Unlike the instrument datasets, raw granule datasets are not reprojected onto a common grid: each item is one raw PDS product (an NAC/WAC calibrated strip, an M3 radiance cube, ...), read in its own native camera/instrument geometry. No reprojection, resampling, ISIS, or SPICE processing is applied.
Consequences:
- No bbox windowing.
__getitem__returns a whole granule (or a row range, viarows=), not a patch cropped to a requested extent. - Ragged shapes across items. The default
DataLoadercollation will not work; usebatch_size=Noneor a customcollate_fn. - No
&composition. There is no shared grid to stack channels onto.
len() is the number of PDS ODE products matching a bbox, fetched once
and eagerly in __init__, so len() never needs a network call.
Reading large strips¶
NAC/WAC strips can be gigapixel. Reading a whole granule with no rows=
raises once its pixel count exceeds max_pixels (about 512 MiB as float32
by default), naming the granule's size and suggesting a row range:
import astrofetch as af
# Read only the first 512 rows of every matching strip instead of the whole
# multi-gigapixel granule.
dataset = af.LROCNACRaw(bbox=(-26.3, -50.6, -25.5, -49.7), rows=slice(0, 512))
sample = dataset[0]
sample["image"] # (bands, 512, W) float32, physical values
sample["mask"] # same-shaped bool validity
Datasets¶
astrofetch.moon.granules.LROCNACRaw ¶
Bases: GranuleDataset
EXPERIMENTAL: LRO LROC NAC calibrated strips, raw camera geometry.
Radiometrically calibrated (I/F) but not map-projected: no bbox
windowing, reprojection, ISIS, or SPICE. See :class:GranuleDataset.
astrofetch.moon.granules.LROCWACRaw ¶
Bases: GranuleDataset
EXPERIMENTAL: LRO LROC WAC monochrome calibrated strips, raw camera
geometry. See :class:GranuleDataset.
astrofetch.moon.granules.M3 ¶
Bases: GranuleDataset
EXPERIMENTAL: Chandrayaan-1 Moon Mineralogy Mapper (M3) L1B radiance cubes (85 bands), raw camera geometry, with per-pixel geolocation.
Not map-projected: no bbox windowing, no reprojection. The loc key
holds the 3-band (longitude, latitude, elevation) geolocation backplane
at the same pixel grid as image, for georeferencing samples
yourself. See :class:GranuleDataset.
Base class¶
astrofetch.moon.granules.GranuleDataset ¶
Bases: Dataset[dict]
EXPERIMENTAL map-style dataset over one instrument's raw PDS granules.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bbox
|
BBox
|
region to search as (west, south, east, north) degrees. |
(-180.0, -90.0, 180.0, 90.0)
|
max_products
|
int
|
cap on granules in the dataset (one ODE search, eager). |
100
|
rows
|
slice | None
|
pixel row range read from every granule, e.g. |
None
|
max_pixels
|
int
|
raise instead of reading a granule (bands * width * height) larger than this; NAC/WAC strips can be gigapixel. |
_DEFAULT_MAX_PIXELS
|
Raises:
| Type | Description |
|---|---|
EndpointError
|
the ODE search failed. |