SpiceyPy package

spiceypy module

The MIT License (MIT)

Copyright (c) [2015-2022] [Andrew Annex]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

spiceypy.spiceypy.KernelPool(local_kernels)[source]

Context manager for SPICE kernels.

Check The KernelPool context manager for usage information and examples.

Warning

Using KernelPool will delete any user-defined, kernel-pool variables. Check Compatibility with kernel-pool assignment functions for detailed information.

Parameters:

local_kernels (Union[str, Iterable[str]]) – Path, or list of paths, to individual kernels and/or to meta-kernel files. Both relative, and absolute paths are accepted, but absolute paths are preferable.

spiceypy.spiceypy.appndc(item, cell)[source]

Append an item to a character cell.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/appndc_c.html

Parameters:
  • item (Union[str, Iterable[str], ndarray, str_]) – The item to append.

  • cell (Union[Cell_Char, SpiceCell]) – The cell to append to.

Return type:

None

spiceypy.spiceypy.appndd(item, cell)[source]

Append an item to a double precision cell.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/appndd_c.html

Parameters:
  • item (Union[float, Iterable[float]]) – The item to append.

  • cell (Union[SpiceCell, Cell_Double]) – The cell to append to.

Return type:

None

spiceypy.spiceypy.appndi(item, cell)[source]

Append an item to an integer cell.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/appndi_c.html

Parameters:
  • item (Union[Iterable[int], int]) – The item to append.

  • cell (Union[SpiceCell, Cell_Int]) – The cell to append to.

Return type:

None

spiceypy.spiceypy.axisar(axis, angle)[source]

Construct a rotation matrix that rotates vectors by a specified angle about a specified axis.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/axisar_c.html

Parameters:
  • axis (Union[ndarray, Iterable[float]]) – Rotation axis.

  • angle (float) – Rotation angle, in radians.

Return type:

ndarray

Returns:

Rotation matrix corresponding to axis and angle.

spiceypy.spiceypy.azlcpo(method, target, et, abcorr, azccw, elplsz, obspos, obsctr, obsref)[source]

Return the azimuth/elevation coordinates of a specified target relative to an “observer,” where the observer has constant position in a specified reference frame. The observer’s position is provided by the calling program rather than by loaded SPK files.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/azlcpo_c.html

Parameters:
  • method (str) – Method to obtain the surface normal vector.

  • target (str) – Name of target ephemeris object.

  • et (float) – Observation epoch.

  • abcorr (str) – Aberration correction.

  • azccw (bool) – Flag indicating how azimuth is measured.

  • elplsz (bool) – Flag indicating how elevation is measured.

  • obspos (ndarray) – Observer position relative to center of motion.

  • obsctr (str) – Center of motion of observer.

  • obsref (str) – Body fixed body centered frame of observer’s center.

Return type:

Tuple[ndarray, float]

Returns:

State of target with respect to observer, in azimuth/elevation coordinates. and One way light time between target and observer.

spiceypy.spiceypy.azlrec(range, az, el, azccw, elplsz)[source]

Convert from range, azimuth and elevation of a point to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/azlrec_c.html

Parameters:
  • range (float) – Distance of the point from the origin.

  • az (float) – Azimuth in radians.

  • el (float) – Elevation in radians.

  • azccw (bool) – Flag indicating how azimuth is measured.

  • elplsz (bool) – Flag indicating how elevation is measured.

Return type:

ndarray

Returns:

Rectangular coordinates of a point.

spiceypy.spiceypy.b1900()[source]

Return the Julian Date corresponding to Besselian Date 1900.0.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/b1900_c.html

Return type:

float

Returns:

The Julian Date corresponding to Besselian Date 1900.0.

spiceypy.spiceypy.b1950()[source]

Return the Julian Date corresponding to Besselian Date 1950.0.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/b1950_c.html

Return type:

float

Returns:

The Julian Date corresponding to Besselian Date 1950.0.

spiceypy.spiceypy.badkpv(caller, name, comp, insize, divby, intype)[source]

Determine if a kernel pool variable is present and if so that it has the correct size and type.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/badkpv_c.html

Parameters:
  • caller (str) – Name of the routine calling this routine.

  • name (str) – Name of a kernel pool variable.

  • comp (str) – Comparison operator.

  • insize (int) – Expected size of the kernel pool variable.

  • divby (int) – A divisor of the size of the kernel pool variable.

  • intype (str) – Expected type of the kernel pool variable

Return type:

bool

Returns:

returns false if the kernel pool variable is OK.

spiceypy.spiceypy.bltfrm(frmcls, out_cell=None)[source]

Return a SPICE set containing the frame IDs of all built-in frames of a specified class.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bltfrm_c.html

Parameters:
  • frmcls (int) – Frame class.

  • out_cell (Optional[SpiceCell]) – Optional SpiceInt Cell that is returned

Return type:

SpiceCell

Returns:

Set of ID codes of frames of the specified class.

spiceypy.spiceypy.bodc2n(code, lenout=256)[source]

Translate the SPICE integer code of a body into a common name for that body.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bodc2n_c.html

Parameters:
  • code (int) – Integer ID code to be translated into a name.

  • lenout (int) – Maximum length of output name.

Return type:

Union[Tuple[str, bool], str]

Returns:

A common name for the body identified by code.

spiceypy.spiceypy.bodc2s(code, lenout=256)[source]

Translate a body ID code to either the corresponding name or if no name to ID code mapping exists, the string representation of the body ID value.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bodc2s_c.html

Parameters:
  • code (int) – Integer ID code to translate to a string.

  • lenout (int) – Maximum length of output name.

Return type:

str

Returns:

String corresponding to ‘code’.

spiceypy.spiceypy.boddef(name, code)[source]

Define a body name/ID code pair for later translation via bodn2c() or bodc2n().

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/boddef_c.html

Parameters:
  • name (str) – Common name of some body.

  • code (int) – Integer code for that body.

Return type:

None

spiceypy.spiceypy.bodeul(body, et)[source]

Return the Euler angles needed to compute the transformation from inertial to body-fixed coordinates for any body in the kernel pool.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/spicelib/bodeul.html

Parameters:
  • body (int) – NAIF ID code of body.

  • et (float) – Epoch of transformation in seconds past J2000 TDB.

Return type:

Tuple[float, float, float, float]

Returns:

Right ascension of the (IAU) north pole in radians. Declination of the (IAU) north pole of the body in radians. Prime meridian rotation angle in radians. Angle between the prime meridian and longitude of longest axis in radians.

spiceypy.spiceypy.bodfnd(body, item)[source]

Determine whether values exist for some item for any body in the kernel pool.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bodfnd_c.html

Parameters:
  • body (int) – ID code of body.

  • item (str) – Item to find (“RADII”, “NUT_AMP_RA”, etc.).

Return type:

bool

Returns:

True if the item is in the kernel pool, and is False if it is not.

spiceypy.spiceypy.bodn2c(name)[source]

Translate the name of a body or object to the corresponding SPICE integer ID code.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bodn2c_c.html

Parameters:

name (str) – Body name to be translated into a SPICE ID code.

Return type:

Union[Tuple[int, bool], int]

Returns:

SPICE integer ID code for the named body.

spiceypy.spiceypy.bods2c(name)[source]

Translate a string containing a body name or ID code to an integer code.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bods2c_c.html

Parameters:

name (str) – String to be translated to an ID code.

Return type:

Union[Tuple[int, bool], int]

Returns:

Integer ID code corresponding to name.

spiceypy.spiceypy.bodvar(body, item, dim)[source]

Deprecated: This routine has been superseded by bodvcd() and bodvrd(). This routine is supported for purposes of backward compatibility only.

Return the values of some item for any body in the kernel pool.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bodvar_c.html

Parameters:
  • body (int) – ID code of body.

  • item (str) – Item for which values are desired, (“RADII”, “NUT_PREC_ANGLES”, etc.)

  • dim (int) – Number of values returned.

Return type:

ndarray

Returns:

values

spiceypy.spiceypy.bodvcd(bodyid, item, maxn)[source]

Fetch from the kernel pool the double precision values of an item associated with a body, where the body is specified by an integer ID code.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bodvcd_c.html

Parameters:
  • bodyid (int) – Body ID code.

  • item (str) – Item for which values are desired, (“RADII”, “NUT_PREC_ANGLES”, etc.)

  • maxn (int) – Maximum number of values that may be returned.

Return type:

Tuple[int, ndarray]

Returns:

dim, values

spiceypy.spiceypy.bodvrd(bodynm, item, maxn)[source]

Fetch from the kernel pool the double precision values of an item associated with a body.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bodvrd_c.html

Parameters:
  • bodynm (str) – Body name.

  • item (str) – Item for which values are desired, (“RADII”, “NUT_PREC_ANGLES”, etc.)

  • maxn (int) – Maximum number of values that may be returned.

Return type:

Tuple[int, ndarray]

Returns:

tuple of (dim, values)

spiceypy.spiceypy.brcktd(number, end1, end2)[source]

Bracket a number. That is, given a number and an acceptable interval, make sure that the number is contained in the interval. (If the number is already in the interval, leave it alone. If not, set it to the nearest endpoint of the interval.)

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/brcktd_c.html

Parameters:
  • number (float) – Number to be bracketed.

  • end1 (float) – One of the bracketing endpoints for number.

  • end2 (float) – The other bracketing endpoint for number.

Return type:

float

Returns:

value within an interval

spiceypy.spiceypy.brckti(number, end1, end2)[source]

Bracket a number. That is, given a number and an acceptable interval, make sure that the number is contained in the interval. (If the number is already in the interval, leave it alone. If not, set it to the nearest endpoint of the interval.)

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/brckti_c.html

Parameters:
  • number (int) – Number to be bracketed.

  • end1 (int) – One of the bracketing endpoints for number.

  • end2 (int) – The other bracketing endpoint for number.

Return type:

int

Returns:

value within an interval

spiceypy.spiceypy.bschoc(value, ndim, lenvals, array, order)[source]

Do a binary search for a given value within a character string array, accompanied by an order vector. Return the index of the matching array entry, or -1 if the key value is not found.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bschoc_c.html

Parameters:
  • value (Union[str_, str]) – Key value to be found in array.

  • ndim (int) – Dimension of array.

  • lenvals (int) – String length.

  • array (Union[ndarray, Iterable[str]]) – Character string array to search.

  • order (Union[ndarray, Iterable[int]]) – Order vector.

Return type:

int

Returns:

index

spiceypy.spiceypy.bschoi(value, ndim, array, order)[source]

Do a binary search for a given value within an integer array, accompanied by an order vector. Return the index of the matching array entry, or -1 if the key value is not found.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bschoi_c.html

Parameters:
  • value (int) – Key value to be found in array.

  • ndim (int) – Dimension of array.

  • array (Union[ndarray, Iterable[int]]) – Integer array to search.

  • order (Union[ndarray, Iterable[int]]) – Order vector.

Return type:

int

Returns:

index

spiceypy.spiceypy.bsrchc(value, ndim, lenvals, array)[source]

Do a binary earch for a given value within a character string array. Return the index of the first matching array entry, or -1 if the key value was not found.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bsrchc_c.html

Parameters:
  • value (str) – Key value to be found in array.

  • ndim (int) – Dimension of array.

  • lenvals (int) – String length.

  • array (Iterable[str]) – Character string array to search.

Return type:

int

Returns:

index

spiceypy.spiceypy.bsrchd(value, ndim, array)[source]

Do a binary search for a key value within a double precision array, assumed to be in increasing order. Return the index of the matching array entry, or -1 if the key value is not found.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bsrchd_c.html

Parameters:
  • value (float) – Value to find in array.

  • ndim (int) – Dimension of array.

  • array (ndarray) – Array to be searched.

Return type:

int

Returns:

index

spiceypy.spiceypy.bsrchi(value, ndim, array)[source]

Do a binary search for a key value within an integer array, assumed to be in increasing order. Return the index of the matching array entry, or -1 if the key value is not found.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/bsrchi_c.html

Parameters:
  • value (int) – Value to find in array.

  • ndim (int) – Dimension of array.

  • array (ndarray) – Array to be searched.

Return type:

int

Returns:

index

spiceypy.spiceypy.card(cell)[source]

Return the cardinality (current number of elements) in a cell of any data type.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/card_c.html

Parameters:

cell (SpiceCell) – Input cell.

Return type:

int

Returns:

the number of elements in a cell of any data type.

spiceypy.spiceypy.ccifrm(frclss, clssid, lenout=256)[source]

Return the frame name, frame ID, and center associated with a given frame class and class ID.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ccifrm_c.html

Parameters:
  • frclss (int) – Class of frame.

  • clssid (int) – Class ID of frame.

  • lenout (int) – Maximum length of output string.

Return type:

Union[Tuple[int, str, int, bool], Tuple[int, str, int]]

Returns:

the frame name, frame ID, center.

spiceypy.spiceypy.cell_bool(cell_size)[source]
Return type:

SpiceCell

spiceypy.spiceypy.cell_char(cell_size, length)[source]
Return type:

SpiceCell

spiceypy.spiceypy.cell_double(cell_size)[source]
Return type:

SpiceCell

spiceypy.spiceypy.cell_int(cell_size)[source]
Return type:

SpiceCell

spiceypy.spiceypy.cell_time(cell_size)[source]
Return type:

SpiceCell

spiceypy.spiceypy.cgv2el(center, vec1, vec2)[source]

Form a SPICE ellipse from a center vector and two generating vectors.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cgv2el_c.html

Parameters:
  • center (Union[ndarray, Iterable[float]]) – Center Vector

  • vec1 (Union[ndarray, Iterable[float]]) – Vector 1

  • vec2 (Union[ndarray, Iterable[float]]) – Vector 2

Return type:

Ellipse

Returns:

Ellipse

spiceypy.spiceypy.chbder(cp, degp, x2s, x, nderiv)[source]

Given the coefficients for the Chebyshev expansion of a polynomial, this returns the value of the polynomial and its first nderiv derivatives evaluated at the input X.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/chbder_c.html

Parameters:
  • cp (Union[ndarray, Iterable[float]]) – degp+1 Chebyshev polynomial coefficients.

  • degp (int) – Degree of polynomial.

  • x2s (Union[ndarray, Iterable[float]]) – Transformation parameters of polynomial.

  • x (float) – Value for which the polynomial is to be evaluated

  • nderiv (int) – The number of derivatives to compute

Return type:

ndarray

Returns:

Array of the derivatives of the polynomial

spiceypy.spiceypy.chbigr(degp, cp, x2s, x)[source]

Evaluate an indefinite integral of a Chebyshev expansion at a specified point `x’ and return the value of the input expansion at `x’ as well. The constant of integration is selected to make the integral zero when `x’ equals the abscissa value x2s[0].

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/chbigr_c.html

Parameters:
  • degp (int) – Degree of input Chebyshev expansion.

  • cp (ndarray) – Chebyshev coefficients of input expansion.

  • x2s (ndarray) – Transformation parameters.

  • x (float) – Abscissa value of evaluation.

Return type:

Tuple[float, float]

Returns:

Input expansion evaluated at xIntegral evaluated at x.

spiceypy.spiceypy.chbint(cp, degp, x2s, x)[source]

Return the value of a polynomial and its derivative, evaluated at the input `x’, using the coefficients of the Chebyshev expansion of the polynomial.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/chbint_c.html

