pytmosph3r.rays
Module Contents
- class RaysGrid(n_radial=None, n_angular=None)[source]
Bases:
pytmosph3r.grid.Grid- Polar grid defining the number of rays on the terminator plane
(plane going through the center of the planet and orthogonal to the rays).
- The grid has
n_radialradial points located at the middle of the layers (seez),
- property n_radial
- property n_angular
- top_altitude = None
does not represent the altitude of the highest ray, but the altitude of the maximum level of the grid. The rays are then passing through the middle of each layer.
- Type:
Top altitude to consider for the rays. Warning
- dz = None
Distance between levels.
- r = None
Impact parameters of the rays, i.e., their distance to the center of the planet. Note that they are passing through the middle of the layers of the grid.
- angles = None
Azimuthal angles of the rays.
- r_limits = None
Delimiting radii of each transmittance cell.
- angles_limits = None
Delimiting angles of each transmittance cell.
- compute_radii()[source]
Compute the altitudes (in m) over the grid by discretizing the space between the surface and
top_altitudeinton_radialintervals. The altitudes are then computed as the middle of these intervals.
- property unit_angle
Angular length of one slice (in radians).
- class Rays(n_radial=None, n_angular=None, observer=None, grid=None)[source]
Bases:
pytmosph3r.planetary_system.Observer,RaysGridRays are orthogonal to the terminator plane (going through the center of the planet) of which the direction is defined by
Observer. The discretization of the plane is handled byRaysGrid.Set the observer’s position with:
- Parameters:
latitude (float, Unit, optional) – Latitude (in \(rad\) or astropy units). Default to 0.
longitude (float, Unit, optional) – Longitude (in \(rad\) or astropy units). Default to \(\pi\).
- observer = None
Position of the observer.
- rays_lengths = None
Lengths of each subsegment of each ray, ordered by their coordinates.
- rays_indices = None
Control if rays lengths will be stored as a 1D array (or 2D, which is the default behavior).
- property latitude
Latitude coordinate of the ending point of the unit vector (in radians).
- property longitude
Longitude coordinate of the ending point of the unit vector (in radians).
- property units
- property orbit
- property cartesian_system
Cartesian coordinate system (x,y,z) of which:
z is oriented along the rotation axis (pointing towards the North Pole)
x points towards a reference point on the equator that corresponds to a longitude equal to zero
y is chosen to have a direct basis.
The coordinates of the unit vector defining the direction of the rays are then computed through
CartesianCoordinateSystemusing its spherical coordinates (latitude,longitude).
- compute_sub_rays(bounds=None)[source]
Subdivision of the rays into smaller segments (‘subrays’) based on the atmospheric grid. Each subray is associated to coordinates and their lengths are stored in
rays_lengths. The function iterates overRaysGrid.anglesand computescompute_sub_rays_angle()for each of these angles.- Parameters:
bounds (tuple) – Must be ((r_s,r_e), (a_s,a_e)), where r_s and r_e are the radial start and end points, and a_s and a_e the angular ones.
- Returns:
Coordinates in the atmospheric grid with at least one subray, which will be given to the opacity module (
Exo_k).- Return type:
dict
- compute_sub_rays_angle(bounds=None)[source]
Subdivision of the rays at the angle
angle_idx. WARNING: the parameter to this function is NOT the angle, but theboundsof radial points to consider. Seecompute_sub_rays(). Ifopacity_coordsis not initialized, it creates one.- Parameters:
bounds (tuple) – Must be (r_s,r_e), where r_s and r_e are the radial start and end points.
- levels_intersection(points, atm_layer_idx)[source]
Computes the intersection of a ray (of coordinates (radius, angle)) with atmospheric levels (spheres). Returns a list of points [dist, r, lat, lon].