CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-spiceypy

A Python wrapper for the NAIF CSPICE Toolkit providing essential tools for spacecraft navigation and planetary science calculations

Overview
Eval results
Files

geometry-surface.mddocs/

Geometry and Surface Analysis

Advanced geometric computations including surface intersections, illumination analysis, limb finding, and visibility calculations. These functions enable detailed analysis of planetary surfaces and geometric relationships.

Capabilities

Surface Intercept Points

Find intersections between rays and planetary surfaces.

def sincpt(method: str, target: str, et: float, fixref: str, abcorr: str, obsrvr: str, dref: str, dvec: ndarray) -> Tuple[ndarray, float, ndarray, bool]:
    """
    Find surface intercept point of ray with target body.
    
    Parameters:
    - method: str, computation method ("ELLIPSOID", "DSK/UNPRIORITIZED")
    - target: str, target body name
    - et: float, ephemeris time
    - fixref: str, body-fixed reference frame
    - abcorr: str, aberration correction
    - obsrvr: str, observer body name
    - dref: str, reference frame for direction vector
    - dvec: ndarray, ray direction vector
    
    Returns:
    Tuple[ndarray, float, ndarray, bool]: (spoint, trgepc, srfvec, found)
    """

def subpnt(method: str, target: str, et: float, fixref: str, abcorr: str, obsrvr: str) -> Tuple[ndarray, float, ndarray]:
    """
    Find sub-observer point on target body.
    
    Parameters:
    - method: str, computation method
    - target: str, target body name
    - et: float, ephemeris time
    - fixref: str, body-fixed reference frame
    - abcorr: str, aberration correction
    - obsrvr: str, observer body name
    
    Returns:
    Tuple[ndarray, float, ndarray]: (spoint, trgepc, srfvec)
    """

Illumination Analysis

Compute illumination conditions at surface points.

def illum(target: str, et: float, abcorr: str, obsrvr: str, spoint: ndarray) -> Tuple[float, float, float]:
    """
    Compute illumination angles at surface point.
    
    Parameters:
    - target: str, target body name
    - et: float, ephemeris time
    - abcorr: str, aberration correction
    - obsrvr: str, observer body name
    - spoint: ndarray, surface point vector
    
    Returns:
    Tuple[float, float, float]: (phase, incdnc, emissn)
    - phase: phase angle in radians
    - incdnc: incidence angle in radians
    - emissn: emission angle in radians
    """

def illumf(method: str, target: str, ilusrc: str, et: float, fixref: str, abcorr: str, obsrvr: str, spoint: ndarray) -> Tuple[float, float, float, float, float]:
    """
    Compute illumination angles with specific illumination source.
    
    Parameters:
    - method: str, computation method
    - target: str, target body name
    - ilusrc: str, illumination source body name
    - et: float, ephemeris time
    - fixref: str, body-fixed reference frame
    - abcorr: str, aberration correction
    - obsrvr: str, observer body name
    - spoint: ndarray, surface point vector
    
    Returns:
    Tuple[float, float, float, float, float]: (trgepc, srfvec, phase, incdnc, emissn)
    """

Limb and Terminator Points

Find limb and terminator points on planetary bodies.

def limbpt(method: str, target: str, et: float, fixref: str, abcorr: str, corloc: str, obsrvr: str, refvec: ndarray, rolstp: float, ncuts: int, schstp: float, soltol: float) -> Tuple[int, ndarray, ndarray, ndarray]:
    """
    Find limb points on target body.
    
    Parameters:
    - method: str, computation method
    - target: str, target body name
    - et: float, ephemeris time
    - fixref: str, body-fixed reference frame
    - abcorr: str, aberration correction
    - corloc: str, correction location
    - obsrvr: str, observer body name
    - refvec: ndarray, reference vector
    - rolstp: float, roll step size
    - ncuts: int, number of cuts
    - schstp: float, search step size
    - soltol: float, solution tolerance
    
    Returns:
    Tuple[int, ndarray, ndarray, ndarray]: (npts, points, epochs, tangts)
    """

Common Usage Patterns

Find Sub-Earth Point on Mars

import spiceypy as spice

spice.furnsh("metakernel.mk")

et = spice.str2et("2023-01-01T12:00:00")
spoint, trgepc, srfvec = spice.subpnt(
    "INTERCEPT/ELLIPSOID",
    "MARS",
    et,
    "IAU_MARS",
    "LT+S",
    "EARTH"
)

# Convert to lat/lon coordinates
radius, lon, lat = spice.reclat(spoint)
print(f"Sub-Earth point: lat={spice.dpr()*lat:.2f}°, lon={spice.dpr()*lon:.2f}°")

spice.kclear()

Install with Tessl CLI

npx tessl i tessl/pypi-spiceypy

docs

ck-orientation.md

coordinate-systems.md

data-structures.md

dsk-shape-models.md

e-kernels.md

ephemeris-trajectories.md

error-handling.md

event-finding.md

geometry-surface.md

index.md

kernel-management.md

low-level-file-access.md

physical-constants.md

reference-frames.md

spacecraft-clock.md

time-systems.md

vector-matrix.md

tile.json