Parameters:
  • cp (ndarray) – degp 1 Chebyshev polynomial coefficients.

  • degp (int) – Degree of polynomial.

  • x2s (ndarray) – Transformation parameters of polynomial.

  • x (float) – Value for which the polynomial is to be evaluated.

Return type:

Tuple[float, float]

Returns:

Value of the polynomial at xValue of the derivative of the polynomial at X.

spiceypy.spiceypy.chbval(cp, degp, x2s, x)[source]

Return the value of a polynomial evaluated at the input `x’ using the coefficients for the Chebyshev expansion of the polynomial.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/chbval_c.html

Parameters:
  • cp (ndarray) – degp 1 Chebyshev polynomial coefficients.

  • degp (int) – Degree of polynomial.

  • x2s (ndarray) – Transformation parameters of polynomial.

  • x (float) – Value for which the polynomial is to be evaluated.

Return type:

float

Returns:

Value of the polynomial at x.

spiceypy.spiceypy.check_for_spice_error(f)[source]

Internal decorator function to check spice error system for failed calls

Parameters:

f (Optional[Callable]) – function

Raises:

stypes.SpiceyError

Return type:

None

spiceypy.spiceypy.chkin(module)[source]

Inform the SPICE error handling mechanism of entry into a routine.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/chkin_c.html

Parameters:

module (str) – The name of the calling routine.

Return type:

None

spiceypy.spiceypy.chkout(module)[source]

Inform the SPICE error handling mechanism of exit from a routine.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/chkout_c.html

Parameters:

module (str) – The name of the calling routine.

Return type:

None

spiceypy.spiceypy.cidfrm(cent, lenout=256)[source]

Retrieve frame ID code and name to associate with a frame center.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cidfrm_c.html

Parameters:
  • cent (int) – An object to associate a frame with.

  • lenout (int) – Available space in output string frname.

Return type:

Union[Tuple[int, str, bool], Tuple[int, str]]

Returns:

frame ID code, name to associate with a frame center.

spiceypy.spiceypy.ckcls(handle)[source]

Close an open CK file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckcls_c.html

Parameters:

handle (int) – Handle of the CK file to be closed.

Return type:

None

spiceypy.spiceypy.ckcov(ck, idcode, needav, level, tol, timsys, cover=None)[source]

Find the coverage window for a specified object in a specified CK file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckcov_c.html

Parameters:
  • ck (str) – Name of CK file.

  • idcode (int) – ID code of object.

  • needav (bool) – Flag indicating whether angular velocity is needed.

  • level (str) – Coverage level: (SEGMENT OR INTERVAL)

  • tol (float) – Tolerance in ticks.

  • timsys (str) – Time system used to represent coverage.

  • cover (Optional[SpiceCell]) – Window giving coverage for idcode.

Return type:

SpiceCell

Returns:

coverage window for a specified object in a specified CK file

spiceypy.spiceypy.ckfrot(inst, et)[source]

Find the rotation from a C-kernel Id to the native frame at the time requested.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckfrot_c.html

Parameters:
  • inst (int) – NAIF instrument ID

  • et (float) – Epoch measured in seconds past J2000

Return type:

Union[Tuple[ndarray, int, bool], Tuple[ndarray, int]]

Returns:

Rotation matrix from the input frame to the returned reference frame, id for the reference frame

spiceypy.spiceypy.ckfxfm(inst, et)[source]

Find the state transformation matrix from a C-kernel (CK) frame with the specified frame class ID (CK ID) to the base frame of the highest priority CK segment containing orientation and angular velocity data for this CK frame at the time requested.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckfxfm_c.html

Parameters:
  • inst (int) – Frame class ID CK ID of a CK frame.

  • et (float) – Epoch measured in seconds past J2000 TDB.

Return type:

Union[Tuple[ndarray, int, bool], Tuple[ndarray, int]]

Returns:

Transformation from CK frame to frame ref, Frame ID of the base reference.

spiceypy.spiceypy.ckgp(inst, sclkdp, tol, ref)[source]

Get pointing (attitude) for a specified spacecraft clock time.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckgp_c.html

Parameters:
  • inst (int) – NAIF ID of instrument, spacecraft, or structure.

  • sclkdp (Union[float, int]) – Encoded spacecraft clock time.

  • tol (int) – Time tolerance.

  • ref (str) – Reference frame.

Return type:

Union[Tuple[ndarray, float, bool], Tuple[ndarray, float]]

Returns:

C-matrix pointing data, Output encoded spacecraft clock time

spiceypy.spiceypy.ckgpav(inst, sclkdp, tol, ref)[source]

Get pointing (attitude) and angular velocity for a specified spacecraft clock time.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckgpav_c.html

Parameters:
  • inst (int) – NAIF ID of instrument, spacecraft, or structure.

  • sclkdp (float) – Encoded spacecraft clock time.

  • tol (Union[float, int]) – Time tolerance.

  • ref (str) – Reference frame.

Return type:

Union[Tuple[ndarray, ndarray, float, bool], Tuple[ndarray, ndarray, float]]

Returns:

C-matrix pointing data, Angular velocity vector, Output encoded spacecraft clock time.

spiceypy.spiceypy.ckgr02(handle, descr, recno)[source]

Return a specified pointing instance from a CK type 02 segment. The segment is identified by a CK file handle and segment descriptor.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckgr02_c.html

Parameters:
  • handle (int) – The handle of the CK file containing the segment.

  • descr (ndarray) – The segment descriptor.

  • recno (int) – The number of the pointing record to be returned.

Return type:

ndarray

Returns:

The pointing record.

spiceypy.spiceypy.ckgr03(handle, descr, recno)[source]

Return a specified pointing instance from a CK type 03 segment. The segment is identified by a CK file handle and segment descriptor.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckgr03_c.html

Parameters:
  • handle (int) – The handle of the CK file containing the segment.

  • descr (ndarray) – The segment descriptor.

  • recno (int) – The number of the pointing instance to be returned.

Return type:

ndarray

Returns:

The pointing record.

spiceypy.spiceypy.cklpf(filename)[source]

Load a CK pointing file for use by the CK readers. Return that file’s handle, to be used by other CK routines to refer to the file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cklpf_c.html

Parameters:

filename (str) – Name of the CK file to be loaded.

Return type:

int

Returns:

Loaded file’s handle.

spiceypy.spiceypy.ckmeta(ckid, meta)[source]

Return (depending upon the user’s request) the ID code of either the spacecraft or spacecraft clock associated with a C-Kernel ID code.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckmeta_c.html

Parameters:
  • ckid (int) – The ID code for some C kernel object.

  • meta (str) – The kind of meta data requested SPK or SCLK.

Return type:

int

Returns:

The requested SCLK or spacecraft ID code.

spiceypy.spiceypy.cknr02(handle, descr)[source]

Return the number of pointing records in a CK type 02 segment. The segment is identified by a CK file handle and segment descriptor.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cknr02_c.html

Parameters:
  • handle (int) – The handle of the CK file containing the segment.

  • descr (ndarray) – The descriptor of the type 2 segment.

Return type:

int

Returns:

The number of records in the segment.

spiceypy.spiceypy.cknr03(handle, descr)[source]

Return the number of pointing instances in a CK type 03 segment. The segment is identified by a CK file handle and segment descriptor.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cknr03_c.html

Parameters:
  • handle (int) – The handle of the CK file containing the segment.

  • descr (ndarray) – The descriptor of the type 3 segment.

Return type:

int

Returns:

The number of pointing instances in the segment.

spiceypy.spiceypy.ckobj(ck, out_cell=None)[source]

Find the set of ID codes of all objects in a specified CK file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckobj_c.html

Parameters:
  • ck (str) – Name of CK file.

  • out_cell (Optional[SpiceCell]) – Optional user provided Spice Int cell.

Return type:

SpiceCell

Returns:

Set of ID codes of objects in CK file.

spiceypy.spiceypy.ckopn(filename, ifname, ncomch)[source]

Open a new CK file, returning the handle of the opened file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckopn_c.html

Parameters:
  • filename (str) – The name of the CK file to be opened.

  • ifname (str) – The internal filename for the CK.

  • ncomch (int) – The number of characters to reserve for comments.

Return type:

int

Returns:

The handle of the opened CK file.

spiceypy.spiceypy.ckupf(handle)[source]

Unload a CK pointing file so that it will no longer be searched by the readers.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckupf_c.html

Parameters:

handle (int) – Handle of CK file to be unloaded

Return type:

None

spiceypy.spiceypy.ckw01(handle, begtim, endtim, inst, ref, avflag, segid, nrec, sclkdp, quats, avvs)[source]

Add a type 1 segment to a C-kernel.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckw01_c.html

Parameters:
  • handle (int) – Handle of an open CK file.

  • begtim (float) – The beginning encoded SCLK of the segment.

  • endtim (float) – The ending encoded SCLK of the segment.

  • inst (int) – The NAIF instrument ID code.

  • ref (str) – The reference frame of the segment.

  • avflag (bool) – True if the segment will contain angular velocity.

  • segid (str) – Segment identifier.

  • nrec (int) – Number of pointing records.

  • sclkdp (Union[ndarray, Iterable[float]]) – Encoded SCLK times.

  • quats (Union[ndarray, Iterable[Iterable[float]]]) – Quaternions representing instrument pointing.

  • avvs (Union[ndarray, Iterable[Iterable[float]]]) – Angular velocity vectors.

Return type:

None

spiceypy.spiceypy.ckw02(handle, begtim, endtim, inst, ref, segid, nrec, start, stop, quats, avvs, rates)[source]

Write a type 2 segment to a C-kernel.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckw02_c.html

Parameters:
  • handle (int) – Handle of an open CK file.

  • begtim (float) – The beginning encoded SCLK of the segment.

  • endtim (float) – The ending encoded SCLK of the segment.

  • inst (int) – The NAIF instrument ID code.

  • ref (str) – The reference frame of the segment.

  • segid (str) – Segment identifier.

  • nrec (int) – Number of pointing records.

  • start (ndarray) – Encoded SCLK interval start times.

  • stop (ndarray) – Encoded SCLK interval stop times.

  • quats (ndarray) – Quaternions representing instrument pointing.

  • avvs (ndarray) – Angular velocity vectors.

  • rates (Union[ndarray, Iterable[float]]) – Number of seconds per tick for each interval.

Return type:

None

spiceypy.spiceypy.ckw03(handle, begtim, endtim, inst, ref, avflag, segid, nrec, sclkdp, quats, avvs, nints, starts)[source]

Add a type 3 segment to a C-kernel.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckw03_c.html

Parameters:
  • handle (int) – Handle of an open CK file.

  • begtim (float) – The beginning encoded SCLK of the segment.

  • endtim (float) – The ending encoded SCLK of the segment.

  • inst (int) – The NAIF instrument ID code.

  • ref (str) – The reference frame of the segment.

  • avflag (bool) – True if the segment will contain angular velocity.

  • segid (str) – Segment identifier.

  • nrec (int) – Number of pointing records.

  • sclkdp (ndarray) – Encoded SCLK times.

  • quats (ndarray) – Quaternions representing instrument pointing.

  • avvs (ndarray) – Angular velocity vectors.

  • nints (int) – Number of intervals.

  • starts (Union[ndarray, Iterable[float]]) – Encoded SCLK interval start times.

Return type:

None

spiceypy.spiceypy.ckw05(handle, subtype, degree, begtim, endtim, inst, ref, avflag, segid, sclkdp, packts, rate, nints, starts)[source]

Write a type 5 segment to a CK file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckw05_c.html

Parameters:
  • handle (int) – Handle of an open CK file.

  • subtype (int) – CK type 5 subtype code. Can be: 0, 1, 2, 3 see naif docs via link above.

  • degree (int) – Degree of interpolating polynomials.

  • begtim (float) – The beginning encoded SCLK of the segment.

  • endtim (float) – The ending encoded SCLK of the segment.

  • inst (int) – The NAIF instrument ID code.

  • ref (str) – The reference frame of the segment.

  • avflag (bool) – True if the segment will contain angular velocity.

  • segid (str) – Segment identifier.

  • sclkdp (ndarray) – Encoded SCLK times.

  • packts (Sequence[Iterable[float]]) – Array of packets.

  • rate (float) – Nominal SCLK rate in seconds per tick.

  • nints (int) – Number of intervals.

  • starts (ndarray) – Encoded SCLK interval start times.

Return type:

None

spiceypy.spiceypy.clight()[source]

Return the speed of light in a vacuum (IAU official value, in km/sec).

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/clight_c.html

Return type:

float

Returns:

The function returns the speed of light in vacuum (km/sec).

spiceypy.spiceypy.clpool()[source]

Remove all variables from the kernel pool. Watches on kernel variables are retained.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/clpool_c.html

Return type:

None

spiceypy.spiceypy.cltext(fname)[source]

Internal undocumented command for closing a text file opened by RDTEXT.

No URL available; relevant lines from SPICE source:

FORTRAN SPICE, rdtext.f:

C$Procedure  CLTEXT ( Close a text file opened by RDTEXT)
      ENTRY  CLTEXT ( FILE )
      CHARACTER*(*)       FILE
C     VARIABLE  I/O  DESCRIPTION
C     --------  ---  --------------------------------------------------
C     FILE       I   Text file to be closed.

CSPICE, rdtext.c:

/* $Procedure  CLTEXT ( Close a text file opened by RDTEXT) */
/* Subroutine */ int cltext_(char *file, ftnlen file_len)
Parameters:

fname (str) – Text file to be closed.

Return type:

None

spiceypy.spiceypy.cmprss(delim, n, instr, lenout=256)[source]

Compress a character string by removing occurrences of more than N consecutive occurrences of a specified character.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cmprss_c.html

Parameters:
  • delim (str) – Delimiter to be compressed.

  • n (int) – Maximum consecutive occurrences of delim.

  • instr (str) – Input string.

  • lenout (int) – Optional available space in output string.

Return type:

str

Returns:

Compressed string.

spiceypy.spiceypy.cnmfrm(cname, lenout=256)[source]

Retrieve frame ID code and name to associate with an object.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cnmfrm_c.html

Parameters:
  • cname (str) – Name of the object to find a frame for.

  • lenout (int) – Maximum length available for frame name.

Return type:

Union[Tuple[int, str, bool], Tuple[int, str]]

Returns:

The ID code of the frame associated with cname, The name of the frame with ID frcode.

spiceypy.spiceypy.conics(elts, et)[source]

Determine the state (position, velocity) of an orbiting body from a set of elliptic, hyperbolic, or parabolic orbital elements.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/conics_c.html

Parameters:
  • elts (ndarray) – Conic elements.

  • et (float) – Input time.

Return type:

ndarray

Returns:

State of orbiting body at et.

spiceypy.spiceypy.convrt(x, inunit, outunit)[source]

Take a measurement X, the units associated with X, and units to which X should be converted; return Y the value of the measurement in the output units.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/convrt_c.html

Parameters:
  • x (Union[float, Iterable[float]]) – Number representing a measurement in some units.

  • inunit (str) – The units in which x is measured.

  • outunit (str) – Desired units for the measurement.

Return type:

Union[ndarray, float]

Returns:

The measurment in the desired units.

spiceypy.spiceypy.copy(cell)[source]

Copy the contents of a SpiceCell of any data type to another cell of the same type.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/copy_c.html

Parameters:

cell (SpiceCell) – Cell to be copied.

Return type:

SpiceCell

Returns:

New cell

spiceypy.spiceypy.cpos(string, chars, start)[source]

Find the first occurrence in a string of a character belonging to a collection of characters, starting at a specified location, searching forward.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cpos_c.html

Parameters:
  • string (str) – Any character string.

  • chars (str) – A collection of characters.

  • start (int) – Position to begin looking for one of chars.

Return type:

int

Returns:

The index of the first character of str at or following index start that is in the collection chars.

spiceypy.spiceypy.cposr(string, chars, start)[source]

Find the first occurrence in a string of a character belonging to a collection of characters, starting at a specified location, searching in reverse.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cposr_c.html

Parameters:
  • string (str) – Any character string.

  • chars (str) – A collection of characters.

  • start (int) – Position to begin looking for one of chars.

Return type:

int

Returns:

The index of the last character of str at or before index start that is in the collection chars.

spiceypy.spiceypy.cvpool(agent)[source]

Indicate whether or not any watched kernel variables that have a specified agent on their notification list have been updated.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cvpool_c.html

Parameters:

agent (str) – Name of the agent to check for notices.

Return type:

bool

Returns:

True if variables for “agent” have been updated.

spiceypy.spiceypy.cyllat(r, lonc, z)[source]

Convert from cylindrical to latitudinal coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cyllat_c.html

Parameters:
  • r (float) – Distance of point from z axis.

  • lonc (float) – Cylindrical angle of point from XZ plane(radians).

  • z (float) – Height of point above XY plane.

Return type:

Tuple[float, float, float]

Returns:

Distance, Longitude (radians), and Latitude of point (radians).

spiceypy.spiceypy.cylrec(r, lon, z)[source]

Convert from cylindrical to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cylrec_c.html

Parameters:
  • r (float) – Distance of a point from z axis.

  • lon (float) – Angle (radians) of a point from xZ plane.

  • z (float) – Height of a point above xY plane.

Return type:

ndarray

Returns:

Rectangular coordinates of the point.

spiceypy.spiceypy.cylsph(r, lonc, z)[source]

Convert from cylindrical to spherical coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/cylsph_c.html

Parameters:
  • r (float) – Rectangular coordinates of the point.

  • lonc (float) – Angle (radians) of point from XZ plane.

  • z (float) – Height of point above XY plane.

Return type:

Tuple[float, float, float]

Returns:

Distance of point from origin, Polar angle (co-latitude in radians) of point, Azimuthal angle (longitude) of point (radians).

spiceypy.spiceypy.dafac(handle, buffer)[source]

Add comments from a buffer of character strings to the comment area of a binary DAF file, appending them to any comments which are already present in the file’s comment area.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafac_c.html

Parameters:
  • handle (int) – handle of a DAF opened with write access.

  • buffer (Sequence[str]) – Buffer of comments to put into the comment area.

Return type:

None

spiceypy.spiceypy.dafbbs(handle)[source]

Begin a backward search for arrays in a DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafbbs_c.html

Parameters:

handle (int) – Handle of DAF to be searched.

Return type:

None

spiceypy.spiceypy.dafbfs(handle)[source]

Begin a forward search for arrays in a DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafbfs_c.html

Parameters:

handle (int) – Handle of file to be searched.

Return type:

None

spiceypy.spiceypy.dafcls(handle)[source]

Close the DAF associated with a given handle.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafcls_c.html

Parameters:

handle (int) – Handle of DAF to be closed.

Return type:

None

spiceypy.spiceypy.dafcs(handle)[source]

Select a DAF that already has a search in progress as the one to continue searching.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafcs_c.html

Parameters:

handle (int) – Handle of DAF to continue searching.

Return type:

None

spiceypy.spiceypy.dafdc(handle)[source]

Delete the entire comment area of a specified DAF file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafdc_c.html

Parameters:

handle (int) – The handle of a binary DAF opened for writing.

Return type:

None

spiceypy.spiceypy.dafec(handle, bufsiz, lenout=256)[source]

Extract comments from the comment area of a binary DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafec_c.html

Parameters:
  • handle (int) – Handle of binary DAF opened with read access.

  • bufsiz (int) – Maximum size, in lines, of buffer.

  • lenout (int) – Length of strings in output buffer.

Return type:

Tuple[int, Iterable[str], bool]

Returns:

Number of extracted comment lines, buffer where extracted comment lines are placed, Indicates whether all comments have been extracted.

spiceypy.spiceypy.daffna()[source]

Find the next (forward) array in the current DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/daffna_c.html

Return type:

bool

Returns:

True if an array was found.

spiceypy.spiceypy.daffpa()[source]

Find the previous (backward) array in the current DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/daffpa_c.html

Return type:

bool

Returns:

True if an array was found.

spiceypy.spiceypy.dafgda(handle, begin, end)[source]

Read the double precision data bounded by two addresses within a DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafgda_c.html

Parameters:
  • handle (int) – Handle of a DAF.

  • begin (int) – Initial address within file.

  • end (int) – Final address within file.

Return type:

ndarray

Returns:

Data contained between begin and end.

spiceypy.spiceypy.dafgh()[source]

Return (get) the handle of the DAF currently being searched.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafgh_c.html

Return type:

int

Returns:

Handle for current DAF.

spiceypy.spiceypy.dafgn(lenout=256)[source]

Return (get) the name for the current array in the current DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafgn_c.html

Parameters:

lenout (int) – Length of array name string.

Return type:

str

Returns:

Name of current array.

spiceypy.spiceypy.dafgs(n=125)[source]

Return (get) the summary for the current array in the current DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafgs_c.html

Parameters:

n (int) – Optional length N for result Array, defaults to 125.

Return type:

ndarray

Returns:

Summary for current array.

spiceypy.spiceypy.dafgsr(handle, recno, begin, end)[source]

Read a portion of the contents of (words in) a summary record in a DAF file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafgsr_c.html

Parameters:
  • handle (int) – Handle of DAF.

  • recno (int) – Record number; word indices are 1-based, 1 to 128 inclusive.

  • begin (int) – Index of first word to read from record, will be clamped > 0.

  • end (int) – Index of last word to read, wll be clamped < 129

Return type:

Union[Tuple[ndarray, bool], ndarray]

Returns:

Contents of request sub-record

spiceypy.spiceypy.dafhsf(handle)[source]

Return the summary format associated with a handle.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafhsf_c.html

Parameters:

handle (int) – Handle of a DAF file.

Return type:

Tuple[int, int]

Returns:

Number of double precision components in summariesNumber of integer components in summaries.

spiceypy.spiceypy.dafopr(fname)[source]

Open a DAF for subsequent read requests.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafopr_c.html

Parameters:

fname (str) – Name of DAF to be opened.

Return type:

int

Returns:

Handle assigned to DAF.

spiceypy.spiceypy.dafopw(fname)[source]

Open a DAF for subsequent write requests.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafopw_c.html

Parameters:

fname (str) – Name of DAF to be opened.

Return type:

int

Returns:

Handle assigned to DAF.

spiceypy.spiceypy.dafps(nd, ni, dc, ic)[source]

Pack (assemble) an array summary from its double precision and integer components.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafps_c.html

Parameters:
  • nd (int) – Number of double precision components.

  • ni (int) – Number of integer components.

  • dc (ndarray) – Double precision components.

  • ic (ndarray) – Integer components.

Return type:

ndarray

Returns:

Array summary.

spiceypy.spiceypy.dafrda(handle, begin, end)[source]

Read the double precision data bounded by two addresses within a DAF.

Deprecated: This routine has been superseded by dafgda() and dafgsr(). This routine is supported for purposes of backward compatibility only.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafrda_c.html

Parameters:
  • handle (int) – Handle of a DAF.

  • begin (int) – Initial address within file.

  • end (int) – Final address within file.

Return type:

ndarray

Returns:

Data contained between begin and end.

spiceypy.spiceypy.dafrfr(handle, lenout=256)[source]

Read the contents of the file record of a DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafrfr_c.html

Parameters:
  • handle (int) – Handle of an open DAF file.

  • lenout (int) – Available room in the output string

Return type:

Tuple[int, int, str, int, int, int]

Returns:

Number of double precision components in summaries, Number of integer components in summaries, Internal file name, Forward list pointer, Backward list pointer, Free address pointer.

spiceypy.spiceypy.dafrs(insum)[source]

Change the summary for the current array in the current DAF.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafrs_c.html

Parameters:

insum (ndarray) – New summary for current array.

Return type:

None

spiceypy.spiceypy.dafus(insum, nd, ni)[source]

Unpack an array summary into its double precision and integer components.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dafus_c.html

Parameters:
  • insum (ndarray) – Array summary.

  • nd (int) – Number of double precision components.

  • ni (int) – Number of integer components.

Return type:

Tuple[ndarray, ndarray]

Returns:

Double precision components, Integer components.

spiceypy.spiceypy.dasac(handle, buffer)[source]

Add comments from a buffer of character strings to the comment area of a binary DAS file, appending them to any comments which are already present in the file’s comment area.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasac_c.html

Parameters:
  • handle (int) – DAS handle of a file opened with write access.

  • buffer (Sequence[str]) – Buffer of lines to be put into the comment area.

Return type:

None

spiceypy.spiceypy.dasadc(handle, n, bpos, epos, datlen, data)[source]

Add character data to a DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasadc_c.html

Parameters:
  • handle (int) – DAS file handle.

  • n (int) – Number of characters to add to file.

  • bpos (int) – Begin positions of substrings.

  • epos (int) – End positions of substrings.

  • datlen (int) – Common length of the character arrays in data.

  • data (Sequence[str]) – Array providing the set of substrings to be added.

Return type:

None

spiceypy.spiceypy.dasadd(handle, n, data)[source]

Add an array of double precision numbers to a DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasadd_c.html

Parameters:
  • handle (int) – DAS file handle.

  • n (int) – Number of d p numbers to add to DAS file.

  • data (ndarray) – Array of d p numbers to add.

Return type:

None

spiceypy.spiceypy.dasadi(handle, n, data)[source]

Add an array of integers to a DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasadi_c.html

Parameters:
  • handle (int) – DAS file handle.

  • n (int) – Number of integers to add to DAS file.

  • data (ndarray) – Array of integers to add.

Return type:

None

spiceypy.spiceypy.dascls(handle)[source]

Close a DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dascls_c.html

Parameters:

handle (int) – Handle of an open DAS file.

Return type:

None

spiceypy.spiceypy.dasdc(handle)[source]

Delete the entire comment area of a previously opened binary DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasdc_c.html

Parameters:

handle (int) – The handle of a binary DAS file opened for writing.

Return type:

None

spiceypy.spiceypy.dasec(handle, bufsiz=256, buflen=256)[source]

Extract comments from the comment area of a binary DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasec_c.html

Parameters:
  • handle (int) – Handle of binary DAS file open with read access.

  • bufsiz (int) – Maximum size, in lines, of buffer.

  • buflen (int) – Line length associated with buffer.

Return type:

Tuple[int, Iterable[str], int]

Returns:

Number of comments extracted from the DAS file, Buffer in which extracted comments are placed, Indicates whether all comments have been extracted.

spiceypy.spiceypy.dashfn(handle, lenout=256)[source]

Return the name of the DAS file associated with a handle.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dashfn_c.html

Parameters:
  • handle (int) – Handle of a DAS file.

  • lenout (int) – Length of output file name string.

Return type:

str

Returns:

Corresponding file name.

spiceypy.spiceypy.dashfs(handle)[source]

Return a file summary for a specified DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dashfs_c.html

Parameters:

handle (int) – Handle of a DAS file.

Return type:

Tuple[int, int, int, int, int, ndarray, ndarray, ndarray]

Returns:

Number of reserved records in file, Number of characters in use in reserved rec area, Number of comment records in file, Number of characters in use in comment area, Number of first free record, Array of last logical addresses for each data type, Record number of last descriptor of each data type, Word number of last descriptor of each data type.

spiceypy.spiceypy.daslla(handle)[source]

Return last DAS logical addresses of character, double precision and integer type that are currently in use in a specified DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/daslla_c.html

Parameters:

handle (int) – DAS file handle.

Return type:

Tuple[int, int, int]

Returns:

Last character address in use, Last double precision address in use, Last integer address in use.

spiceypy.spiceypy.dasllc(handle)[source]

Close the DAS file associated with a given handle, without flushing buffered data or segregating the file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasllc_c.html

Parameters:

handle (int) – Handle of a DAS file to be closed.

Return type:

None

spiceypy.spiceypy.dasonw(fname, ftype, ifname, ncomr)[source]

Open a new DAS file and set the file type.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasonw_c.html

Parameters:
  • fname (str) – Name of a DAS file to be opened.

  • ftype (str) – type

  • ifname (str) – internal file name

  • ncomr (int) – amount of comment area

Return type:

int

Returns:

Handle to new DAS file

spiceypy.spiceypy.dasopr(fname)[source]

Open a DAS file for reading.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasopr_c.html

Parameters:

fname (str) – Name of a DAS file to be opened.

Return type:

int

Returns:

Handle assigned to the opened DAS file.

spiceypy.spiceypy.dasops()[source]

Open a scratch DAS file for writing.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasops_c.html

Return type:

int

Returns:

Handle assigned to a scratch DAS file.

spiceypy.spiceypy.dasopw(fname)[source]

Open a DAS file for writing.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasopw_c.html :type fname: str :param fname: Name of a DAS file to be opened. :rtype: int :return: Handle assigned to the opened DAS file.

spiceypy.spiceypy.dasrdd(handle, first, last)[source]

Read double precision data from a range of DAS logical addresses.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasrdd_c.html

Parameters:
  • handle (int) – DAS file handle.

  • first (int) – start of range of DAS double precision.

  • last (int) – end of range of DAS double precision.

Return type:

ndarray

Returns:

Data having addresses first through last.

spiceypy.spiceypy.dasrdi(handle, first, last)[source]

Read integer data from a range of DAS logical addresses.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasrdi_c.html

Parameters:
  • handle (int) – DAS file handle.

  • first (int) – start of range of DAS double precision.

  • last (int) – end of range of DAS double precision.

Return type:

ndarray

Returns:

Data having addresses first through last.

spiceypy.spiceypy.dasrfr(handle, lenout=256)[source]

Return the contents of the file record of a specified DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasrfr_c.html

Parameters:
  • handle (int) – DAS file handle.

  • lenout (int) – length of output strs

Return type:

Tuple[str, str, int, int, int, int]

Returns:

ID word, DAS internal file name, Number of reserved records in file, Number of characters in use in reserved rec. area, Number of comment records in file, Number of characters in use in comment area.

spiceypy.spiceypy.dasudd(handle, first, last, data)[source]

Update data in a specified range of double precision addresses in a DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasudd_c.html

Parameters:
  • handle (int) – DAS file handle.

  • first (int) – first address

  • last (int) – Range of d p addresses to write to.

  • data (ndarray) – An array of d p numbers.

Return type:

None

spiceypy.spiceypy.dasudi(handle, first, last, data)[source]

Update data in a specified range of integer addresses in a DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dasudi_c.html

Parameters:
  • handle (int) – DAS file handle.

  • first (int) – first integer addresses to write to.

  • last (int) – last integer addresses to write to.

  • data (ndarray) – An array of integers.

Return type:

None

spiceypy.spiceypy.daswbr(handle)[source]

Write out all buffered records of a specified DAS file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/daswbr_c.html

Parameters:

handle (int) – Handle of DAS file.

Return type:

None

spiceypy.spiceypy.datetime2et(dt)[source]

Converts a standard Python datetime to a double precision value representing the number of TDB seconds past the J2000 epoch corresponding to the input epoch.

Timezone-naive datetimes will be assumed to be UTC, timezone-aware datetimes will be handled correctly by converting to UTC before passing them to CSPICE.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/time.html#The%20J2000%20Epoch

Parameters:

dt (Union[Iterable[datetime], datetime]) – A standard Python datetime

Return type:

Union[ndarray, float]

Returns:

The equivalent value in seconds past J2000, TDB.

spiceypy.spiceypy.dazldr(x, y, z, azccw, elplsz)[source]

Compute the Jacobian matrix of the transformation from rectangular to azimuth/elevation coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dazldr_c.html

Parameters:
  • x (float) – x coordinate of point.

  • y (float) – y coordinate of point.

  • z (float) – z coordinate of point.

  • azccw (bool) – Flag indicating how azimuth is measured.

  • elplsz (bool) – Flag indicating how elevation is measured.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.dcyldr(x, y, z)[source]

This routine computes the Jacobian of the transformation from rectangular to cylindrical coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dcyldr_c.html

Parameters:
  • x (float) – X-coordinate of point.

  • y (float) – Y-coordinate of point.

  • z (float) – Z-coordinate of point.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.deltet(epoch, eptype)[source]

Return the value of Delta ET (ET-UTC) for an input epoch.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/deltet_c.html

Parameters:
  • epoch (float) – Input epoch (seconds past J2000).

  • eptype (str) – Type of input epoch (“UTC” or “ET”).

Return type:

float

Returns:

Delta ET (ET-UTC) at input epoch.

spiceypy.spiceypy.det(m1)[source]

Compute the determinant of a double precision 3x3 matrix.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/det_c.html

Parameters:

m1 (ndarray) – Matrix whose determinant is to be found.

Return type:

float

Returns:

The determinant of the matrix.

spiceypy.spiceypy.dgeodr(x, y, z, re, f)[source]

This routine computes the Jacobian of the transformation from rectangular to geodetic coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dgeodr_c.html

Parameters:
  • x (float) – X-coordinate of point.

  • y (float) – Y-coordinate of point.

  • z (float) – Z-coord

  • re (float) – Equatorial radius of the reference spheroid.

  • f (float) – Flattening coefficient.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.diags2(symmat)[source]

Diagonalize a symmetric 2x2 matrix.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/diags2_c.html

Parameters:

symmat (Union[ndarray, Iterable[Iterable[float]]]) – A symmetric 2x2 matrix.

Return type:

Tuple[ndarray, ndarray]

Returns:

A diagonal matrix similar to symmat, A rotation used as the similarity transformation.

spiceypy.spiceypy.diff(a, b)[source]

Take the difference of two sets of any data type to form a third set. https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/diff_c.html

Parameters:
Return type:

SpiceCell

Returns:

Difference of a and b.

spiceypy.spiceypy.dlabbs(handle)[source]

Begin a backward segment search in a DLA file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlabbs_c.html

Parameters:

handle (int) – Handle of open DLA file.

Return type:

Union[Tuple[SpiceDLADescr, bool], SpiceDLADescr]

Returns:

Descriptor of last segment in DLA file

spiceypy.spiceypy.dlabfs(handle)[source]

Begin a forward segment search in a DLA file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlabfs_c.html

Parameters:

handle (int) – Handle of open DLA file.

Return type:

Union[Tuple[SpiceDLADescr, bool], SpiceDLADescr]

Returns:

Descriptor of next segment in DLA file

spiceypy.spiceypy.dlabns(handle)[source]

Begin a new segment in a DLA file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlabns_c.html

Parameters:

handle (int) – Handle of open DLA file.

Return type:

None

spiceypy.spiceypy.dlaens(handle)[source]

End a new segment in a DLA file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlaens_c.html

Parameters:

handle (int) – Handle of open DLA file.

Return type:

None

spiceypy.spiceypy.dlafns(handle, descr)[source]

Find the segment following a specified segment in a DLA file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlafns_c.html

Parameters:
  • handle (int) – Handle of open DLA file.

  • descr (SpiceDLADescr) – Descriptor of a DLA segment.

Return type:

Union[Tuple[SpiceDLADescr, bool], SpiceDLADescr]

Returns:

Descriptor of next segment in DLA file

spiceypy.spiceypy.dlafps(handle, descr)[source]

Find the segment preceding a specified segment in a DLA file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlafps_c.html

Parameters:
  • handle (int) – Handle of open DLA file.

  • descr (SpiceDLADescr) – Descriptor of a segment in DLA file.

Return type:

Union[Tuple[SpiceDLADescr, bool], SpiceDLADescr]

Returns:

Descriptor of previous segment in DLA file

spiceypy.spiceypy.dlaopn(fname, ftype, ifname, ncomch)[source]

Open a new DLA file and set the file type.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlaopn_c.html

Parameters:
  • fname (str) – Name of a DLA file to be opened.

  • ftype (str) – Mnemonic code for type of data in the DLA file.

  • ifname (str) – Internal file name.

  • ncomch (int) – Number of comment characters to allocate.

Return type:

int

Returns:

Handle assigned to the opened DLA file.

spiceypy.spiceypy.dlatdr(x, y, z)[source]

This routine computes the Jacobian of the transformation from rectangular to latitudinal coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlatdr_c.html

Parameters:
  • x (float) – X-coordinate of point.

  • y (float) – Y-coordinate of point.

  • z (float) – Z-coord

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.dnearp(state, a, b, c)[source]

Compute the state (position and velocity) of an ellipsoid surface point nearest to the position component of a specified state.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dnearp_c.html

Parameters:
  • state (ndarray) – State of an object in body fixed coordinates.

  • a (float) – Length of semi axis parallel to X axis.

  • b (float) – Length of semi axis parallel to Y axis.

  • c (float) – Length on semi axis parallel to Z axis.

Return type:

Union[Tuple[ndarray, ndarray, bool], Tuple[ndarray, ndarray]]

Returns:

State of the nearest point on the ellipsoid, Altitude and derivative of altitude

spiceypy.spiceypy.dp2hx(number, lenout=256)[source]

Convert a double precision number to an equivalent character string using base 16 “scientific notation.”

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dp2hx_c.html

Parameters:
  • number (float) – D.p. number to be converted.

  • lenout (int) – Available space for output string.

Return type:

str

Returns:

Equivalent character string, left justified.

spiceypy.spiceypy.dpgrdr(body, x, y, z, re, f)[source]

This routine computes the Jacobian matrix of the transformation from rectangular to planetographic coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dpgrdr_c.html

Parameters:
  • body (str) – Body with which coordinate system is associated.

  • x (float) – X-coordinate of point.

  • y (float) – Y-coordinate of point.

  • z (int) – Z-coordinate of point.

  • re (float) – Equatorial radius of the reference spheroid.

  • f (float) – Flattening coefficient.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.dpmax()[source]

Return the value of the largest (positive) number representable in a double precision variable.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dpmax_c.html

Return type:

float

Returns:

The largest (positive) number representable in a double precision variable.

spiceypy.spiceypy.dpmin()[source]

Return the value of the smallest (negative) number representable in a double precision variable.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dpmin_c.html

Return type:

float

Returns:

The smallest (negative) number that can be represented in a double precision variable.

spiceypy.spiceypy.dpr()[source]

Return the number of degrees per radian.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dpr_c.html

Return type:

float

Returns:

The number of degrees per radian.

spiceypy.spiceypy.drdazl(range, az, el, azccw, elplsz)[source]

Compute the Jacobian matrix of the transformation from azimuth/elevation to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdazl_c.html

Parameters:
  • range (float) – Distance of a point from the origin.

  • az (float) – Azimuth of input point in radians.

  • el (float) – Elevation of input point in radians.

  • azccw (bool) – Flag indicating how azimuth is measured.

  • elplsz (bool) – Flag indicating how elevation is measured.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.drdcyl(r, lon, z)[source]

This routine computes the Jacobian of the transformation from cylindrical to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdcyl_c.html

Parameters:
  • r (float) – Distance of a point from the origin.

  • lon (float) – Angle of the point from the xz plane in radians.

  • z (float) – Height of the point above the xy plane.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.drdgeo(lon, lat, alt, re, f)[source]

This routine computes the Jacobian of the transformation from geodetic to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdgeo_c.html

Parameters:
  • lon (float) – Geodetic longitude of point (radians).

  • lat (float) – Geodetic latitude of point (radians).

  • alt (float) – Altitude of point above the reference spheroid.

  • re (float) – Equatorial radius of the reference spheroid.

  • f (float) – Flattening coefficient.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.drdlat(r, lon, lat)[source]

Compute the Jacobian of the transformation from latitudinal to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdlat_c.html

Parameters:
  • r (float) – Distance of a point from the origin.

  • lon (float) – Angle of the point from the XZ plane in radians.

  • lat (float) – Angle of the point from the XY plane in radians.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.drdpgr(body, lon, lat, alt, re, f)[source]

This routine computes the Jacobian matrix of the transformation from planetographic to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdpgr_c.html

Parameters:
  • body (str) – Body with which coordinate system is associated.

  • lon (float) – Planetographic longitude of a point (radians).

  • lat (float) – Planetographic latitude of a point (radians).

  • alt (int) – Altitude of a point above reference spheroid.

  • re (float) – Equatorial radius of the reference spheroid.

  • f (float) – Flattening coefficient.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.drdsph(r, colat, lon)[source]

This routine computes the Jacobian of the transformation from spherical to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdsph_c.html

Parameters:
  • r (float) – Distance of a point from the origin.

  • colat (float) – Angle of the point from the positive z-axis.

  • lon (float) – Angle of the point from the xy plane.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.dskb02(handle, dladsc)[source]

Return bookkeeping data from a DSK type 2 segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskb02_c.html

Parameters:
  • handle (int) – DSK file handle

  • dladsc (SpiceDLADescr) – DLA descriptor

Return type:

Tuple[int, int, int, ndarray, float, ndarray, ndarray, int, int, int, int]

Returns:

bookkeeping data from a DSK type 2 segment

spiceypy.spiceypy.dskcls(handle, optmiz=False)[source]

Close a DSK file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskcls_c.html

Parameters:
  • handle (int) – Handle assigned to the opened DSK file.

  • optmiz (bool) – Flag indicating whether to segregate the DSK.

Return type:

None

Returns:

spiceypy.spiceypy.dskd02(handle, dladsc, item, start, room)[source]

Fetch double precision data from a type 2 DSK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskd02_c.html

Parameters:
  • handle (int) – DSK file handle

  • dladsc (SpiceDLADescr) – DLA descriptor

  • item (int) – Keyword identifying item to fetch

  • start (int) – Start index

  • room (int) – Amount of room in output array

Return type:

ndarray

Returns:

Array containing requested item

spiceypy.spiceypy.dskgd(handle, dladsc)[source]

Return the DSK descriptor from a DSK segment identified by a DAS handle and DLA descriptor.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskgd_c.html

Parameters:
  • handle (int) – Handle assigned to the opened DSK file.

  • dladsc (SpiceDLADescr) – DLA segment descriptor.

Return type:

SpiceDSKDescr

Returns:

DSK segment descriptor.

spiceypy.spiceypy.dskgtl(keywrd)[source]

Retrieve the value of a specified DSK tolerance or margin parameter.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskgtl_c.html

Parameters:

keywrd (int) – Code specifying parameter to retrieve.

Return type:

float

Returns:

Value of parameter.

spiceypy.spiceypy.dski02(handle, dladsc, item, start, room)[source]

Fetch integer data from a type 2 DSK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dski02_c.html

Parameters:
  • handle (int) – DSK file handle.

  • dladsc (SpiceDLADescr) – DLA descriptor.

  • item (int) – Keyword identifying item to fetch.

  • start (int) – Start index.

  • room (int) – Amount of room in output array.

Return type:

ndarray

Returns:

Array containing requested item.

spiceypy.spiceypy.dskmi2(vrtces, plates, finscl, corscl, worksz, voxpsz, voxlsz, makvtl, spxisz)[source]

Make spatial index for a DSK type 2 segment. The index is returned as a pair of arrays, one of type int and one of type float. These arrays are suitable for use with the DSK type 2 writer dskw02.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskmi2_c.html

Parameters:
  • vrtces (ndarray) – Vertices

  • plates (ndarray) – Plates

  • finscl (float) – Fine voxel scale

  • corscl (int) – Coarse voxel scale

  • worksz (int) – Workspace size

  • voxpsz (int) – Voxel plate pointer array size

  • voxlsz (int) – Voxel plate list array size

  • makvtl (bool) – Vertex plate list flag

  • spxisz (int) – Spatial index integer component size

Return type:

Tuple[ndarray, ndarray]

Returns:

double precision and integer components of the spatial index of the segment.

spiceypy.spiceypy.dskn02(handle, dladsc, plid)[source]

Compute the unit normal vector for a specified plate from a type 2 DSK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskn02_c.html

Parameters:
  • handle (int) – DSK file handle.

  • dladsc (SpiceDLADescr) – DLA descriptor.

  • plid (int) – Plate ID.

Return type:

ndarray

Returns:

late’s unit normal vector.

spiceypy.spiceypy.dskobj(dsk)[source]

Find the set of body ID codes of all objects for which topographic data are provided in a specified DSK file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskobj_c.html

Parameters:

dsk (str) – Name of DSK file.

Return type:

SpiceCell

Returns:

Set of ID codes of objects in DSK file.

spiceypy.spiceypy.dskopn(fname, ifname, ncomch)[source]

Open a new DSK file for subsequent write operations.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskopn_c.html

Parameters:
  • fname (str) – Name of a DSK file to be opened.

  • ifname (str) – Internal file name.

  • ncomch (int) – Number of comment characters to allocate.

Return type:

int

Returns:

Handle assigned to the opened DSK file.

spiceypy.spiceypy.dskp02(handle, dladsc, start, room)[source]

Fetch triangular plates from a type 2 DSK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskp02_c.html

Parameters:
  • handle (int) – DSK file handle.

  • dladsc (SpiceDLADescr) – DLA descriptor.

  • start (int) – Start index.

  • room (int) – Amount of room in output array.

Return type:

ndarray

Returns:

Array containing plates.

spiceypy.spiceypy.dskrb2(vrtces, plates, corsys, corpar)[source]

Determine range bounds for a set of triangular plates to be stored in a type 2 DSK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskrb2_c.html

Parameters:
  • vrtces (ndarray) – Vertices

  • plates (ndarray) – Plates

  • corsys (int) – DSK coordinate system code

  • corpar (ndarray) – DSK coordinate system parameters

Return type:

Tuple[float, float]

Returns:

Lower and Upper bound on range of third coordinate

spiceypy.spiceypy.dsksrf(dsk, bodyid)[source]

Find the set of surface ID codes for all surfaces associated with a given body in a specified DSK file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dsksrf_c.html

Parameters:
  • dsk (str) – Name of DSK file.

  • bodyid (int) – Integer body ID code.

Return type:

SpiceCell

Returns:

Set of ID codes of surfaces in DSK file.

spiceypy.spiceypy.dskstl(keywrd, dpval)[source]

Set the value of a specified DSK tolerance or margin parameter.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskstl_c.html

Parameters:
  • keywrd (int) – Code specifying parameter to set.

  • dpval (float) – Value of parameter.

Return type:

None

Returns:

spiceypy.spiceypy.dskv02(handle, dladsc, start, room)[source]

Fetch vertices from a type 2 DSK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskv02_c.html

Parameters:
  • handle (int) – DSK file handle.

  • dladsc (SpiceDLADescr) – DLA descriptor.

  • start (int) – Start index.

  • room (int) – Amount of room in output array.

Return type:

ndarray

Returns:

Array containing vertices.

spiceypy.spiceypy.dskw02(handle, center, surfid, dclass, fname, corsys, corpar, mncor1, mxcor1, mncor2, mxcor2, mncor3, mxcor3, first, last, vrtces, plates, spaixd, spaixi)[source]

Write a type 2 segment to a DSK file.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskw02_c.html

Parameters:
  • handle (int) – Handle assigned to the opened DSK file

  • center (int) – Central body ID code

  • surfid (int) – Surface ID code

  • dclass (int) – Data class

  • fname (str) – Reference frame

  • corsys (int) – Coordinate system code

  • corpar (ndarray) – Coordinate system parameters

  • mncor1 (float) – Minimum value of first coordinate

  • mxcor1 (float) – Maximum value of first coordinate

  • mncor2 (float) – Minimum value of second coordinate

  • mxcor2 (float) – Maximum value of second coordinate

  • mncor3 (float) – Minimum value of third coordinate

  • mxcor3 (float) – Maximum value of third coordinate

  • first (float) – Coverage start time

  • last (float) – Coverage stop time

  • vrtces (ndarray) – Vertices

  • plates (ndarray) – Plates

  • spaixd (ndarray) – Double precision component of spatial index

  • spaixi (ndarray) – Integer component of spatial index

Return type:

None

spiceypy.spiceypy.dskx02(handle, dladsc, vertex, raydir)[source]

Determine the plate ID and body-fixed coordinates of the intersection of a specified ray with the surface defined by a type 2 DSK plate model.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskx02_c.html

Parameters:
  • handle (int) – Handle of DSK kernel containing plate model.

  • dladsc (SpiceDLADescr) – DLA descriptor of plate model segment.

  • vertex (ndarray) – Ray’s vertex in the body fixed frame.

  • raydir (ndarray) – Ray direction in the body fixed frame.

Return type:

Tuple[int, ndarray, bool]

Returns:

ID code of the plate intersected by the ray, Intercept, and Flag indicating whether intercept exists.

spiceypy.spiceypy.dskxsi(pri, target, srflst, et, fixref, vertex, raydir)[source]

Compute a ray-surface intercept using data provided by multiple loaded DSK segments. Return information about the source of the data defining the surface on which the intercept was found: DSK handle, DLA and DSK descriptors, and DSK data type-dependent parameters.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskxsi_c.html

Parameters:
  • pri (bool) – Data prioritization flag.

  • target (str) – Target body name.

  • srflst (Sequence[int]) – Surface ID list.

  • et (float) – Epoch, expressed as seconds past J2000 TDB.

  • fixref (str) – Name of target body-fixed reference frame.

  • vertex (ndarray) – Vertex of ray.

  • raydir (ndarray) – Direction vector of ray.

Return type:

Union[Tuple[ndarray, int, SpiceDLADescr, SpiceDSKDescr, ndarray, ndarray, bool], Tuple[ndarray, int, SpiceDLADescr, SpiceDSKDescr, ndarray, ndarray]]

Returns:

Intercept point, Handle of segment contributing surface data, DLADSC, DSKDSC, Double precision component of source info, Integer component of source info

spiceypy.spiceypy.dskxv(pri, target, srflst, et, fixref, vtxarr, dirarr)[source]

Compute ray-surface intercepts for a set of rays, using data provided by multiple loaded DSK segments.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskxv_c.html

Parameters:
  • pri (bool) – Data prioritization flag.

  • target (str) – Target body name.

  • srflst (Sequence[int]) – Surface ID list.

  • et (float) – Epoch, expressed as seconds past J2000 TDB.

  • fixref (str) – Name of target body-fixed reference frame.

  • vtxarr (Sequence[ndarray]) – Array of vertices of rays.

  • dirarr (Sequence[ndarray]) – Array of direction vectors of rays.

Return type:

Tuple[ndarray, ndarray]

Returns:

Intercept point array and Found flag array.

spiceypy.spiceypy.dskz02(handle, dladsc)[source]

Return plate model size parameters—plate count and vertex count—for a type 2 DSK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskz02_c.html

Parameters:
  • handle (int) – DSK file handle.

  • dladsc (SpiceDLADescr) – DLA descriptor.

Return type:

Tuple[int, int]

Returns:

Number of vertices, Number of plates.

spiceypy.spiceypy.dsphdr(x, y, z)[source]

This routine computes the Jacobian of the transformation from rectangular to spherical coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dsphdr_c.html

Parameters:
  • x (float) – X-coordinate of point.

  • y (float) – Y-coordinate of point.

  • z (float) – Z-coordinate of point.

Return type:

ndarray

Returns:

Matrix of partial derivatives.

spiceypy.spiceypy.dtpool(name)[source]

Return the data about a kernel pool variable.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dtpool_c.html

Parameters:

name (str) – Name of the variable whose value is to be returned.

Return type:

Union[Tuple[int, str, bool], Tuple[int, str]]

Returns:

Number of values returned for name, Type of the variable “C”, “N”, or “X”.

spiceypy.spiceypy.ducrss(s1, s2)[source]

Compute the unit vector parallel to the cross product of two 3-dimensional vectors and the derivative of this unit vector.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ducrss_c.html

Parameters:
  • s1 (ndarray) – Left hand state for cross product and derivative.

  • s2 (ndarray) – Right hand state for cross product and derivative.

Return type:

ndarray

Returns:

Unit vector and derivative of the cross product.

spiceypy.spiceypy.dvcrss(s1, s2)[source]

Compute the cross product of two 3-dimensional vectors and the derivative of this cross product.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dvcrss_c.html

Parameters:
  • s1 (ndarray) – Left hand state for cross product and derivative.

  • s2 (ndarray) – Right hand state for cross product and derivative.

Return type:

ndarray

Returns:

State associated with cross product of positions.

spiceypy.spiceypy.dvdot(s1, s2)[source]

Compute the derivative of the dot product of two double precision position vectors.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dvdot_c.html

Parameters:
  • s1 (Sequence[float]) – First state vector in the dot product.

  • s2 (Sequence[float]) – Second state vector in the dot product.

Return type:

float

Returns:

The derivative of the dot product.

spiceypy.spiceypy.dvhat(s1)[source]

Find the unit vector corresponding to a state vector and the derivative of the unit vector.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dvhat_c.html

Parameters:

s1 (ndarray) – State to be normalized.

Return type:

ndarray

Returns:

Unit vector s1 / abs(s1), and its time derivative.

spiceypy.spiceypy.dvnorm(state)[source]

Function to calculate the derivative of the norm of a 3-vector.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dvnorm_c.html

Parameters:

state (ndarray) – A 6-vector composed of three coordinates and their derivatives.

Return type:

float

Returns:

The derivative of the norm of a 3-vector.

spiceypy.spiceypy.dvpool(name)[source]

Delete a variable from the kernel pool.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dvpool_c.html

Parameters:

name (str) – Name of the kernel variable to be deleted.

Return type:

None

spiceypy.spiceypy.dvsep(s1, s2)[source]

Calculate the time derivative of the separation angle between two input states, S1 and S2.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dvsep_c.html

Parameters:
  • s1 (ndarray) – State vector of the first body.

  • s2 (ndarray) – State vector of the second body.

Return type:

float

Returns:

The time derivative of the angular separation between S1 and S2.

spiceypy.spiceypy.edlimb(a, b, c, viewpt)[source]

Find the limb of a triaxial ellipsoid, viewed from a specified point.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/edlimb_c.html

Parameters:
  • a (float) – Length of ellipsoid semi-axis lying on the x-axis.

  • b (float) – Length of ellipsoid semi-axis lying on the y-axis.

  • c (float) – Length of ellipsoid semi-axis lying on the z-axis.

  • viewpt (Iterable[float]) – Location of viewing point.

Return type:

Ellipse

Returns:

Limb of ellipsoid as seen from viewing point.

spiceypy.spiceypy.ednmpt(a, b, c, normal)[source]

Return the unique point on an ellipsoid’s surface where the outward normal direction is a given vector.

Parameters:
  • a (float) – Length of the ellipsoid semi-axis along the X-axis.

  • b (float) – Length of the ellipsoid semi-axis along the Y-axis.

  • c (float) – Length of the ellipsoid semi-axis along the Z-axis.

  • normal (ndarray) – Outward normal direction.

Return type:

ndarray

Returns:

Point where outward normal is parallel to `normal’.

