pyRTX.classes.Planet
Classes
|
Represents a planetary albedo grid. |
|
Represents a planetary emissivity grid. |
|
Represents a celestial body, such as a planet or moon. |
A base class for representing planetary grids, such as albedo, emissivity, and temperature maps. |
|
|
Represents a planetary temperature grid. |
- class pyRTX.classes.Planet.PlanetGrid[source]
A base class for representing planetary grids, such as albedo, emissivity, and temperature maps.
- property attrs
Returns the attributes of the underlying xarray Dataset.
- Returns:
The attributes of the xarray Dataset.
- Return type:
- property axes
Returns the coordinate axes of the grid.
- Returns:
A list of the grid’s coordinate axes.
- Return type:
- property frame
Returns the SPICE reference frame of the grid.
- Returns:
The name of the SPICE reference frame.
- Return type:
- property dims
Returns the dimensions of the grid’s data.
- Returns:
A tuple of the grid’s dimensions.
- Return type:
- property periodicity
Returns the longitudinal periodicity of the grid (180 or 360 degrees).
- Returns:
The periodicity of the grid in degrees.
- Return type:
- get_data(epoch=None)[source]
Returns the grid’s data.
- Parameters:
epoch (
float, optional) – The epoch for which to retrieve the data, if the grid is time-dependent.- Returns:
The grid’s data.
- Return type:
- __getitem__(idxs)[source]
Allows indexing into the grid to retrieve interpolated values.
- Parameters:
idxs (
tuple) – A tuple of indices for each dimension of the grid.- Returns:
The interpolated value(s) at the given indices.
- Return type:
- class pyRTX.classes.Planet.EmissivityGrid(**kwargs)[source]
Represents a planetary emissivity grid.
- __init__(**kwargs)[source]
Initializes the EmissivityGrid object.
- Parameters:
radius (
float, optional) – The radius of the planet.frame (
str, optional) – The SPICE reference frame of the grid.planet_name (
str, optional) – The name of the planet.axes (
list, optional) – A list of the grid’s coordinate axes.from_array (
str, optional) – The path to a file (.nc or .npy) from which to load the grid data.
- class pyRTX.classes.Planet.AlbedoGrid(**kwargs)[source]
Represents a planetary albedo grid.
- __init__(**kwargs)[source]
Initializes the AlbedoGrid object.
- Parameters:
radius (
float, optional) – The radius of the planet.frame (
str, optional) – The SPICE reference frame of the grid.planet_name (
str, optional) – The name of the planet.axes (
list, optional) – A list of the grid’s coordinate axes.from_array (
str, optional) – The path to a file (.nc or .npy) from which to load the grid data.
- class pyRTX.classes.Planet.TemperatureGrid(**kwargs)[source]
Represents a planetary temperature grid.
- __init__(**kwargs)[source]
Initializes the TemperatureGrid object.
- Parameters:
albedo (
AlbedoGridorfloat, optional) – The albedo of the planet.base_flux (
float, optional) – The base solar flux at 1 AU.radius (
float, optional) – The radius of the planet.frame (
str, optional) – The SPICE reference frame of the grid.planet_name (
str, optional) – The name of the planet.nightside_temp (
float, optional) – The nightside temperature of the planet.emissivity (
EmissivityGridorfloat, optional) – The emissivity of the planet.step (
int, optional) – The step size for the grid computation.axes (
list, optional) – A list of the grid’s coordinate axes.epochs (
listoffloat, optional) – A list of epochs for which to compute the temperature grid.from_array (
str, optional) – The path to a file (.nc or .npy) from which to load the grid data.
- get_albedo(epoch, dir)[source]
Retrieves the albedo value for a given direction and epoch.
- Parameters:
epoch (
float) – The epoch for which to retrieve the albedo.dir (
numpy.ndarray) – The direction vector for which to retrieve the albedo.
- Returns:
The albedo value.
- Return type:
- get_emissivity(epoch, dir)[source]
Retrieves the emissivity value for a given direction and epoch.
- Parameters:
epoch (
float) – The epoch for which to retrieve the emissivity.dir (
numpy.ndarray) – The direction vector for which to retrieve the emissivity.
- Returns:
The emissivity value.
- Return type:
- class pyRTX.classes.Planet.Planet(fromFile=None, radius=0, name='', bodyFrame='', sunFixedFrame='', units='km', subdivs=4)[source]
Represents a celestial body, such as a planet or moon.
- __init__(fromFile=None, radius=0, name='', bodyFrame='', sunFixedFrame='', units='km', subdivs=4)[source]
Initializes the Planet object.
- Parameters:
fromFile (
str, optional) – Path to an OBJ file to build the model from. If None, a sphere is created.radius (
float, default0) – The radius of the planet (if creating a sphere).name (
str, default'') – The name of the planet.bodyFrame (
str, default'') – The SPICE reference frame for the planet’s body.sunFixedFrame (
str, default'') – The body-centered, sun-fixed reference frame.units (
str, default'km') – The units for the planet’s dimensions.subdivs (
int, default4) – The number of subdivisions for the icosphere (if creating a sphere).
- mesh(translate=None, rotate=None, epoch=None, targetFrame=None)[source]
Returns the planet’s mesh, optionally transformed.
- Parameters:
translate (
listornumpy.ndarray, optional) – A 3-element vector for the translation.rotate (
str, optional) – The name of the reference frame to rotate from.epoch (
float, optional) – The epoch for the rotation.targetFrame (
str, optional) – The name of the reference frame to rotate to.
- Returns:
The transformed mesh.
- Return type:
trimesh.Trimesh
- albedoFaces(epoch, spacecraft_name)[source]
Returns the indices and albedo values of the faces that contribute to the albedo calculation.
- rot_toSCframe(epoch, scFrame=None)[source]
Returns the rotation matrix from the sun-fixed frame to a spacecraft frame.
- Parameters:
- Returns:
The 3x3 rotation matrix.
- Return type:
- emissivityFaces(epoch, spacecraft_name)[source]
Returns the indices, temperatures, and emissivities of the faces that contribute to the emissivity calculation.
- getFaceAlbedo(epoch)[source]
Returns the albedo of each face at a given epoch.
- Parameters:
epoch (
float) – The epoch for the calculation.- Returns:
An array containing the albedo of each face.
- Return type:
- getFaceTemperatures(epoch)[source]
Returns the temperature of each face at a given epoch.
- Parameters:
epoch (
float) – The epoch for the calculation.- Returns:
An array containing the temperature of each face.
- Return type:
- getFaceEmissivity(epoch, sunFixedFrame=False)[source]
Returns the emissivity of each face at a given epoch.
- Parameters:
- Returns:
An array containing the emissivity of each face.
- Return type:
- VFNC(epoch, sunFixedFrame=True)[source]
Returns the vertices, faces, normals, and centroids of the planet’s mesh.
- getScPosSunFixed(epoch, spacecraft_name)[source]
Returns the position of a spacecraft in the sun-fixed frame.
- Parameters:
- Returns:
The position of the spacecraft.
- Return type:
- pxform_convert(pxform)[source]
Converts a 3x3 SPICE rotation matrix to a 4x4 transformation matrix.
- Parameters:
pxform (
numpy.ndarray) – The 3x3 rotation matrix.- Returns:
The 4x4 transformation matrix.
- Return type:
- property dayside_temperature
The dayside temperature of the planet.
- property nightside_temperature
The nightside temperature of the planet.
- property gridded_temperature
The gridded temperature of the planet.
- property albedo
The albedo of the planet.
- property albedo_map
The albedo map settings for the planet.
- property emissivity
The emissivity of the planet.