giant.utilities

This package provides a few different utility routines for interfacing with external data and general data analysis.

The modules in this package each contain detailed information about what they provide/do and a summary of all of the functionality available from the modules in this package is provided below.

Summary Contents

Modules

mixin_classes

This package contains helpful mixin classes to provide basic functionality throughout GIANT.

boolean_filter_list

This module provides a helper function to filter a list using a sequence of boolean values

options

This module provides a class for options management.

outlier_identifier

This module provides a function for calculating outliers in a 1 dimensional data set using Median Absolute Deviation.

print_llt

This module provides a utility function to print the lower left triangle of a matrix.

random_combination

Provides an iterator for generating unique random combinations from a population where order doesn't matter.

spherical_coordinates

This module contains helper functions for transforming from/to spherical coordinates.

spice_interface

This module provides utility functions and classes for quickly creating callable objects to NAIF spice functions as well as a function to convert a datetime object to spice ephemeris time without using spice itself.

stereophotoclinometry

This module provides a number of classes for interfacing with files used in the Stereophotoclinometry (SPC) software suite for performing shape modelling and surface feature navigation.

tee

This module provides 2 classes for performing tees of outputs to a file.

wcs

This module provides functions for ingesting WCS header data into a format GIANT can understand.

Classes

AttributeEqualityComparison

A base class that implements equality comparison based on attributes.

AttributePrinting

A mixin class that provides __str__ and __repr__ functionality.

UserOptionConfigured

Mixin class providing UserOptions-based configuration with reset capability.

UserOptions

This is a class used to create a dataclass of user options.

RandomCombinations

Iterate over number_of_combos random combinations of combo_length from population.

SpicePosition

This class creates a callable that returns the position (in km) of one object to another given a python datetime.

SpiceState

This class creates a callable that returns the state vector (position and velocity, km and km/s respectively) of one object to another given a python datetime.

SpiceOrientation

This class creates a callable that returns the rotation from one frame to another as a Rotation given a python datetime.

Summary

This class is used to read/write from the SPC summary (.SUM) files.

Image

This class is used to read and write from SPC Image files (.DAT).

Nominal

This class is used to read/write from the SPC Nominal (.NOM) files.

Landmark

This class is used to read and write from SPC Landmark files.

MapletTransformationPrecision

A class to represent the level of precision for the maplet transformation components (position_objmap and rotation_maplet2body).

Maplet

This class is used to read and write from SPC Maplet files.

ShapeModel

This class is used to read and write from SPC Shape files (Implicitly connected Quadrilateral, ICQ format).

REDIRECT

An enumeration specifying the options of what to redirect

Tee

This class support simultaneously writing to a file and stdout/stderr

DoubleTee

This class provides the ability to simultaneously tee both STDOUT and STDERR to a file.

Functions

boolean_filter_list

Filter a list based on a boolean sequence or NumPy array.

get_outliers

This function can be used to identify outliers in a 1 dimensional set of data.

print_llt

This pretty prints the lower left triangle of a matrix with labels.

radec_to_unit

This utility converts (a) right ascension and declination pair(s) expressed in units of radians into (an) unit vector(s).

unit_to_radec

This function converts a unit vector(s) into a right ascension/declination bearing(s).

radec_distance

This function computes the great-circle angular distance in units of radians between ra/dec pairs.

datetime_to_et

This function converts a python datetime object to ephemeris time correcting for leap seconds

create_callable_position

This function generates a partial function of the spkpos method from spice with the target, frame, abcorr, and observer inputs already set (so that the only remaining input is the ephemeris time).

create_callable_state

This function generates a partial function of the spkezr method from spice with the target, frame, abcorr, and observer inputs already set (so that the only remaining input is the ephemeris time).

create_callable_orientation

This function generates a partial function of the pxform function from spice with the from and the to frames specified.

et_callable_to_datetime_callable

This function takes a callable object that takes a time in ephemeris time and returns a callable object that takes a time as a python datetime object.

get_distortion

This function gets the distortion value from the lithos file pertaining to a specified image

get_wcs_orientation

This function converts an astropy WCS object into a GIANT Rotation object.

get_wcs_model

This function creates a giant .CameraModel that mimics the input WCS object.

Constants

stereophotoclinometry.DATE_FMT

This is the observation_date format used in SPC summary and nominal files.