spiceypy.spiceypy.edpnt(p, a, b, c)[source]

Scale a point so that it lies on the surface of a specified triaxial ellipsoid that is centered at the origin and aligned with the Cartesian coordinate axes.

Parameters:
  • p (ndarray) – A point in three-dimensional space.

  • a (float) – Semi-axis length in the X direction.

  • b (float) – Semi-axis length in the Y direction.

  • c (float) – Semi-axis length in the Z direction.

Return type:

ndarray

Returns:

Point on ellipsoid.

spiceypy.spiceypy.edterm(trmtyp, source, target, et, fixref, abcorr, obsrvr, npts)[source]

Compute a set of points on the umbral or penumbral terminator of a specified target body, where the target shape is modeled as an ellipsoid.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/edterm_c.html

Parameters:
  • trmtyp (str) – Terminator type.

  • source (str) – Light source.

  • target (str) – Target body.

  • et (float) – Observation epoch.

  • fixref (str) – Body-fixed frame associated with target.

  • abcorr (str) – Aberration correction.

  • obsrvr (str) – Observer.

  • npts (int) – Number of points in terminator set.

Return type:

Tuple[float, ndarray, ndarray]

Returns:

Epoch associated with target center, Position of observer in body-fixed frame, Terminator point set.

spiceypy.spiceypy.ekacec(handle, segno, recno, column, nvals, cvals, isnull)[source]

