Maplet¶
giant.utilities.stereophotoclinometry
:
- class giant.utilities.stereophotoclinometry.Maplet(file_name=None, name=None, size=None, scale=None, position_objmap=None, rotation_maplet2body=None, hscale=None, heights=None, albedos=None, transformation_precision=None)[source]¶
This class is used to read and write from SPC Maplet files.
The Maplet files specify local terrain and albedo data for a landmark.
When creating an instance of this class you can enter the
file_name
argument and the data will automatically be read from that file. Alternatively you can specify individual components of the object through key word arguments. If you provide both key word arguments and a file name then the key word arguments you specified will overwrite anything read from the file.- Parameters:
file_name (Path | str | None) – The name of the Maplet file
name (str | None) – the name of the Maplet
size (int | None) – half the size of the maplet
scale (float | None) – The ground sample distance of the maplet in units of km
position_objmap (ndarray[tuple[Any, ...], dtype[_ScalarT]] | None) – the body-fixed center of the maplet (Landmark)
rotation_maplet2body (ndarray[tuple[Any, ...], dtype[_ScalarT]] | None) – The rotation from the local maplet frame to the body fixed frame
hscale (float | None) – The scaling term used to convert maplet heights between a float in units of scale and an integer for file storage.
heights (ndarray[tuple[Any, ...], dtype[_ScalarT]] | None) – The height data for the maplet expressed in the local maplet frame as a 2*size+1 by 2*size+1 2D numpy array
albedos (ndarray[tuple[Any, ...], dtype[_ScalarT]] | None) – the relative albedo data for the maplet expressed in the local maplet frame as a 2*size+1 by 2*size+1 2D numpy array
transformation_precision (MapletTransformationPrecision | None) – the precision to use for storing/reading the transformation information in the file (position_objmap and rotation_maplet2body). Note that this should pretty much always be left to SINGLE as that is the only officially supported precision.
- file_name: Path | str | None¶
The name of the landmark file
- name: str¶
The name of the Maplet.
This should be a 6 character string, typically alpha-numeric.
This corresponds to the name of the maplet file, not including the the extension. It is provided for convenience and is not used in either reading or writing.
- size: int¶
Half the number of grid cells on a side for the Maplet minus 1.
This is computed as to size=(n_rows - 1)/2 where n_rows is the number of rows in the Maplet (or number of columns since Maplets are always square).
This corresponds to the 16bit unsigned integer in the 11th and 12th bytes of the maplet file.
- scale: float¶
The ground sample distance of each grid cell for the Maplet in units of KM.
This corresponds to the 32bit float in the 7th through 10th bytes of the maplet file.
Defaults to 0.0
- position_objmap: ndarray¶
The body-fixed landmark vector in units of km as a length 3 numpy array of floats
This corresponds to the 3 32bit floats in the 16th–28th bytes of the maplet file or the 3 64 bit floats in the 16th–40th bytes of the maplet file if the transformation precision is set to double (unsupported outside of GIANT).
- rotation_maplet2body: ndarray¶
The rotation matrix from the Maplet local frame to the body-fixed frame as a 3x3 numpy array of floats.
This corresponds to the 9 32bit floats in the 29th–55th bytes of the maplet file or the 9 64 bit floats in the 41st–113th bytes of the maplet file if the transformation precision is set to double (unsupported outside of GIANT).
Defaults to the 3x3 identity matrix
- hscale: float¶
The scale used to convert heights from a float to a 16byte signed integer in the maplet file.
This corresponds to the 32bit float in the 56th byte of the maplet file or the 114th byte of the maplet file if the transformation precision is set to double (unsupported outside of GIANT)
- heights: ndarray¶
The height profile for the maplet as a 2*size+1 by 2*size+1 2D numpy array
This corresponds to the 16bit signed integers in the remaining data in the maplet file, but have been converted to floats using hscale.
- albedos: ndarray¶
The relative albedo profile for the maplet as a 2*size+1 by 2*size+1 2D numpy array.
this corresponds to the 8 bit unsigned integers in the remaining data in the maplet file, but have been converted to floats
Summary of Methods
This method returns GIANT triangle objects from the maplet data to be used in the GIANT ray tracer |
|
This method reads data from a SPC Maplet file (normally |
|
This function writes the data contained in the current instance of the class into the specified file |