ShapeModel

giant.utilities.stereophotoclinometry:

class giant.utilities.stereophotoclinometry.ShapeModel(file_name=None, conversion=1.0, grid_size=None, vertices=None, albedos=None)[source]

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

The Shape files specify the global terrain for SPC.

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 file to load the data from

  • conversion (Real) – A conversion factor to convert the units of the shape model into the units you want. Official SPC shape models are in km, which are the same units GIANT usually uses so this should typically remain 1.

  • grid_size (Sequence | ndarray | None) – The number of cells on each side of each face for the ICQ format. This corresponds to the number of vertices by 6*grid_size**2

  • vertices (Sequence | ndarray | None) – The vertices for the ICQ format as a nx3 array. The ordering of these is complicated.

  • albedos (Sequence | ndarray | None) – The albedos corresponding to the vertices as a nx1 array. Alternatively can be None if no albedo data is available.

file_name: Path | str | None

The name of the shape file

grid_size: int | None

The length of one side of the grid for the ICQ format

This corresponds to the first number in the shape file

vertices: Sequence | ndarray | None

The ICQ vertices and a nx3 array

albedos: Sequence | ndarray | None

The albedo for each vertex as a nx1 array.

This is optional and only included in some shape files. It is the fourth float for each vertex in the shape file if available.

Summary of Methods

get_triangles

This method returns GIANT triangle objects from the maplet data to be used in the GIANT ray tracer

read

This method reads data from a SPC Shape file (normally SHAPEFILES/*.TXT) 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