Add data to a character column in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekacec_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record to which data is to be added.

  • column (str) – Column name.

  • nvals (int) – Number of values to add to column.

  • cvals (Iterable[str]) – Character values to add to column.

  • isnull (bool) – Flag indicating whether column entry is null.

Return type:

None

spiceypy.spiceypy.ekaced(handle, segno, recno, column, nvals, dvals, isnull)[source]

Add data to an double precision column in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekaced_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record to which data is to be added.

  • column (str) – Column name.

  • nvals (int) – Number of values to add to column.

  • dvals (Union[ndarray, Iterable[float]]) – Double precision values to add to column.

  • isnull (bool) – Flag indicating whether column entry is null.

Return type:

None

spiceypy.spiceypy.ekacei(handle, segno, recno, column, nvals, ivals, isnull)[source]

Add data to an integer column in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekacei_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record to which data is to be added.

  • column (str) – Column name.

  • nvals (int) – Number of values to add to column.

  • ivals (Union[ndarray, Iterable[int]]) – Integer values to add to column.

  • isnull (bool) – Flag indicating whether column entry is null.

Return type:

None

spiceypy.spiceypy.ekaclc(handle, segno, column, vallen, cvals, entszs, nlflgs, rcptrs, wkindx)[source]

Add an entire character column to an EK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekaclc_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Number of segment to add column to.

  • column (str) – Column name.

  • vallen (int) – Length of character values.

  • cvals (Iterable[str]) – Character values to add to column.

  • entszs (Union[ndarray, Iterable[int]]) – Array of sizes of column entries.

  • nlflgs (Iterable[bool]) – Array of null flags for column entries.

  • rcptrs (ndarray) – Record pointers for segment.

  • wkindx (Union[ndarray, Iterable[int]]) – Work space for column index.

