asp_plot.planetary_source#
Planetary (LOLA/MOLA) altimetry sources.
Owns the planetary-altimetry side of asp_plot.altimetry.Altimetry:
loading LOLA (Moon) and MOLA (Mars) point clouds from ODE GDS CSV exports,
sampling the ASP DEM at those points, and exporting a pc_align-ready CSV.
The body-agnostic machinery (DEM differencing, pc_align export, the shared CSV
reader) lives on PlanetarySource; the per-body CSV loaders live on its
LolaSource (Moon) and MolaSource (Mars) subclasses. Each
instance holds its own data (planetary_points) and reads the cross-cutting
dem_fn / directory / aligned_dem_fn from the coordinating
Altimetry instance passed at construction.
Attributes#
Classes#
LOLA (Moon) altimetry source. |
|
MOLA (Mars) altimetry source. |
|
Body-agnostic planetary altimetry against an ASP DEM. |
Functions#
|
Submit an async query to the ODE GDS REST API. |
Module Contents#
- class asp_plot.planetary_source.LolaSource(alt)#
Bases:
PlanetarySourceLOLA (Moon) altimetry source.
Parses a LOLA RDR CSV from the ODE GDS into height above the IAU 1737.4 km lunar sphere. The Moon is nearly spherical (1.4 km equatorial-vs-polar variation), so LOLA TOPOGRAPHY ≈ Pt_Radius − 1737.4 km — either column gives the same dh against an ASP lunar DEM to <1 m.
- load_planetary_csv(csv_path)#
Parse a LOLA topo/RDR CSV into
self.planetary_points.Stores height above the IAU lunar sphere on
heightand the planetary radius onradius_m(used by pc_align).- Parameters:
csv_path (str) – Path to a LOLA RDR CSV from the ODE GDS API.
- instrument = 'LOLA'#
- class asp_plot.planetary_source.MolaSource(alt)#
Bases:
PlanetarySourceMOLA (Mars) altimetry source.
Parses a MOLA PEDR CSV from the ODE GDS, using the PLANET_RAD column to compute height above the IAU Mars sphere (3,396,190 m):
height = PLANET_RAD - 3,396,190. This is the same reference as ASP DEMs, so dh = MOLA − DEM is directly meaningful at all latitudes.- load_planetary_csv(csv_path)#
Parse a MOLA PEDR CSV into
self.planetary_points.TOPOGRAPHY (in
*_topo_csv.csv) is referenced to the MOLA oblate areoid and produces a latitude-dependent offset of up to ~10 km against an ASP DEM, so it is rejected here. Pass the*_pts_csv.csvfrom the ODE GDS download instead — it carries PLANET_RAD.- Parameters:
csv_path (str) – Path to a MOLA PEDR CSV from the ODE GDS API. Must include a
PLANET_RADcolumn (use the*_pts_csv.csvfile).
- instrument = 'MOLA'#
- class asp_plot.planetary_source.PlanetarySource(alt)#
Bases:
asp_plot.altimetry_source.AltimetrySourceBody-agnostic planetary altimetry against an ASP DEM.
Holds the machinery shared by every planetary instrument: sampling the DEM at the loaded points, differencing, outlier filtering, and exporting a pc_align-ready CSV. The CSV loader is body-specific and lives in the
LolaSource(Moon) andMolaSource(Mars) subclasses; the coordinator instantiates the right one from the DEM’s body. The baseload_planetary_csv()raises, so an Earth DEM that reaches here is pointed back at ICESat-2.- Parameters:
alt (Altimetry) – The coordinating
asp_plot.altimetry.Altimetryinstance. Cross-cutting paths (dem_fn,directory,aligned_dem_fn) are read from it so a single source of truth describes the DEM under analysis.
- load_planetary_csv(csv_path)#
Load a planetary altimetry CSV (overridden per body).
The base implementation raises: only
LolaSourceandMolaSourceknow how to parse a GDS CSV. The CSV is obtained via therequest_planetary_altimetryCLI tool, which submits an async query to the ODE GDS API and emails the user a download link; the user downloads and unzips the result, then passes the*_topo_csv.csv/*_pts_csv.csvfile to the body source.- Parameters:
csv_path (str) – Path to a CSV file from the ODE GDS.
- planetary_to_dem_dh(n_sigma=3)#
Compute height differences between planetary altimetry and DEM.
Reprojects
self.planetary_pointsto the DEM CRS, interpolates DEM heights at altimetry locations, and computes the differencealtimetry_minus_dem = height - dem_height. Whenaligned_dem_fnis set, also populatesaligned_dem_heightandaltimetry_minus_aligned_demso pre/post-alignment plots can share a single sample. Outliers beyondn_sigma× std from the mean (computed on the unaligned dh) are removed by default.- Parameters:
n_sigma (float or None, optional) – Remove dh outliers beyond this many standard deviations from the mean. Default 3. Pass None to skip outlier filtering.
self.planetary_points. (The results are stored as new columns on)
- to_csv_for_pc_align_planetary(filename_prefix='planetary_for_pc_align')#
Export
self.planetary_pointsto a CSV for pc_align.Writes columns
lon, lat, radius_m(planetary radius from the body center, in meters). Used as theplanetary_csvargument toasp_plot.alignment.Alignment.pc_align_dem_to_planetary_csv().
- instrument = None#
- planetary_points = None#
- asp_plot.planetary_source.gds_query_async(query_type, bounds, results_code, email=None, **extra_params)#
Submit an async query to the ODE GDS REST API.
- Parameters:
query_type (str) – GDS query type, e.g.
"lolardr"or"molapedr".bounds (dict) – Dictionary with
westernlon,easternlon,minlat,maxlatkeys.results_code (str) – GDS results format code (e.g.
"u"for LOLA,"v"for MOLA).email (str or None, optional) – Email for notification when query finishes.
**extra_params – Additional GDS query parameters (e.g.
channel="ttttt").
- Returns:
Job ID for polling.
- Return type:
- asp_plot.planetary_source.GDS_BASE_URL = 'https://oderest.rsl.wustl.edu/livegds'#
- asp_plot.planetary_source.MARS_IAU_SPHERE_RADIUS#
- asp_plot.planetary_source.MOON_IAU_SPHERE_RADIUS#
- asp_plot.planetary_source.logger#