Supplementary Data — Supplementary Data Mix-ins

Modules for accessing supplementary data when computing exterior orientation.

New in version 0.1.0.

class ale.base.data_naif.NaifSpice

Bases: object

Mix-in for reading data from NAIF SPICE Kernels.

property correct_lt_to_surface

Returns if light time correction should be made to the surface instead of to the center of the body. This is defined by a keyword in ISIS IAKs. If the keyword is not defined in any loaded kernels then False is returned.

Expects ikid to be defined. This should be an integer containing the Naif Id code of the instrument.

property detector_center_line

Returns the center detector line. Expects ikid to be defined. This should be an integer containing the Naif Id code of the instrument.

Returns

: float

Detector line of the principal point

property detector_center_sample

Returns the center detector sample. Expects ikid to be defined. This should be an integer containing the Naif Id code of the instrument.

Returns

: float

Detector sample of the principal point

property ephemeris_start_time

Returns the starting ephemeris time of the image. Expects spacecraft_id to be defined. This must be the integer Naif Id code for the spacecraft. Expects spacecraft_clock_start_count to be defined. This must be a string containing the start clock count of the spacecraft

Returns

: double

Starting ephemeris time of the image

property ephemeris_stop_time

Returns the ephemeris stop time of the image. Expects spacecraft_id to be defined. This must be the integer Naif Id code for the spacecraft. Expects spacecraft_clock_stop_count to be defined. This must be a string containing the stop clock count of the spacecraft

Returns

: double

Ephemeris stop time of the image

property focal2pixel_lines

Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list<double>

focal plane to detector lines

property focal2pixel_samples

Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list<double>

focal plane to detector samples

property focal_length

Returns the focal length of the sensor Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: float

focal length

property ikid

Returns the Naif ID code for the instrument Expects the instrument_id to be defined. This must be a string containing the short name of the instrument.

Returns

: int

Naif ID used to for identifying the instrument in Spice kernels

property kernels

Get the NAIF SPICE Kernels to furnish

There are two ways to specify which kernels a driver will use:

  1. Passing the ‘kernels’ property into load(s) or at instantiation. This can be either a straight iterable or a dictionary that specifies the kernels in ISIS style (‘TargetPosition’, ‘InstrumentPosition’, etc).

  2. Set the ALESPICEROOT environment variable. This variable should be the path to a directory that contains directories whose naming convention matches the PDS Kernel Archives format, shortMissionName-versionInfo. The directory corresponding to the driver’s mission will be searched for the appropriate meta kernel to load.

See Also

ale.util.get_kernels_from_isis_pvl : Function used to parse ISIS style dict ale.util.get_metakernels : Function that searches ALESPICEROOT for meta kernels ale.util.generate_kernels_from_cube : Helper function to get an ISIS style dict

from an ISIS cube that has been through spiceinit

property light_time_correction

Returns the type of light time correction and abberation correction to use in NAIF calls. Expects ikid to be defined. This must be the integer Naif id code of the instrument.

This searches for the value of the NAIF keyword INS<ikid>_LIGHTTIME_CORRECTION. If the keyword is not defined, then this defaults to light time correction and abberation correction (LT+S).

Returns

: str

The light time and abberation correction string for use in NAIF calls. See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/abcorr.html for the different options available.

property naif_keywords

Returns

: dict

Dictionary of keywords and values that ISIS creates and attaches to the label

property odtk

The coefficients for the radial distortion model Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list

Radial distortion coefficients

property odtx

Returns the x coefficient for the optical distortion model Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list

Optical distortion x coefficients

property odty

Returns the y coefficient for the optical distortion model. Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list

Optical distortion y coefficients

property pixel2focal_x

Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list<double> detector to focal plane x

property pixel2focal_y

Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list<double> detector to focal plane y

property pixel_size

Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: float pixel size

property reference_frame

Returns a string containing the name of the target reference frame Expects target_name to be defined. This must be a string containing the name of the target body

Returns

: str String name of the target reference frame

property sensor_frame_id

Returns the Naif ID code for the sensor reference frame Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: int