Return type:

ndarray

Returns:

Work space for column index.

spiceypy.spiceypy.ekacld(handle, segno, column, dvals, entszs, nlflgs, rcptrs, wkindx)[source]

Add an entire double precision column to an EK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekacld_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Number of segment to add column to.

  • column (str) – Column name.

  • dvals (Union[ndarray, Iterable[float]]) – Double precision values to add to column.

  • entszs (Union[ndarray, Iterable[int]]) – Array of sizes of column entries.

  • nlflgs (Iterable[bool]) – Array of null flags for column entries.

  • rcptrs (ndarray) – Record pointers for segment.

  • wkindx (Union[ndarray, Iterable[int]]) – Work space for column index.

Return type:

ndarray

Returns:

Work space for column index.

spiceypy.spiceypy.ekacli(handle, segno, column, ivals, entszs, nlflgs, rcptrs, wkindx)[source]

Add an entire integer column to an EK segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekacli_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Number of segment to add column to.

  • column (str) – Column name.

  • ivals (Union[ndarray, Iterable[int]]) – Integer values to add to column.

  • entszs (Union[ndarray, Iterable[int]]) – Array of sizes of column entries.

  • nlflgs (Iterable[bool]) – Array of null flags for column entries.

  • rcptrs (ndarray) – Record pointers for segment.

  • wkindx (Union[ndarray, Iterable[int]]) – Work space for column index.

Return type:

ndarray

Returns:

Work space for column index.

spiceypy.spiceypy.ekappr(handle, segno)[source]

