Source code for nav.nav_model.nav_model_rings_base

"""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``.
"""

import numpy as np
import oops
from scipy import ndimage

from nav.annotation import (
    TEXTINFO_BOTTOM_ARROW,
    TEXTINFO_LEFT_ARROW,
    TEXTINFO_RIGHT_ARROW,
    TEXTINFO_TOP_ARROW,
    Annotation,
    Annotations,
    AnnotationTextInfo,
    TextLocInfo,
)
from nav.support.types import NDArrayBoolType

from .nav_model import NavModel