asp_plot.planetary_source#

Planetary (LOLA/MOLA) altimetry source.

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 class 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#

PlanetarySource

Load and analyze LOLA (Moon) / MOLA (Mars) altimetry against an ASP DEM.

Functions#

gds_query_async(query_type, bounds, results_code[, email])

Submit an async query to the ODE GDS REST API.

Module Contents#

class asp_plot.planetary_source.PlanetarySource(alt)#

Load and analyze LOLA (Moon) / MOLA (Mars) altimetry against an ASP DEM.

Parameters:

alt (Altimetry) – The coordinating asp_plot.altimetry.Altimetry instance. 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 LOLA or MOLA altimetry data from a GDS topo CSV file.

The CSV is obtained via the request_planetary_altimetry CLI 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 file here.

Automatically selects the LOLA or MOLA parser based on the DEM’s planetary body.

Parameters:

csv_path (str) – Path to a *_topo_csv.csv file from the ODE GDS.

planetary_to_dem_dh(n_sigma=3)#

Compute height differences between planetary altimetry and DEM.

Reprojects self.planetary_points to the DEM CRS, interpolates DEM heights at altimetry locations, and computes the difference altimetry_minus_dem = height - dem_height. When aligned_dem_fn is set, also populates aligned_dem_height and altimetry_minus_aligned_dem so pre/post-alignment plots can share a single sample. Outliers beyond n_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_points to a CSV for pc_align.

Writes columns lon, lat, radius_m (planetary radius from the body center, in meters). Used as the planetary_csv argument to asp_plot.alignment.Alignment.pc_align_dem_to_planetary_csv().

Parameters:

filename_prefix (str, optional) – Prefix for the output CSV filename. Saved in self.alt.directory.

Returns:

Absolute path to the created CSV file.

Return type:

str

alt#
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, maxlat keys.

  • 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:

str

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#