nav.nav_model

Bases: ABC, NavBase

Base class for navigation models used to generate synthetic images.

Creates the internal model representation for a navigation model.

Parameters:
  • always_create_model – If True, creates a model even if won’t have useful contents.

  • never_create_model – If True, only creates metadata without generating a model or annotations.

  • create_annotations – If True, creates text annotations for the model.

Returns the metadata dictionary associated with this model.

Returns the list of results produced by this model.

Returns the name of the model.

Returns the observation snapshot associated with this model.

Dataclass encapsulating the result of a navigation model computation.

Bases: object

Encapsulates a single result from a navigation model.

A model may produce one or more results (e.g., one per body or one combined). Each result holds the model image, mask, range, and related per-result data.

Bases: NavModel

Create a model containing nothing but stars.

Individual stars are modeled using the PSF specified by the associated Inst class.

Parameters:

ignore_conflicts – True to include stars that have a conflict with a body or rings.

Returns:

A tuple containing the model, metadata, and annotations.

Return the list of stars in the model.

Return a list of stars in the FOV of the obs.

Parameters:
  • radec_movement – A tuple (dra,ddec) that gives the movement of the camera in each half of the exposure. None if no movement is available.

  • **kwargs – Passed to find_stars to restrict the types of stars returned.

Returns:

A list of Star objects in the FOV. The following attributes are added to the Star object:

  • catalog_name: The name of the catalog the star was found in.

  • pretty_name: A pretty name for the star.

  • u and v: The U,V coordinate (including stellar aberration if applicable).

  • move_u and move_v: The movement of the star in U,V coordinates the entire

    exposure.

  • ra_pm and dec_pm: The proper motion of the star.

  • temperature_faked: A bool indicating if the temperature and spectral class

    had to be faked.

  • johnson_mag_faked: A bool indicating if the Johnson magnitudes had to be faked.

  • dn: The estimated integrated DN count given the star’s class, magnitude, and

    the filters being used. This is just a relative value based on the star’s magnitude.

  • conflicts: A string indicating if the star has a conflict with another star

    or body.

Bases: NavModel

Base class for body navigation models.

Provides shared helpers to compute a limb mask and to create annotations consistent with the standard body model implementation.

Bases: NavModelBodyBase

Creates a navigation model for a planetary body with optional text overlay.

Parameters:
  • always_create_model – If True, creates a model even if the body is too small or has poor limb definition.

  • never_create_model – If True, creates metadata but doesn’t generate an actual model or annotations.

  • create_annotations – If True, creates text annotations for the model.

Bases: NavModelBodyBase

Create the simulated model, mask, limb, and annotations.

Base class for ring navigation models.

This module provides the annotation creation helper shared by the real ring model (NavModelRings) and the simulated ring model (NavModelRingsSimulated).

Anti-aliasing is implemented in nav.nav_model.rings.ring_math.compute_antialiasing and is invoked from RingFeature._render_full_ringlet(). Annotation helpers live here because they need observation metadata (image shape, config font settings) that belongs with NavModel, unlike the pure math in ring_math.

Bases: NavModel

Base class for ring navigation models.

Provides the _create_edge_annotations helper for creating annotations consistent between the real and simulated ring model implementations. Anti-aliasing math is in nav.nav_model.rings.ring_math.

Navigation model for planetary rings.

This module implements the orchestrator for the planetary ring navigation model. It is a thin coordinator that:

  1. Reads the planet block from merged config (rings.ring_features.<PLANET>), including required planet-level parameters (epoch, fade settings, etc.).

  2. Requires a non-empty features dict under that block (each entry is validated when passed to RingFeature.from_config()).

  3. Checks ring visibility via the ring_radius backplane before calling RingFeature.from_config(), so feature parsing is skipped when no ring radii appear in the FOV.

  4. Constructs typed RingFeature objects via RingFeature.from_config(), raising ValueError on malformed feature entries.

  5. Validates no two features have overlapping date ranges over the same radial region (validate_no_date_overlaps).

  6. Performs a fast extent check: if the minimum radius in the FOV exceeds the maximum a + ae across all features, no ring can be visible and the model returns before the expensive resolutions backplane and filter pipeline.

  7. Filters through the four-pass RingFeatureFilter pipeline.

  8. Renders each surviving feature via feature.render(context).

  9. Optionally removes planet-shadow pixels from each rendered result when rings.remove_planet_shadow is True (shadow computed once via obs.ext_bp.where_inside_shadow).

  10. Wraps each result in a NavModelResult with annotations.

Design principle: This module contains no physics, no math, and no rendering logic. All of that lives in the rings subpackage (ring_feature, ring_math, ring_filter). The orchestrator’s only job is to wire together configuration retrieval, backplane access, and NavModelResult construction.

Top-level rings keys (under rings):

  • remove_planet_shadow: Boolean (default False). When True, pixels that lie inside the nearest planet’s own shadow are zeroed out of each rendered feature’s model image and excluded from its model mask before the NavModelResult is constructed. A warning is logged and shadow removal is skipped if the backplane call fails.

Planet ring block keys (under rings.ring_features.<PLANET>):

  • general.log_level_model_rings: Log level for the CREATE RINGS MODEL PdsLogger.open() block. Ring filtering, feature rendering, and fade math log through the same PdsLogger as this model (debug for internals, info for summaries on the orchestrator).

  • epoch: UTC epoch string for radial mode calculations (required).

  • fade_width_pix: Desired fade extent in pixels for single-edge features (required; no default).

  • min_allowed_fade_width_pix: Minimum allowed fade after conflict reduction (required; no default).

  • min_feature_pixels: Minimum resolvable feature width in pixels (required; no default).

  • features: Dict of feature key -> feature dict (parsed via RingFeature.from_config).

Bases: NavModelRingsBase

Navigation model for planetary rings based on ephemeris data.

Retrieves ring feature definitions from the merged configuration, filters them for the current observation (date, visibility, resolvability, fade conflicts), renders each surviving feature via RingFeature.render(), and appends the results to self._models as NavModelResult instances.

Each rendered edge becomes a separate NavModelResult so the navigator can independently offset-correct individual ring features.

Create the internal model representation for planetary rings.

Parameters:
  • always_create_model – If True, creates a model even if it won’t have useful contents.

  • never_create_model – If True, only creates metadata without generating a model or annotations.

  • create_annotations – If True, creates text annotations for the model.

Simulated ring navigation model.

This module provides a navigation model for simulated rings created in the GUI.

The simulated ring model uses a different rendering path from the real ring model (NavModelRings): instead of computing backplane-based ring radii and applying RingFeature.render(), it delegates image generation to nav.sim.sim_ring.render_ring(), which operates entirely in pixel space.

The data model types (RingFeature, RingEdgeData) are shared with the real model for two purposes:

  1. Validation: RingFeature.from_config() validates sim_params structure at construction time, catching authoring errors in the same way as the YAML config path.

  2. Annotations: _create_edge_annotations requires an edge_info_list; the feature’s uncertainty field is wired to NavModelResult.uncertainty.

The rendering path itself is NOT shared because simulated rings use pixel-space geometry rather than backplane geometry.

Bases: NavModelRingsBase

Navigation model for simulated rings created in the GUI.

Uses render_ring() for image generation (pixel-space) and RingFeature/RingEdgeData for annotation data and uncertainty.

Create the internal model representation for simulated rings.

Parameters:
  • always_create_model – If True, creates a model even if it won’t have useful contents.

  • never_create_model – If True, only creates metadata without generating a model or annotations.

  • create_annotations – If True, creates text annotations for the model.