Append a new, empty record at the end of a specified E-kernel segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekappr_c.html

Parameters:
  • handle (int) – File handle.

  • segno (int) – Segment number.

Return type:

int

Returns:

Number of appended record.

spiceypy.spiceypy.ekbseg(handle, tabnam, cnames, decls)[source]

Start a new segment in an E-kernel.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekbseg_c.html

Parameters:
  • handle (int) – File handle.

  • tabnam (str) – Table name.

  • cnames (Sequence[str]) – Names of columns.

  • decls (Sequence[str]) – Declarations of columns.

Return type:

int

Returns:

Segment number.

spiceypy.spiceypy.ekccnt(table)[source]

Return the number of distinct columns in a specified, currently loaded table.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekccnt_c.html

Parameters:

table (str) – Name of table.

Return type:

int

Returns:

Count of distinct, currently loaded columns.

spiceypy.spiceypy.ekcii(table, cindex, lenout=256)[source]

Return attribute information about a column belonging to a loaded EK table, specifying the column by table and index.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekcii_c.html

Parameters:
  • table (str) – Name of table containing column.

  • cindex (int) – Index of column whose attributes are to be found.

  • lenout (int) – Maximum allowed length of column name.

Return type:

Tuple[str, SpiceEKAttDsc]

Returns:

Name of column, Column attribute descriptor.

spiceypy.spiceypy.ekcls(handle)[source]

Close an E-kernel.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekcls_c.html

Parameters:

handle (int) – EK file handle.

Return type:

None

spiceypy.spiceypy.ekdelr(handle, segno, recno)[source]

Delete a specified record from a specified E-kernel segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekdelr_c.html

Parameters:
  • handle (int) – File handle.

  • segno (int) – Segment number.

  • recno (int) – Record number.

Return type:

None

spiceypy.spiceypy.ekffld(handle, segno, rcptrs)[source]

Complete a fast write operation on a new E-kernel segment.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekffld_c.html

Parameters:
  • handle (int) – File handle.

  • segno (int) – Segment number.

  • rcptrs (ndarray) – Record pointers.

Return type:

None

spiceypy.spiceypy.ekfind(query, lenout=256)[source]

Find E-kernel data that satisfy a set of constraints.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekfind_c.html

Parameters:
  • query (str) – Query specifying data to be found.

  • lenout (int) – Declared length of output error message string.

Return type:

Tuple[int, int, str]

Returns:

Number of matching rows, Flag indicating whether query parsed correctly, Parse error description.

spiceypy.spiceypy.ekgc(selidx, row, element, lenout=256)[source]

Return an element of an entry in a column of character type in a specified row.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekgc_c.html

Parameters:
  • selidx (int) – Index of parent column in SELECT clause.

  • row (int) – Row to fetch from.

  • element (int) – Index of element, within column entry, to fetch.

  • lenout (int) – Maximum length of column element.

Return type:

Union[Tuple[int, str, bool], Tuple[int, str]]

Returns:

Character string element of column entry, Flag indicating whether column entry was null.

spiceypy.spiceypy.ekgd(selidx, row, element)[source]

Return an element of an entry in a column of double precision type in a specified row.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekgd_c.html

Parameters:
  • selidx (int) – Index of parent column in SELECT clause.

  • row (int) – Row to fetch from.

  • element (int) – Index of element, within column entry, to fetch.

Return type:

Union[Tuple[float, int, bool], Tuple[float, int]]

Returns:

Double precision element of column entry, Flag indicating whether column entry was null.

spiceypy.spiceypy.ekgi(selidx, row, element)[source]

Return an element of an entry in a column of integer type in a specified row.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekgi_c.html

Parameters:
  • selidx (int) – Index of parent column in SELECT clause.

  • row (int) – Row to fetch from.

  • element (int) – Index of element, within column entry, to fetch.

Return type:

Union[Tuple[int, int, bool], Tuple[int, int]]

Returns:

Integer element of column entry, Flag indicating whether column entry was null.

spiceypy.spiceypy.ekifld(handle, tabnam, ncols, nrows, cnmlen, cnames, declen, decls)[source]

Initialize a new E-kernel segment to allow fast writing.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekifld_c.html

Parameters:
  • handle (int) – File handle.

  • tabnam (str) – Table name.

  • ncols (int) – Number of columns in the segment.

  • nrows (int) – Number of rows in the segment.

  • cnmlen (int) – Length of names in in column name array.

  • cnames (Iterable[str]) – Names of columns.

  • declen (int) – Length of declaration strings in declaration array.

  • decls (Iterable[str]) – Declarations of columns.

Return type:

Tuple[int, ndarray]

Returns:

Segment number, Array of record pointers.

spiceypy.spiceypy.ekinsr(handle, segno, recno)[source]

Add a new, empty record to a specified E-kernel segment at a specified index.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekinsr_c.html

Parameters:
  • handle (int) – File handle.

  • segno (int) – Segment number.

  • recno (int) – Record number.

Return type:

None

spiceypy.spiceypy.eklef(fname)[source]

Load an EK file, making it accessible to the EK readers.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/eklef_c.html

Parameters:

fname (str) – Name of EK file to load.

Return type:

int

Returns:

File handle of loaded EK file.

spiceypy.spiceypy.eknelt(selidx, row)[source]

Return the number of elements in a specified column entry in the current row.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/eknelt_c.html

Parameters:
  • selidx (int) – Index of parent column in SELECT clause.

  • row (int) – Row containing element.

Return type:

int

Returns:

The number of elements in entry in current row.

spiceypy.spiceypy.eknseg(handle)[source]

Return the number of segments in a specified EK.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/eknseg_c.html

Parameters:

handle (int) – EK file handle.

Return type:

int

Returns:

The number of segments in the specified E-kernel.

spiceypy.spiceypy.ekntab()[source]

Return the number of loaded EK tables.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekntab_c.html

Return type:

int

Returns:

The number of loaded EK tables.

spiceypy.spiceypy.ekopn(fname, ifname, ncomch)[source]

Open a new E-kernel file and prepare the file for writing.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekopn_c.html

Parameters:
  • fname (str) – Name of EK file.

  • ifname (str) – Internal file name.

  • ncomch (int) – The number of characters to reserve for comments.

Return type:

int

Returns:

Handle attached to new EK file.

spiceypy.spiceypy.ekopr(fname)[source]

Open an existing E-kernel file for reading.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekopr_c.html

Parameters:

fname (str) – Name of EK file.

Return type:

int

Returns:

Handle attached to EK file.

spiceypy.spiceypy.ekops()[source]

Open a scratch (temporary) E-kernel file and prepare the file for writing.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekops_c.html

Return type:

int

Returns:

Handle attached to new EK file.

spiceypy.spiceypy.ekopw(fname)[source]

Open an existing E-kernel file for writing.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekopw_c.html

Parameters:

fname (str) – Name of EK file.

Return type:

int

Returns:

Handle attached to EK file.

spiceypy.spiceypy.ekpsel(query, msglen, tablen, collen)[source]

Parse the SELECT clause of an EK query, returning full particulars concerning each selected item.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekpsel_c.html note: oddly docs at url are incomplete/incorrect.

Parameters:
  • query (str) – EK query.

  • msglen (int) – Available space in the output error message string.

  • tablen (int) – UNKNOWN? Length of Table?

  • collen (int) – UNKOWN? Length of Column?

Return type:

Tuple[int, ndarray, ndarray, ndarray, ndarray, Iterable[str], Iterable[str], int, str]

Returns:

Number of items in SELECT clause of query, Begin positions of expressions in SELECT clause, End positions of expressions in SELECT clause, Data types of expressions, Classes of expressions, Names of tables qualifying SELECT columns, Names of columns in SELECT clause of query, Error flag, Parse error message.

spiceypy.spiceypy.ekrcec(handle, segno, recno, column, lenout, nelts=100)[source]

Read data from a character column in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekrcec_c.html

Parameters:
  • handle (int) – Handle attached to EK file.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record from which data is to be read.

  • column (str) – Column name.

  • lenout (int) – Maximum length of output strings.

  • nelts (int) – Number of elements to allow for (default=100)

Return type:

Tuple[int, Iterable[str], bool]

Returns:

Number of values in column entry, Character values in column entry, Flag indicating whether column entry is null.

spiceypy.spiceypy.ekrced(handle, segno, recno, column, nelts=100)[source]

Read data from a double precision column in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekrced_c.html

Parameters:
  • handle (int) – Handle attached to EK file.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record from which data is to be read.

  • column (str) – Column name.

  • nelts (int) – room for data default 100

Return type:

Tuple[int, ndarray, bool]

Returns:

Number of values in column entry, Float values in column entry, Flag indicating whether column entry is null.

spiceypy.spiceypy.ekrcei(handle, segno, recno, column, nelts=100)[source]

Read data from an integer column in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekrcei_c.html

Parameters:
  • handle (int) – Handle attached to EK file.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record from which data is to be read.

  • column (str) – Column name.

  • nelts (int) – room for data default 100

Return type:

Tuple[int, ndarray, bool]

Returns:

Number of values in column entry, Integer values in column entry, Flag indicating whether column entry is null.

spiceypy.spiceypy.ekssum(handle, segno)[source]

Return summary information for a specified segment in a specified EK.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekssum_c.html

Parameters:
  • handle (int) – Handle of EK.

  • segno (int) – Number of segment to be summarized.

Return type:

SpiceEKSegSum

Returns:

EK segment summary.

spiceypy.spiceypy.ektnam(n, lenout=256)[source]

Return the name of a specified, loaded table.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ektnam_c.html

Parameters:
  • n (int) – Index of table.

  • lenout (int) – Maximum table name length.

Return type:

str

Returns:

Name of table.

spiceypy.spiceypy.ekucec(handle, segno, recno, column, nvals, cvals, isnull)[source]

Update a character column entry in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekucec_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record to which data is to be updated.

  • column (str) – Column name.

  • nvals (int) – Number of values in new column entry.

  • cvals (Iterable[str]) – Character values comprising new column entry.

  • isnull (bool) – Flag indicating whether column entry is null.

Return type:

None

spiceypy.spiceypy.ekuced(handle, segno, recno, column, nvals, dvals, isnull)[source]

Update a double precision column entry in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekuced_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record to which data is to be updated.

  • column (str) – Column name.

  • nvals (int) – Number of values in new column entry.

  • dvals (Union[ndarray, Iterable[float]]) – Double precision values comprising new column entry.

  • isnull (bool) – Flag indicating whether column entry is null.

Return type:

None

spiceypy.spiceypy.ekucei(handle, segno, recno, column, nvals, ivals, isnull)[source]

Update an integer column entry in a specified EK record.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekucei_c.html

Parameters:
  • handle (int) – EK file handle.

  • segno (int) – Index of segment containing record.

  • recno (int) – Record to which data is to be updated.

  • column (str) – Column name.

  • nvals (int) – Number of values in new column entry.

  • ivals (Union[ndarray, Iterable[int]]) – Integer values comprising new column entry.

  • isnull (bool) – Flag indicating whether column entry is null.

Return type:

None

spiceypy.spiceypy.ekuef(handle)[source]

Unload an EK file, making its contents inaccessible to the EK reader routines, and clearing space in order to allow other EK files to be loaded.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekuef_c.html

Parameters:

handle (int) – Handle of EK file.

Return type:

None

spiceypy.spiceypy.el2cgv(ellipse)[source]

Convert an ellipse to a center vector and two generating vectors. The selected generating vectors are semi-axes of the ellipse.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/el2cgv_c.html

Parameters:

ellipse (Ellipse) – An Ellipse

Return type:

Tuple[ndarray, ndarray, ndarray]

Returns:

Center and semi-axes of ellipse.

spiceypy.spiceypy.elemc(item, inset)[source]

Determine whether an item is an element of a character set.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/elemc_c.html

Parameters:
  • item (str) – Item to be tested.

  • inset (SpiceCell) – Set to be tested.

Return type:

bool

Returns:

True if item is an element of set.

spiceypy.spiceypy.elemd(item, inset)[source]

Determine whether an item is an element of a double precision set.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/elemd_c.html

Parameters:
  • item (float) – Item to be tested.

  • inset (SpiceCell) – Set to be tested.

Return type:

bool

Returns:

True if item is an element of set.

spiceypy.spiceypy.elemi(item, inset)[source]

Determine whether an item is an element of an integer set.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/elemi_c.html

Parameters:
  • item (int) – Item to be tested.

  • inset (SpiceCell) – Set to be tested.

Return type:

bool

Returns:

True if item is an element of set.

spiceypy.spiceypy.eqncpv(et, epoch, eqel, rapol, decpol)[source]