Naif ID code for the sensor frame

property sensor_orientation

Returns quaternions describing the sensor orientation. Expects ephemeris_time to be defined. This must be a floating point number containing the ephemeris time. Expects instrument_id to be defined. This must be a string containing the short name of the instrument. Expects reference frame to be defined. This must be a string containing the name of the target reference frame.

Returns

: list

Quaternions describing the orientation of the sensor

property sensor_position

Returns a tuple with information detailing the position of the sensor at the time of the image. Expects ephemeris_time to be defined. This must be a floating point number containing the ephemeris time. Expects spacecraft_name to be defined. This must be a string containing the name of the spacecraft containing the sensor. Expects reference_frame to be defined. This must be a string containing the name of the target reference frame. Expects target_name to be defined. This must be a string containing the name of the target body.

Returns

: (positions, velocities, times)

a tuple containing a list of positions, a list of velocities, and a list of times

property spacecraft_id

Returns the Naif ID code for the spacecraft Expects the spacecraft_name to be defined. This must be a string containing the name of the spacecraft.

Returns

: int

Naif ID code for the spacecraft

property sun_position

Returns a tuple with information detailing the sun position at the time of the image. Expects center_ephemeris_time to be defined. This must be a floating point number containing the average of the start and end ephemeris time. Expects reference frame to be defined. This must be a string containing the name of the target reference frame. Expects target_name to be defined. This must be a string containing the name of the target body.

Returns

: (sun_positions, sun_velocities)

a tuple containing a list of sun positions, a list of sun velocities

property swap_observer_target

Returns if the observer and target should be swapped when determining the sensor state relative to the target. This is defined by a keyword in ISIS IAKs. If the keyword is not defined in any loaded kernels then False is returned.

Expects ikid to be defined. This should be an integer containing the Naif Id code of the instrument.

property target_body_radii

Returns a list containing the radii of the target body Expects target_name to be defined. This must be a string containing the name of the target body

Returns

: list<double>

Radius of all three axis of the target body

property target_frame_id

Returns the Naif ID code for the target reference frame Expects the target_id to be defined. This must be the integer Naif ID code for the target body.

Returns

: int

Naif ID code for the target frame

property target_id

Returns the Naif ID code for the target body Expects target_name to be defined. This must be a string containing the name of the target body.

Returns

: int

Naif ID code for the target body

New in version 0.1.0.

class ale.base.data_isis.IsisSpice

Bases: object

Mixin class for reading from an ISIS cube that has been spiceinit’d

Attributes

_labelPVLModule

Dict-like object with PVL keys

_inst_pointing_tabledict

Dictionary that contains information about the rotation from J2000 to the sensor reference frame. All of the values for each property, such as angular velocity, are stored in a list or numpy array where each entry is the property at a different time.

_body_orientation_tabledict

Dictionary that contains information about the rotation from J2000 to the body fixed reference frame. All of the values for each property, such as angular velocity, are stored in a list or numpy array where each entry is the property at a different time.

_inst_position_tabledict

Dictionary that contains information about the location of the sensor relative to the center of the target body. All of the values for each property, such as velocity, are stored in a list or numpy array where each entry is the property at a different time.

_sun_position_tabledict

Dictionary that contains information about the location of the sun relative to the center of the target body. All of the values for each property, such as velocity, are stored in a list or numpy array where each entry is the property at a different time.

property body_orientation_table

ISIS Table containing the rotation between the J2000 reference frame and the target body reference frame.

Returns

: dict

Body orientation table

property detector_center_line

The center of the CCD in detector pixels Expects ikid to be defined. this should be the integer Naif ID code for the instrument.

Returns

list :

The center of the CCD formatted as line, sample

property detector_center_sample

The center of the CCD in detector pixels Expects ikid to be defined. this should be the integer Naif ID code for the instrument.

Returns

list :

The center of the CCD formatted as line, sample

property ephemeris_start_time

The image start time in ephemeris time Expects sclock_hex_string to be defined. This should be a string containing the hex start time of the image

Returns

float :

The image start ephemeris time

