Nominal

giant.utilities.stereophotoclinometry:

class giant.utilities.stereophotoclinometry.Nominal(file_name=None, image_name=None, position_camera_to_target=None, velocity=None, rotation_target_fixed_to_camera=None, sig_pos_camera_to_target=None, sig_rot_target_fixed_to_camera=None, frame=None, ending=None)[source]

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

The nominal files represent meta data about an Image as original loaded with updated values being stored in the Summary (.SUM) files. The image data itself is stored in a corresponding .DAT file which can be read/written with the Image class. When creating an instance of this class, you can enter the file_name argument, in which case the specified NOM file will be opened and read into the members of this class (if the file exists), or you can specify the individual components of the file as keyword arguments. If you specify both an existing NOM file and keyword arguments for the individual components of the NOM file, the keyword arguments will override whatever is read from the file.

The documentation for each instance attribute of this class specifies the corresponding location in the NOM file for clarification and reference.

Parameters:
  • file_name (Path | str | None) – The path to a summary file to read data from

  • image_name (str | None) – The name of the image this object corresponds to

  • position_camera_to_target (Sequence | ndarray | None) – The vector from the spacecraft to the target in the target body fixed frame as a length 3 numpy array as originally specified

  • velocity (Sequence | ndarray | None) – The velocity of the camera

  • rotation_target_fixed_to_camera (Sequence | ndarray | None) – The 3x3 rotation matrix from the target body fixed frame to the camera frame

  • sig_pos_camera_to_target (Sequence | ndarray | None) – This is the formal uncertainty on the position_camera_to_target vector (1 sigma) as originally specified

  • sig_rot_target_fixed_to_camera (Sequence | ndarray | None) – This is the formal uncertainty on the spacecraft pointing (roll, pitch, yaw?) (1 sigma) as originally specified

  • frame (str | None) – This specifies the frame the position uncertainty is experessed in

  • ending (str | None) – This specifies stuff that goes at the end of the nominal file.

file_name: Path | str | None

The path to the nominal file that this object was populated from.

This also will be the file that changes are written to if write() is called with no arguments.

Typically this is named according to NOMINALS/IMAGENAME.NOM where IMAGENAME is replaced with the SPC name of the image. This can be set to None, a str, or a Path.

image_name: str | None

The name of the image this object corresponds to.

This corresponds to the first line of the NOM file.

position_camera_to_target: ndarray

The position vector from the spacecraft to the target in target body fixed coordinates at the time of the image with units of kilometers as a length 3 numpy array of floats. This represents the vector as originally loaded into SPC (usually from SPICE). That means this typically is not updated.

This corresponds to all the values of the line containing SCOBJ in the NOM file, usually the 3rd line.

velocity: ndarray

The velocity of the camera with units of kilometers per second as a length 3 numpy array of floats.

This corresponds to the second line in the NOM file.

rotation_target_fixed_to_camera: ndarray

The rotation matrix from the target body fixed frame to the camera frame at the time of the image as a shape 3x3 numpy array of floats. This represents the matrix as originally read into SPC (usually from spice)

This corresponds to all the values of the lines containing CX, CY, CZ in the NOM file. The matrix is formed according to np.vstack([CX, CY, CZ])

sig_pos_camera_to_target: ndarray

The formal uncertainty on the position_camera_to_target vector as a length 3 numpy array of floats.

The formal uncertainty are the 1 sigma values for each component of the position vector.

This corresponds to all of the values of the line containing SIGMA_VSO in the NOM file.

sig_rot_target_fixed_to_camera: ndarray

The formal uncertainty on the rotation from the target body frame to the spacecraft frame as a length 3 numpy array of floats.

The formal uncertainty are the 1 sigma values.

This corresponds to all of the values of the line containing SIGMA_PTG in the NOM file.

frame: str

This specifies the frame the sig_pos_camera_to_target is specified in.

This corresponds to the label on the velocity line in the NOM file.

ending: str

This corresponds to the end of the Nominal file (essentially anything that wasn’t captured) and is a fall back for future additions.

Summary of Methods

read

This method reads data from a SPC NOM file (normally NOMINALS/*IMAGENAME*.NOM) and populates the attributes of this class with that data.

write

This function writes the data contained in the current instance of the class into the specified file