Compute the state (position and velocity of an object whose trajectory is described via equinoctial elements relative to some fixed plane (usually the equatorial plane of some planet).

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/eqncpv_c.html

Parameters:
  • et (float) – Epoch in seconds past J2000 to find state.

  • epoch (float) – Epoch of elements in seconds past J2000.

  • eqel (Iterable[float]) – Array of equinoctial elements

  • rapol (float) – Right Ascension of the pole of the reference plane.

  • decpol (float) – Declination of the pole of the reference plane.

Return type:

ndarray

Returns:

State of the object described by eqel.

spiceypy.spiceypy.eqstr(a, b)[source]

Determine whether two strings are equivalent.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/eqstr_c.html

Parameters:
  • a (str) – Arbitrary character string.

  • b (str) – Arbitrary character string.

Return type:

bool

Returns:

True if A and B are equivalent.

spiceypy.spiceypy.erract(op, lenout, action=None)[source]

Retrieve or set the default error action. spiceypy sets the default error action to “report” on init.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/erract_c.html

Parameters:
  • op (str) – peration, “GET” or “SET”.

  • lenout (int) – Length of list for output.

  • action (Optional[str]) – Error response action.

Return type:

str

Returns:

Error response action.

spiceypy.spiceypy.errch(marker, string)[source]

Substitute a character string for the first occurrence of a marker in the current long error message.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/errch_c.html

Parameters:
  • marker (str) – A substring of the error message to be replaced.

  • string (str) – The character string to substitute for marker.

Return type:

None

spiceypy.spiceypy.errdev(op, lenout, device)[source]

Retrieve or set the name of the current output device for error messages.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/errdev_c.html

Parameters:
  • op (str) – The operation, “GET” or “SET”.

  • lenout (int) – Length of device for output.

  • device (str) – The device name.

Return type:

str

Returns:

The device name.

spiceypy.spiceypy.errdp(marker, number)[source]

Substitute a double precision number for the first occurrence of a marker found in the current long error message.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/errdp_c.html

Parameters:
  • marker (str) – A substring of the error message to be replaced.

  • number (float) – The d.p. number to substitute for marker.

Return type:

None

spiceypy.spiceypy.errint(marker, number)[source]

Substitute an integer for the first occurrence of a marker found in the current long error message.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/errint_c.html

Parameters:
  • marker (str) – A substring of the error message to be replaced.

  • number (int) – The integer to substitute for marker.

Return type:

None

spiceypy.spiceypy.errprt(op, lenout, inlist)[source]

Retrieve or set the list of error message items to be output when an error is detected.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/errprt_c.html

Parameters:
  • op (str) – The operation, “GET” or “SET”.

  • lenout (int) – Length of list for output.

  • inlist (str) – Specification of error messages to be output.

Return type:

str

Returns:

A list of error message items.

spiceypy.spiceypy.esrchc(value, array)[source]

Search for a given value within a character string array. Return the index of the first equivalent array entry, or -1 if no equivalent element is found.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/esrchc_c.html

Parameters:
  • value (str) – Key value to be found in array.

  • array (Sequence[str]) – Character string array to search.

Return type:

int

Returns:

The index of the first array entry equivalent to value, or -1 if none is found.

spiceypy.spiceypy.et2datetime(et)[source]

Convert an input time from ephemeris seconds past J2000 to a standard Python datetime.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/time.html#The%20J2000%20Epoch

Parameters:

et (Union[Iterable[float], float]) – Input epoch, given in ephemeris seconds past J2000.

Return type:

Union[ndarray, datetime]

Returns:

Output datetime object in UTC

spiceypy.spiceypy.et2lst(et, body, lon, typein, timlen=256, ampmlen=256)[source]

Given an ephemeris epoch, compute the local solar time for an object on the surface of a body at a specified longitude.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/et2lst_c.html

Parameters:
  • et (float) – Epoch in seconds past J2000 epoch.

  • body (int) – ID-code of the body of interest.

  • lon (float) – Longitude of surface point (RADIANS).

  • typein (str) – Type of longitude “PLANETOCENTRIC”, etc.

  • timlen (int) – Available room in output time string.

  • ampmlen (int) – Available room in output ampm string.

Return type:

Tuple[int, int, int, str, str]

Returns:

Local hour on a “24 hour” clock, Minutes past the hour, Seconds past the minute, String giving local time on 24 hour clock, String giving time on A.M. / P.M. scale.

spiceypy.spiceypy.et2utc(et, format_str, prec, lenout=256)[source]

Convert an input time from ephemeris seconds past J2000 to Calendar, Day-of-Year, or Julian Date format, UTC.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/et2utc_c.html

Parameters:
  • et (Union[float, Iterable[float]]) – Input epoch, given in ephemeris seconds past J2000.

  • format_str (str) – Format of output epoch.

  • prec (int) – Digits of precision in fractional seconds or days.

  • lenout (int) – The length of the output string plus 1.

Return type:

Union[ndarray, str]

Returns:

Output time string in UTC

spiceypy.spiceypy.etcal(et, lenout=256)[source]

Convert from an ephemeris epoch measured in seconds past the epoch of J2000 to a calendar string format using a formal calendar free of leapseconds.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/etcal_c.html

Parameters:
  • et (Union[float, ndarray]) – Ephemeris time measured in seconds past J2000.

  • lenout (int) – Length of output string.

Return type:

Union[str, Iterable[str]]

Returns:

A standard calendar representation of et.

spiceypy.spiceypy.eul2m(angle3, angle2, angle1, axis3, axis2, axis1)[source]

Construct a rotation matrix from a set of Euler angles.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/eul2m_c.html

Parameters:
  • angle3 (float) – Rotation angle about third rotation axis (radians).

  • angle2 (float) – Rotation angle about second rotation axis (radians).

  • angle1 (float) – Rotation angle about first rotation axis (radians).

  • axis3 (int) – Axis number of third rotation axis.

  • axis2 (int) – Axis number of second rotation axis.

  • axis1 (int) – Axis number of first rotation axis.]

Return type:

ndarray

Returns:

Product of the 3 rotations.

spiceypy.spiceypy.eul2xf(eulang, axisa, axisb, axisc)[source]

This routine computes a state transformation from an Euler angle factorization of a rotation and the derivatives of those Euler angles.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/eul2xf_c.html

Parameters:
  • eulang (Sequence[float]) – An array of Euler angles and their derivatives.

  • axisa (int) – Axis A of the Euler angle factorization.

  • axisb (int) – Axis B of the Euler angle factorization.

  • axisc (int) – Axis C of the Euler angle factorization.

Return type:

ndarray

Returns:

A state transformation matrix.

spiceypy.spiceypy.ev2lin(et, geophs, elems)[source]

This routine evaluates NORAD two-line element data for near-earth orbiting spacecraft (that is spacecraft with orbital periods less than 225 minutes).

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/spicelib/ev2lin.html

Parameters:
  • et (float) – Epoch in seconds past ephemeris epoch J2000.

  • geophs (Sequence[float]) – Geophysical constants

  • elems (Sequence[float]) – Two-line element data

Return type:

ndarray

Returns:

Evaluated state

spiceypy.spiceypy.evsgp4(et, geophs, elems)[source]

Evaluate NORAD two-line element data for earth orbiting spacecraft. This evaluator uses algorithms as described in Vallado 2006

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/evsgp4_c.html

Parameters:
  • et (float) – Epoch in seconds past ephemeris epoch J2000.

  • geophs (Sequence[float]) – Geophysical constants

  • elems (Sequence[float]) – Two-line element data

Return type:

ndarray

Returns:

Evaluated state

spiceypy.spiceypy.exists(fname)[source]

Determine whether a file exists.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/exists_c.html

Parameters:

fname (str) – Name of the file in question.

Return type:

bool

Returns:

True if the file exists, False otherwise.

spiceypy.spiceypy.expool(name)[source]

Confirm the existence of a kernel variable in the kernel pool.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/expool_c.html

Parameters:

name (str) – Name of the variable whose value is to be returned.

Return type:

bool

Returns:

True when the variable is in the pool.

spiceypy.spiceypy.failed()[source]

True if an error condition has been signalled via sigerr_c.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/failed_c.html

Return type:

bool

Returns:

a boolean

spiceypy.spiceypy.fn2lun(fname)[source]

Map the name of an open file to its associated FORTRAN (F2C) logical unit.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/spicelib/fn2lun.html

Parameters:

fname (str) – name of the file to be mapped to its logical unit.

Return type:

int

Returns:

the FORTRAN (F2C) logical unit associated with the filename.

spiceypy.spiceypy.found_check()[source]

Temporarily enables spiceypy default behavior which raises exceptions for false found flags for certain spice functions. All spice functions executed within the context manager will check the found flag return parameter and the found flag will be removed from the return for the given function. For Example bodc2n in spiceypy is normally called like:

name = spice.bodc2n(399)

With the possibility that an exception is thrown in the even of a invalid ID:

name = spice.bodc2n(-999991) # throws a SpiceyError

With this function however, we can use it as a context manager to do this:

with spice.found_check():
    found = spice.bodc2n(-999991) # will raise an exception!

Within the context any spice functions called that normally check the found flags will pass through the check without raising an exception if they are false.

Return type:

Iterator[None]

spiceypy.spiceypy.found_check_off()[source]

Method that turns off found catching

Return type:

None

spiceypy.spiceypy.found_check_on()[source]

Method that turns on found catching

Return type:

None

spiceypy.spiceypy.fovray(inst, raydir, rframe, abcorr, observer, et)[source]

Determine if a specified ray is within the field-of-view (FOV) of a specified instrument at a given time.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/fovray_c.html

Parameters:
  • inst (str) – Name or ID code string of the instrument.

  • raydir (Union[ndarray, Iterable[float]]) – Ray’s direction vector.

  • rframe (str) – Body-fixed, body-centered frame for target body.

  • abcorr (str) – Aberration correction flag.

  • observer (str) – Name or ID code string of the observer.

  • et (float) – Time of the observation (seconds past J2000).

Return type:

bool

Returns:

Visibility flag

spiceypy.spiceypy.fovtrg(inst, target, tshape, tframe, abcorr, observer, et)[source]

Determine if a specified ephemeris object is within the field-of-view (FOV) of a specified instrument at a given time.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/fovtrg_c.html

Parameters:
  • inst (str) – Name or ID code string of the instrument.

  • target (str) – Name or ID code string of the target.

  • tshape (str) – Type of shape model used for the target.

  • tframe (str) – Body-fixed, body-centered frame for target body.

  • abcorr (str) – Aberration correction flag.

  • observer (str) – Name or ID code string of the observer.

  • et (float) – Time of the observation (seconds past J2000).

Return type:

bool

Returns:

Visibility flag

spiceypy.spiceypy.frame(x)[source]

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/frame_c.html

Parameters:

x (Union[ndarray, Iterable[float]]) – Input vector. A parallel unit vector on output.

Return type:

Tuple[ndarray, ndarray, ndarray]

Returns:

a tuple of 3 list[3]

spiceypy.spiceypy.frinfo(frcode)[source]

Retrieve the minimal attributes associated with a frame needed for converting transformations to and from it.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/frinfo_c.html

Parameters:

frcode (int) – the idcode for some frame.

Return type:

Union[Tuple[int, int, int, bool], Tuple[int, int, int]]

Returns:

a tuple of attributes associated with the frame.

spiceypy.spiceypy.frmnam(frcode, lenout=256)[source]

Retrieve the name of a reference frame associated with a SPICE ID code.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/frmnam_c.html

Parameters:
  • frcode (int) – an integer code for a reference frame

  • lenout (int) – Maximum length of output string.

Return type:

str

Returns:

the name associated with the reference frame.

spiceypy.spiceypy.fromisoformat(s)[source]
spiceypy.spiceypy.ftncls(unit)[source]

Close a file designated by a Fortran-style integer logical unit.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ftncls_c.html

Parameters:

unit (int) – Fortran-style logical unit.

Return type:

None

spiceypy.spiceypy.furnsh(path)[source]

Load one or more SPICE kernels into a program.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/furnsh_c.html

Parameters:

path (Union[str, Iterable[str]]) – one or more paths to kernels

Return type:

None

spiceypy.spiceypy.gcpool(name, start, room, lenout=256)[source]

Return the character value of a kernel variable from the kernel pool.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gcpool_c.html

Parameters:
  • name (str) – Name of the variable whose value is to be returned.

  • start (int) – Which component to start retrieving for name.

  • room (int) – The largest number of values to return.

  • lenout (int) – The length of the output string.

Return type:

Union[Tuple[Iterable[str], bool], Iterable[str]]

Returns:

Values associated with name.

spiceypy.spiceypy.gdpool(name, start, room)[source]

Return the d.p. value of a kernel variable from the kernel pool.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gdpool_c.html

Parameters:
  • name (str) – Name of the variable whose value is to be returned.

  • start (int) – Which component to start retrieving for name.

  • room (int) – The largest number of values to return.

Return type:

Union[Tuple[ndarray, bool], ndarray]

Returns:

Values associated with name.

spiceypy.spiceypy.georec(lon, lat, alt, re, f)[source]

Convert geodetic coordinates to rectangular coordinates.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/georec_c.html

Parameters:
  • lon (float) – Geodetic longitude of point (radians).

  • lat (float) – Geodetic latitude of point (radians).

  • alt (float) – Altitude of point above the reference spheroid.

  • re (float) – Equatorial radius of the reference spheroid.

  • f (float) – Flattening coefficient.

Return type:

ndarray

Returns:

Rectangular coordinates of point.

spiceypy.spiceypy.get_found_catch_state()[source]

Returns the current found catch state

Return type:

bool

Returns:

spiceypy.spiceypy.getelm(frstyr, lineln, lines)[source]

Given a the “lines” of a two-line element set, parse the lines and return the elements in units suitable for use in SPICE software.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getelm_c.html

Parameters:
  • frstyr (int) – Year of earliest representable two-line elements.

  • lineln (int) – Length of strings in lines array.

  • lines (Iterable[str]) – A pair of “lines” containing two-line elements.

Return type:

Tuple[float, ndarray]

Returns:

The epoch of the elements in seconds past J2000, The elements converted to SPICE units.

spiceypy.spiceypy.getfat(file)[source]

Determine the file architecture and file type of most SPICE kernel files.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getfat_c.html

Parameters:

file (str) – The name of a file to be examined.

Return type:

Tuple[str, str]

Returns:

The architecture of the kernel file, The type of the kernel file.

spiceypy.spiceypy.getfov(instid, room, shapelen=256, framelen=256)[source]

This routine returns the field-of-view (FOV) parameters for a specified instrument.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getfov_c.html

Parameters:
  • instid (int) – NAIF ID of an instrument.

  • room (int) – Maximum number of vectors that can be returned.

  • shapelen (int) – Space available in the string shape.

  • framelen (int) – Space available in the string frame.

Return type:

Tuple[str, str, ndarray, int, ndarray]

Returns:

Instrument FOV shape, Name of the frame in which FOV vectors are defined, Boresight vector, Number of boundary vectors returned, FOV boundary vectors.

spiceypy.spiceypy.getfvn(inst, room, shapelen=256, framelen=256)[source]

Return the field-of-view (FOV) parameters for a specified instrument. The instrument is specified by name.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getfvn_c.html

Parameters:
  • inst (str) – Name of an instrument.

  • room (int) – Maximum number of vectors that can be returned.

  • shapelen (int) – Space available in the string shape.

  • framelen (int) – Space available in the string frame.

Return type:

Tuple[str, str, ndarray, int, ndarray]

Returns:

Instrument FOV shape, Name of the frame in which FOV vectors are defined, Boresight vector, Number of boundary vectors returned, FOV boundary vectors.

spiceypy.spiceypy.getmsg(option, lenout=256)[source]

Retrieve the current short error message, the explanation of the short error message, or the long error message.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getmsg_c.html

Parameters:
  • option (str) – Indicates type of error message.

  • lenout (int) – Available space in the output string msg.

Return type:

str

Returns:

The error message to be retrieved.

spiceypy.spiceypy.gfbail()[source]

Indicate whether an interrupt signal (SIGINT) has been received.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfbail_c.html

Return type:

bool

Returns:

True if an interrupt signal has been received by the GF handler.

spiceypy.spiceypy.gfclrh()[source]

Clear the interrupt signal handler status, so that future calls to gfbail() will indicate no interrupt was received.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfclrh_c.html

Return type:

None

spiceypy.spiceypy.gfdist(target, abcorr, obsrvr, relate, refval, adjust, step, nintvls, cnfine, result=None)[source]

Return the time window over which a specified constraint on observer-target distance is met.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfdist_c.html

Parameters:
  • target (str) – Name of the target body.

  • abcorr (str) – Aberration correction flag.

  • obsrvr (str) – Name of the observing body.

  • relate (str) – Relational operator.

  • refval (int) – Reference value.

  • adjust (float) – Adjustment value for absolute extrema searches.

  • step (float) – Step size used for locating extrema and roots.

  • nintvls (int) – Workspace window interval count.

  • cnfine (SpiceCell) – SPICE window to which the search is confined.

  • result (Optional[SpiceCell]) – Optional SPICE window containing results.

Return type:

SpiceCell