property focal2pixel_lines

The line component of the affine transformation from focal plane coordinates to centered ccd pixels Expects naif_keywords to be defined. This should be a dict containing Naif keywords from the label. Expects ikid to be defined. This should be the integer Naif ID code for the instrument.

Returns

list :

The coefficients of the affine transformation formatted as constant, x, y

property focal2pixel_samples

The sample component of the affine transformation from focal plane coordinates to centered ccd pixels Expects naif_keywords to be defined. This should be a dict containing Naif keywords from the label. Expects ikid to be defined. This should be the integer Naif ID code for the instrument.

Returns

list :

The coefficients of the affine transformation formatted as constant, x, y

property focal_length

The focal length of the instrument Expects naif_keywords to be defined. This should be a dict containing Naif keywords from the label. Expects ikid to be defined. This should be the integer Naif ID code for the instrument.

Returns

float :

The focal length in millimeters

property frame_chain

Return the root node of the rotation frame tree/chain.

The root node is the J2000 reference frame. The other nodes in the tree can be accessed via the methods in the FrameNode class.

Returns

FrameNode

The root node of the frame tree. This will always be the J2000 reference frame.

property ikid

The NAIF id for the instrument Expects kernels_group to be defined. This should be a PVLModule containing the kernels group.

Returns

int :

The instrument id

property inst_pointing_table

ISIS Table containing the rotation between the J2000 reference frame and the instrument reference frame.

Returns

: dict

Instrument pointing table

property inst_position_table

ISIS Table containing the location of the instrument relative to the target body in the J2000 reference frame.

Returns

: dict

Instrument position table

property naif_keywords

The NaifKeywords group from the file label that contains stored values from the original SPICE kernels

Returns

PVLModule :

The stored NAIF keyword values

property odtk

Returns optical distortion coefficients Expects ikid to be defined. This should be the integer Naif ID code for the instrument

Returns

: list

optical distortion coefficients

property pixel2focal_x

Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list<double> detector to focal plane x

property pixel2focal_y

Expects ikid to be defined. This must be the integer Naif id code of the instrument

Returns

: list<double> detector to focal plane y

property sensor_position

Sensor position Expects inst_position_table to be defined. This should be a dictionary that contains information about the location of the sensor relative to the center of the target body. Expects number_of_ephemerides to be defined. This should be an integer containing the number of instrument position states.

Returns

: (positions, velocities, times)

a tuple containing a list of positions, a list of velocities, and a list of times

property sun_position

The sun position Expects sun_position_table to be defined. This should be a dictionary that contains information about the location of the sun relative to the center of the target body.

Returns

array :

The sun position vectors relative to the center of the target body in the J2000 reference frame as a tuple of numpy arrays.

property sun_position_table

ISIS Table containing the location of the sun relative to the target body in the J2000 reference frame.

Returns

: dict

Sun position table

property target_body_radii

The triaxial radii of the target body Expects naif_keywords to be defined. This should be a dict containing Naif keywords from the label.

Returns

list :

The body radii in kilometers. For most bodies, this is formatted as semimajor, semimajor, semiminor

ale.base.data_isis.parse_table(table_label, data)

Parse an ISIS table into a dictionary.

Parameters

table_labelPVLModule

The ISIS table label

databytes

The binary component of the ISIS table

Returns

dict :

The table as a dictionary with the keywords from the label and the binary data

ale.base.data_isis.read_table_data(table_label, cube)

Helper function to read all of the binary table data

Parameters

table_labelPVLModule

The ISIS table label

cubefile

The ISIS cube file

Returns

bytes :

The binary portion of the table data

ale.base.data_isis.rotate_state(table, rotation)

Rotate the positions and velocities in an ISIS position Table.

If the table stores states as a function, then it will re compute them based on the original size of the table.

Parameters

tabledict

The position table as a dictionary

rotationTimeDependentRotation

The rotation to rotate the positions by

Returns

: 2darray

Array of rotated positions

: 2darray

Array of rotated velocities. Returns None if no velocities are in the table.

: array

Array of times for the states