Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Module catalog

What this tutorial covers, by source module

UNEP
IMEO
MARS

Source: spaceml-org/georeader @ branch feature/geotensor_npapi, commit f0d92f0 Goal: a module-by-module tutorial that captures the package’s capabilities and preserves all ASCII diagrams before they’re cleaned up downstream.

The package is ~20k LOC across 17 top-level files + 14 reader modules. ~1100 lines of box-drawing ASCII art are scattered across docstrings — this is the doc treasure we’re rescuing.


Each chapter = one file under georeader_tutorial/. We work through them one at a time. Diagrams are copied verbatim into the tutorial; surrounding prose explains the concept and adds runnable examples.

Part I — Core data model

#FileSource moduleLOCDiagramsWhat you learn
101_geotensor.mdgeotensor.py253286The numpy-subclass GeoTensor — dim conventions, __array_ufunc__, __array_finalize__, transform/CRS round-trip, time as a first-class dim. The centerpiece of this branch.
202_abstract_reader.mdabstract_reader.py25746The GeoData / GeoTensor / Reader Protocol type hierarchy — what duck-types as a georeader source.
303_rasterio_reader.mdrasterio_reader.py163066Lazy file-backed reader: RasterioReader, multi-file stacks, windowed reads, overviews, cloud-native VSI paths.

Part II — Reading & windowing

#FileSource moduleLOCDiagramsWhat you learn
404_window_utils.mdwindow_utils.py1471102Window anatomy, pixel↔geo transforms, padding, alignment, intersection. The math of “what region am I reading.”
505_read.mdread.py1967123The high-level read_from_* family: bounds, polygon, center coords, bbox, with reprojection + resampling. Most diagrams in the package.
606_slices.mdslices.py40460Tiling strategies: overlap vs stride vs chunked, generating windows for tiled inference.

Part III — Geometry & gridding

#FileSource moduleLOCDiagramsWhat you learn
707_griddata.mdgriddata.py61796Irregular→regular gridding, GLT (geolocation lookup tables), read_to_crs for swath sensors.
808_mosaic.mdmosaic.py45066Multi-raster mosaicking with reprojection + nodata fill — cloud-free composites.
909_rasterize.mdrasterize.py43858Burning vector geometries (polygons, lines) into raster grids aligned to a GeoTensor.
1010_vectorize.mdvectorize.py37063Inverse: extracting polygons from binary masks (segmentation → GIS-ready vectors).

Part IV — Radiometry & I/O

#FileSource moduleLOCDiagramsWhat you learn
1111_reflectance.mdreflectance.py97197Radiance↔ToA reflectance, spectral response functions (SRF), solar irradiance integrals (Thuillier).
1212_save.mdsave.py + save_cog.py58658Writing GeoTensors to disk; full COG anatomy with the IFD/overview/tile diagram.
1313_misc_io.mdio.py, dataarray.py, plot.py113+145+3360Smaller utilities: fsspec wrappers, xarray bridge (to_dataarray/from_dataarray), plot.show.

Part V — Sensor readers

#FileSource moduleLOCDiagramsWhat you learn
1414_sentinel2.mdreaders/S2_SAFE_reader.py184547S2 SAFE reader (L1C + L2A), band groups, GCS support, jp2 reads.
1515_hyperspectral.mdreaders/{emit,prisma,enmap}.py1102+571+86527+38+33Hyperspectral trio — EMIT (ISS, 285 bands), PRISMA (ASI, 239 bands), EnMAP (DLR, 224 bands). All curvilinear; common pattern.
1616_earth_engine.mdreaders/{ee_image,ee_query,ee_utils}.py539+589+5842GEE export with recursive tile splitting and parallel download.
1717_legacy_sensors.mdreaders/{spotvgt,probav}_image_operational.py389+7010SPOT VGT and Proba-V — operational legacy readers.
1818_query_and_download.mdreaders/{scihubcopernicus_query,download_pv_product,query_utils,tileserver,download_utils}.pysmall0Catalog/query helpers, downloaders, tile-server adapter.

Diagram inventory (count of box-drawing chars per file)

read.py                 123    ← reading workflow, AOI specification, reprojection
window_utils.py         102    ← window anatomy, pixel↔geo, alignment
reflectance.py           97    ← unit conventions, SRF, irradiance pipeline
griddata.py              96    ← irregular vs regular grids, GLT
geotensor.py             86    ← dim conventions, ufunc protocol, metadata flow
rasterio_reader.py       66    ← lazy I/O architecture
mosaic.py                66    ← spatial mosaic concept
vectorize.py             63    ← raster→vector pipeline
slices.py                60    ← tiling strategies
save.py                  58    ← COG structure
rasterize.py             58    ← vector→raster pipeline
S2_SAFE_reader.py        47    ← S2 product levels, band groups
abstract_reader.py       46    ← georeader type hierarchy
ee_image.py              42    ← GEE export architecture
prisma.py                38    ← PRISMA HDF5 layout
enmap.py                 33    ← EnMAP product structure
emit.py                  27    ← EMIT NetCDF layout
─────────────────────────────
TOTAL                  ~1148 box-drawing chars across 17 files

(Plus pipe-tables and +--+-style diagrams not counted above. Per-chapter we’ll grep these out exhaustively.)


Working method

  1. We pick a chapter from the table above.

  2. I extract every ASCII diagram from that module’s docstrings verbatim into the chapter file.

  3. I add concise prose around each diagram explaining the concept.

  4. I add 1–3 runnable code snippets per chapter using realistic geo data (no mock arrays).

  5. We review and iterate before moving to the next chapter.

Suggested starting order: 1 (geotensor) → 2 (abstract_reader) → 3 (rasterio_reader) → 5 (read) → 4 (window_utils) → ... — front-loads the conceptual core, then radiates outward.


Open questions before we start writing