spiceypy.spiceypy.gfevnt(udstep, udrefn, gquant, qnpars, lenvals, qpnams, qcpars, qdpars, qipars, qlpars, op, refval, tol, adjust, rpt, udrepi, udrepu, udrepf, nintvls, bail, udbail, cnfine, result=None)[source]

Determine time intervals when a specified geometric quantity satisfies a specified mathematical condition.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfevnt_c.html

Parameters:
  • udstep (CFunctionType) – Name of the routine that computes and returns a

  • udrefn (CFunctionType) – Name of the routine that computes a refined time

  • gquant (str) – Type of geometric quantity

  • qnpars (int) – Number of quantity definition parameters

  • lenvals (int) – Length of strings in qpnams and qcpars

  • qpnams (Iterable[str]) – Names of quantity definition parameters

  • qcpars (Iterable[str]) – Array of character quantity definition parameters

  • qdpars (Union[ndarray, Iterable[float]]) – Array of double precision quantity definition

  • qipars (Union[ndarray, Iterable[int]]) – Array of integer quantity definition parameters

  • qlpars (Union[ndarray, Iterable[int]]) – Array of logical quantity definition parameters

  • op (str) – Operator that either looks for an extreme value

  • refval (float) – Reference value

  • tol (float) – Convergence tolerance in seconds

  • adjust (float) – Absolute extremum adjustment value

  • rpt (int) – Progress reporter on TRUE or off FALSE

  • udrepi (CFunctionType) – Function that initializes progress reporting

  • udrepu (CFunctionType) – Function that updates the progress report

  • udrepf (CFunctionType) – Function that finalizes progress reporting

  • nintvls (int) – Workspace window interval count

  • bail (int) – Logical indicating program interrupt monitoring

  • udbail (CFunctionType) – Name of a routine that signals a program interrupt

  • cnfine (SpiceCell) – SPICE window to which the search is restricted

  • result (Optional[SpiceCell]) – Optional SPICE window containing results

spiceypy.spiceypy.gffove(inst, tshape, raydir, target, tframe, abcorr, obsrvr, tol, udstep, udrefn, rpt, udrepi, udrepu, udrepf, bail, udbail, cnfine, result=None)[source]

Determine time intervals when a specified target body or ray intersects the space bounded by the field-of-view (FOV) of a specified instrument. Report progress and handle interrupts if so commanded.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gffove_c.html

Parameters:
  • inst (str) – Name of the instrument

  • tshape (str) – Type of shape model used for target body

  • raydir (Union[ndarray, Iterable[float]]) – Ray s direction vector

  • target (str) – Name of the target body

  • tframe (str) – Body fixed body centered frame for target body

  • abcorr (str) – Aberration correction flag

  • obsrvr (str) – Name of the observing body

  • tol (float) – Convergence tolerance in seconds

  • udstep (CFunctionType) – Name of the routine that returns a time step

  • udrefn (CFunctionType) – Name of the routine that computes a refined time

  • rpt (int) – Progress report flag

  • udrepi (CFunctionType) – Function that initializes progress reporting.

  • udrepu (CFunctionType) – Function that updates the progress report

  • udrepf (CFunctionType) – Function that finalizes progress reporting

  • bail (int) – Logical indicating program interrupt monitoring

  • udbail (CFunctionType) – Name of a routine that signals a program interrupt

  • cnfine (SpiceCell) – SPICE window to which the search is restricted

  • result (Optional[SpiceCell]) – Optional SPICE window containing results

spiceypy.spiceypy.gfilum(method, angtyp, target, illumn, fixref, abcorr, obsrvr, spoint, relate, refval, adjust, step, nintvls, cnfine, result=None)[source]

Return the time window over which a specified constraint on the observed phase, solar incidence, or emission angle at a specifed target body surface point is met.

Parameters:
  • method (str) – Shape model used to represent the surface of the target body.

  • angtyp (str) – The type of illumination angle for which a search is to be performed.

  • target (str) – Name of a target body.

  • illumn (str) – Name of the illumination source.

  • fixref (str) – Name of the body-fixed, body-centered reference frame associated with the target body.

  • abcorr (str) – The aberration corrections to be applied.

  • obsrvr (str) – Name of an observing body.

  • spoint (Union[ndarray, Iterable[float]]) – Body-fixed coordinates of a target surface point.

  • relate (str) – Relational operator used to define a constraint on a specified illumination angle.

  • refval (float) – Reference value used with ‘relate’ to define an equality or inequality to be satisfied by the specified illumination angle.

  • adjust (float) – Parameter used to modify searches for absolute extrema.

  • step (float) – Step size to be used in the search.

  • nintvls (int) – Number of intervals that can be accommodated by each of the dynamically allocated workspace windows used internally by this routine.

  • cnfine (SpiceCell) – Window that confines the time period over which the specified search is conducted. This can be updated by gfilum

  • result (Optional[SpiceCell]) – Optional SPICE Window of intervals in the confinement window that the illumination angle constraint is satisfied.

Return type:

SpiceCell

spiceypy.spiceypy.gfinth(sigcode)[source]

Respond to the interrupt signal SIGINT: save an indication that the signal has been received. This routine restores itself as the handler for SIGINT.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfinth_c.html

Parameters:

sigcode (int) – Interrupt signal ID code.

Return type:

None

spiceypy.spiceypy.gfocce(occtyp, front, fshape, fframe, back, bshape, bframe, abcorr, obsrvr, tol, udstep, udrefn, rpt, udrepi, udrepu, udrepf, bail, udbail, cnfine, result=None)[source]

Determine time intervals when an observer sees one target occulted by another. Report progress and handle interrupts if so commanded.

The surfaces of the target bodies may be represented by triaxial ellipsoids or by topographic data provided by DSK files.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfocce_c.html

Parameters:
  • occtyp (str) – Type of occultation

  • front (str) – Name of body occulting the other

  • fshape (str) – Type of shape model used for front body

  • fframe (str) – Body fixed body centered frame for front body

  • back (str) – Name of body occulted by the other

  • bshape (str) – Type of shape model used for back body

  • bframe (str) – Body fixed body centered frame for back body

  • abcorr (str) – Aberration correction flag

  • obsrvr (str) – Name of the observing body

  • tol (float) – Convergence tolerance in seconds

  • udstep (CFunctionType) – Name of the routine that returns a time step

  • udrefn (CFunctionType) – Name of the routine that computes a refined time

  • rpt (int) – Progress report flag

  • udrepi (CFunctionType) – Function that initializes progress reporting.

  • udrepu (CFunctionType) – Function that updates the progress report

  • udrepf (CFunctionType) – Function that finalizes progress reporting

  • bail (int) – Logical indicating program interrupt monitoring

  • udbail (CFunctionType) – Name of a routine that signals a program interrupt

  • cnfine (SpiceCell) – SPICE window to which the search is restricted

  • result (Optional[SpiceCell]) – Optional SPICE window containing results.

spiceypy.spiceypy.gfoclt(occtyp, front, fshape, fframe, back, bshape, bframe, abcorr, obsrvr, step, cnfine, result=None)[source]

Determine time intervals when an observer sees one target occulted by, or in transit across, another.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfoclt_c.html

Parameters:
  • occtyp (str) – Type of occultation.

  • front (str) – Name of body occulting the other.

  • fshape (str) – Type of shape model used for front body.

  • fframe (str) – Body-fixed, body-centered frame for front body.

  • back (str) – Name of body occulted by the other.

  • bshape (str) – Type of shape model used for back body.

  • bframe (str) – Body-fixed, body-centered frame for back body.

  • abcorr (str) – Aberration correction flag.

  • obsrvr (str) – Name of the observing body.

  • step (float) – Step size in seconds for finding occultation events.

  • cnfine (SpiceCell) – SPICE window to which the search is restricted.

  • result (Optional[SpiceCell]) – Optional SPICE window containing results.

Return type:

SpiceCell

spiceypy.spiceypy.gfpa(target, illmin, abcorr, obsrvr, relate, refval, adjust, step, nintvls, cnfine, result=None)[source]

Determine time intervals for which a specified constraint on the phase angle between an illumination source, a target, and observer body centers is met.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfpa_c.html

Parameters:
  • target (str) – Name of the target body.

  • illmin (str) – Name of the illuminating body.

  • abcorr (str) – Aberration correction flag.

  • obsrvr (str) – Name of the observing body.

  • relate (str) – Relational operator.

  • refval (float) – Reference value.

  • adjust (float) – Adjustment value for absolute extrema searches.

  • step (float) – Step size used for locating extrema and roots.

  • nintvls (int) – Workspace window interval count.

  • cnfine (SpiceCell) – SPICE window to which the search is restricted.

  • result (Optional[SpiceCell]) – Optional SPICE window containing results.

Return type:

SpiceCell

spiceypy.spiceypy.gfposc(target, inframe, abcorr, obsrvr, crdsys, coord, relate, refval, adjust, step, nintvls, cnfine, result=None)[source]

Determine time intervals for which a coordinate of an observer-target position vector satisfies a numerical constraint.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfposc_c.html

Parameters:
  • target (str) – Name of the target body.

  • inframe (str) – Name of the reference frame for coordinate calculations.

  • abcorr (str) – Aberration correction flag.

  • obsrvr (str) – Name of the observing body.

  • crdsys (str) – Name of the coordinate system containing COORD

  • coord (str) – Name of the coordinate of interest

  • relate (str) – Relational operator.

  • refval (float) – Reference value.

  • adjust (float) – Adjustment value for absolute extrema searches.

  • step (float) – Step size used for locating extrema and roots.

  • nintvls (int) – Workspace window interval count.

  • cnfine (SpiceCell) – SPICE window to which the search is restricted.

  • result (Optional[SpiceCell]) – Optional SPICE window containing results.

Return type:

SpiceCell

spiceypy.spiceypy.gfrefn(t1, t2, s1, s2)[source]

For those times when we can’t do better, we use a bisection method to find the next time at which to test for state change.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrefn_c.html

Parameters:
  • t1 (float) – One of two values bracketing a state change.

  • t2 (float) – The other value that brackets a state change.

  • s1 (Union[bool, int]) – State at t1.

  • s2 (Union[bool, int]) – State at t2.

Return type:

float

Returns:

New value at which to check for transition.

spiceypy.spiceypy.gfrepf()[source]

Finish a GF progress report.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrepf_c.html

Return type:

None

spiceypy.spiceypy.gfrepi(window, begmss, endmss)[source]

This entry point initializes a search progress report.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrepi_c.html

Parameters:
  • window (Union[SpiceCell, LP_SpiceCell]) – A window over which a job is to be performed.

  • begmss (str) – Beginning of the text portion of the output message.

  • endmss (str) – End of the text portion of the output message.

Return type:

None

spiceypy.spiceypy.gfrepu(ivbeg, ivend, time)[source]

This function tells the progress reporting system how far a search has progressed.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrepu_c.html

Parameters:
  • ivbeg (float) – Start time of work interval.

  • ivend (float) – End time of work interval.

  • time (float) – Current time being examined in the search process.

Return type:

None

spiceypy.spiceypy.gfrfov(inst, raydir, rframe, abcorr, obsrvr, step, cnfine, result=None)[source]

Determine time intervals when a specified ray intersects the space bounded by the field-of-view (FOV) of a specified instrument.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrfov_c.html

Parameters:
  • inst (str) – Name of the instrument.

  • raydir (ndarray) – Ray’s direction vector.

  • rframe (str) – Reference frame of ray’s direction vector.

  • abcorr (str) – Aberration correction flag.

  • obsrvr (str) – Name of the observing body.

  • step (float) – Step size in seconds for finding FOV events.

  • cnfine (SpiceCell) – SPICE window to which the search is restricted.

  • result (Optional[SpiceCell]) – Optional SPICE window containing results.

Return type:

SpiceCell

spiceypy.spiceypy.gfrr(target, abcorr, obsrvr, relate, refval, adjust, step, nintvls, cnfine, result)[source]

Determine time intervals for which a specified constraint on the observer-target range rate is met.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfrr_c.html

Parameters:
  • target (str) – Name of the target body.

  • abcorr (str) – Aberration correction flag.

  • obsrvr (str) – Name of the observing body.

  • relate (str) – Relational operator.

  • refval (float) – Reference value.

  • adjust (float) – Adjustment value for absolute extrema searches.

  • step (float) – Step size used for locating extrema and roots.

  • nintvls (int) – Workspace window interval count.

  • cnfine (SpiceCell) – SPICE window to which the search is restricted.

  • result (SpiceCell) – Optional SPICE window containing results.

Return type:

SpiceCell

spiceypy.spiceypy.gfsep(targ1, shape1, inframe1, targ2, shape2, inframe2, abcorr, obsrvr, relate, refval, adjust, step, nintvls, cnfine, result=None)[source]

Determine time intervals when the angular separation between the position vectors of two target bodies relative to an observer satisfies a numerical relationship.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfsep_c.html

Parameters:
  • targ1 (str) – Name of first body.

  • shape1 (str) – Name of shape model describing the first body.

  • inframe1 (str) – The body-fixed reference frame of the first body.

  • targ2 (str) – Name of second body.

  • shape2 (str) – Name of the shape model describing the second body.

  • inframe2 (str) – The body-fixed reference frame of the second body

  • abcorr (str) – Aberration correction flag

  • obsrvr (str) – Name of the observing body.

  • relate (str) – Relational operator.

  • refval (float) – Reference value.

  • adjust (float) – Absolute extremum adjustment value.

  • step (float) – Step size in seconds for finding angular separation events.

  • nintvls (int) – Workspace window interval count.

  • cnfine (SpiceCell) – SPICE window to which the search is restricted.

  • result (Optional[SpiceCell]) – Optional SPICE window containing results.

Return type:

SpiceCell

spiceypy.spiceypy.gfsntc(target, fixref, method, abcorr, obsrvr, dref, dvec, crdsys, coord, relate, refval, adjust, step, nintvls, cnfine, result=None)[source]

Determine time intervals for which a coordinate of an surface intercept position vector satisfies a numerical constraint.

https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfsntc_c.html

Parameters:
  • target (str) – Name of the target body.

  • fixref (str) – Body fixed frame associated with the target.

  • method (str) – Name of method type for surface intercept calculation.

  • abcorr (str) – Aberration correction flag

  • obsrvr (str) – Name of the observing body.

  • dref (str) – Reference frame of direction vector of dvec.

  • dvec (Union[ndarray, Iterable[float]]) – Pointing direction vector from the observer.

  • crdsys (str) – Name of the coordinate system containing COORD.

  • coord (str) – Name of the coordinate of interest

  • relate (str) – Relational operator.

  • refval (float) – Reference value.

  • adjust (float) – Absolute extremum adjustment value.

  • step (float) – Step size in seconds for finding angular separation events.

  • nintvls (int) – Workspace window interval count.

  • cnfine (SpiceCell) – SPICE window to which the search is restricted.

  • result (Optional[SpiceCell]) – Optional SPICE window containing results.

Return type:

SpiceCell

spiceypy.spiceypy.gfsstp(step)[source]

Set the step size to be returned by