POSEIDON.transmission ===================== .. py:module:: POSEIDON.transmission .. autoapi-nested-parse:: Functions for transmission spectra radiative transfer calculations. Functions --------- .. autoapisummary:: POSEIDON.transmission.zone_boundaries POSEIDON.transmission.path_distribution_geometric POSEIDON.transmission.extend_rad_transfer_grids POSEIDON.transmission.compute_tau_vert POSEIDON.transmission.delta_ray_geom POSEIDON.transmission.area_overlap_circles POSEIDON.transmission.TRIDENT Module Contents --------------- .. py:function:: zone_boundaries(N_b, N_sectors, N_zones, b, r_up, k_zone_back, theta_edge_min, theta_edge_max) Compute the maximum and minimal radial distance from the centre of the planet that a ray at impact parameter b experiences in each azimuthal sector and zenith zone. These quantities are 'r_min' and 'r_max' in MacDonald & Lewis (2022). :param N_b: Number of impact parameters (length of b). :type N_b: int :param N_sectors: Number of azimuthal sectors. :type N_sectors: int :param N_zones: Number of zenith zones. :type N_zones: int :param b: Stellar ray impact parameters. :type b: np.array of float :param r_up: Upper layer boundaries in each atmospheric column (m). :type r_up: 3D np.array of float :param k_zone_back: Indices encoding which background atmosphere zone each zenith integration element corresponds to. :type k_zone_back: np.array of int :param theta_edge_min: Minimum zenith angle of each zone (radians). :type theta_edge_min: np.array of float :param theta_edge_max: Maximum zenith angle of each zone (radians). :type theta_edge_max: np.array of float :returns: Minimum radial extent encountered by a ray when traversing a given layer in a column defined by its sector and zone (m). r_max (3D np.array of float): Maximum radial extent encountered by a ray when traversing a given layer in a column defined by its sector and zone (m). :rtype: r_min (3D np.array of float) .. py:function:: path_distribution_geometric(b, r_up, r_low, dr, i_bot, j_sector_back, N_layers, N_sectors_back, N_zones_back, N_zones, N_phi, k_zone_back, theta_edge_all) Compute the path distribution tensor, in the geometric limit where rays travel in straight lines, using the equations in MacDonald & Lewis (2022). :param b: Stellar ray impact parameters. :type b: np.array of float :param r_up: Upper layer boundaries in each atmospheric column (m). :type r_up: 3D np.array of float :param r_low: Lower layer boundaries in each atmospheric column (m). :type r_low: 3D np.array of float :param dr: Layer thicknesses in each atmospheric column (m). :type dr: 3D np.array of float :param i_bot: Layer index of bottom of atmosphere (rays with b[i < i_bot] are ignored). By default, i_bot = 0 so all rays are included in the radiative transfer calculation. :type i_bot: int :param j_sector_back: Indices encoding which background atmosphere sector each azimuthal integration element falls in (accounts for north-south symmetry of background atmosphere, since the path distribution need only be calculated once for the northern hemisphere). :type j_sector_back: np.array of int :param N_layers: Number of layers. :type N_layers: int :param N_sectors_back: Number of azimuthal sectors in the background atmosphere. :type N_sectors_back: int :param N_zones_back: Number of zenith zones in the background atmosphere. :type N_zones_back: int :param N_phi: Number of azimuthal integration elements (not generally the same as N_sectors, especially when the planet partially overlaps the star). :type N_phi: int :param k_zone_back: Indices encoding which background atmosphere zone each zenith integration element corresponds to. :type k_zone_back: np.array of int :param theta_edge_all: Zenith angles at the edge of each zone (radians). :type theta_edge_all: np.array of float :returns: Path distribution tensor for 3D atmospheres. :rtype: Path (4D np.array of float) .. py:function:: extend_rad_transfer_grids(phi_edge, theta_edge, R_s, d, R_max, f_cloud, phi_0, theta_0, N_sectors_back, N_zones_back, enable_deck, N_phi_max=36) Extend the background atmosphere geometric grids (north hemisphere) to produce the full geometric grids used for radiative transfer. This function first duplicates the north hemisphere to symmetrically extend to the south hemisphere. Then, additional sectors and zones are added for cloudy models at the angular locations where they slice the existing background sectors / zones. In cases where the planet only partially transits the stellar disc (e.g. grazing transits, ingress, or egress) the 'N_phi_max' parameter specifies how many azimuthal sectors the atmosphere is spatially resolved into. In this case, the nearest background 2D / 3D atmosphere sector is placed on the fine grid during radiative transfer. :param phi_edge: Boundary angles for each sector (radians). :type phi_edge: np.array of float :param theta_edge: Boundary angles for each zone (radians). :type theta_edge: np.array of float :param R_s: Stellar radius (m). :type R_s: float :param d: Distance between planet and star centres. :type d: float :param R_max: Maximum radial extent of entire 3D atmosphere (top of atmosphere). :type R_max: float :param f_cloud: Terminator azimuthal cloud fraction for 2D/3D models. :type f_cloud: float :param phi_0: Azimuthal angle in terminator plane, measured clockwise from the North pole, where the patchy cloud begins for 2D/3D models (degrees). :type phi_0: float :param theta_0: Zenith angle from the terminator plane, measured towards the nightside, where the patchy cloud begins for 2D/3D models (degrees). :type theta_0: float :param N_sectors_back: Number of azimuthal sectors in the background atmosphere. :type N_sectors_back: int :param N_zones_back: Number of zenith zones in the background atmosphere. :type N_zones_back: int :param enable_deck: 1 if the model contains a cloud deck, else 0. :type enable_deck: int :param N_phi_max: Maximum number of azimuthal integration elements to use for partial transits when discretising the atmosphere. :type N_phi_max: int, optional :returns: Angles in the centre of each azimuthal integration element (radians). dphi_grid (np.array of float): Angular width each azimuthal integration element (radians). theta_grid (np.array of float): Angles in the centre of each zenith integration element (radians). theta_edge_all (np.array of float): Boundary angles at the edge of each zenith integration element (radians). N_sectors (int): Total number of azimuthal sectors (including addition of southern hemisphere and any extra sectors needed to handle patchy clouds). N_zones (int): Total number of zenith zones (including any additional zones needed to handle patchy clouds). N_phi (int): Number of azimuthal integration elements. j_sector (np.array of int): Indices specifying which sector each azimuthal integration element falls in (for the full list of sectors, including cloud sectors). j_sector_back (np.array of int): Indices specifying which sector of the background atmosphere each azimuthal integration element falls in (clear atmosphere only). k_zone_back (np.array of int): Indices encoding which background atmosphere zone each zenith integration element corresponds to. cloudy_sectors (np.array of int): 0 if a given sector is clear, 1 if it contains a cloud. cloudy_zones (np.array of int): 0 if a given zone is clear, 1 if it contains a cloud. :rtype: phi_grid (np.array of float) .. py:function:: compute_tau_vert(N_phi, N_layers, N_zones, N_wl, j_sector, j_sector_back, k_zone_back, cloudy_zones, cloudy_sectors, kappa_clear, kappa_cloud, dr) Computes the vertical optical depth tensor across each layer within each column as a function of wavelength. :param N_phi: Number of azimuthal integration elements. :type N_phi: int :param N_layers: Number of atmospheric layers. :type N_layers: int :param N_zones: Number of zenith zones. :type N_zones: int :param N_wl: Number of wavelengths. :type N_wl: int :param j_sector: Indices specifying which sector each azimuthal integration element falls in (for the full list of sectors, including cloud sectors). :type j_sector: np.array of int :param j_sector_back: Indices specifying which sector of the background atmosphere each azimuthal integration element falls in (clear atmosphere only). :type j_sector_back: np.array of int :param k_zone_back: Indices encoding which background atmosphere zone each zenith integration element corresponds to. :type k_zone_back: np.array of int :param cloudy_zones: 0 if a given zone is clear, 1 if it contains a cloud. :type cloudy_zones: np.array of int :param cloudy_sectors: 0 if a given sector is clear, 1 if it contains a cloud. :type cloudy_sectors: np.array of int :param kappa_clear: Extinction coefficient from the clear atmosphere (combination of line absorption, CIA, bound-free and free-free absorption, and Rayleigh scattering) (m^-1). :type kappa_clear: 4D np.array of float :param kappa_cloud: Extinction coefficient from the cloudy / haze contribution (m^-1). :type kappa_cloud: 4D np.array of float :param dr: Layer thicknesses in each atmospheric column (m). :type dr: 3D np.array of float :returns: Vertical optical depth tensor. :rtype: tau_vert (4D np.array of float) .. py:function:: delta_ray_geom(N_phi, N_b, b, b_p, y_p, phi_grid, R_s_sq) Compute the ray tracing Kronecker delta factor in the geometric limit. :param N_phi: Number of azimuthal integration elements (not generally the same as N_sectors, especially when the planet partially overlaps the star). :type N_phi: int :param N_b: Number of impact parameters (length of b). :type N_b: int :param b: Stellar ray impact parameters. :type b: np.array of float :param b_p: Impact parameter of planetary orbit (m) -- NOT in stellar radii! :type b_p: float :param y_p: Perpendicular distance from planet centre to the point where d = b_p (y coord. of planet centre as seen by observer in stellar z-y plane). :type y_p: float :param phi_grid: Angles in the centre of each azimuthal integration element (radians). :type phi_grid: np.array of float :param R_s_sq: Square of the stellar radius (m^2). :type R_s_sq: float :returns: 1 if a given ray traces back to the star, 0 otherwise. :rtype: delta_ray (2D np.array of float) .. py:function:: area_overlap_circles(d, r_1, r_2) Calculate the overlapping area of two circles. :param d: Distance between centres of circles. :type d: float :param r_1: Radius of first circle (nominally the planet). :type r_1: float :param r_2: Radius of second circle (nominally the star). :type r_2: float :returns: Overlapping area of the two circles. :rtype: A_overlap (float) .. py:function:: TRIDENT(P, r, r_up, r_low, dr, wl, kappa_clear, kappa_cloud, enable_deck, enable_haze, b_p, y_p, R_s, f_cloud, phi_0, theta_0, phi_edge, theta_edge) Main function used by the TRIDENT forward model to solve the equation of radiative transfer for exoplanet transmission spectra. This function implements the tensor dot product method derived in MacDonald & Lewis (2022). Note: This function is purely the atmospheric contribution to the spectrum. The 'contamination factor' contributions (e.g. stellar heterogeneity) are handled afterwards in 'core.py'. :param P: Atmosphere pressure array (bar). :type P: np.array of float :param r: Radial distance profile in each atmospheric column (m). :type r: 3D np.array of float :param r_up: Upper layer boundaries in each atmospheric column (m). :type r_up: 3D np.array of float :param r_low: Lower layer boundaries in each atmospheric column (m). :type r_low: 3D np.array of float :param dr: Layer thicknesses in each atmospheric column (m). :type dr: 3D np.array of float :param wl: Model wavelength grid (μm). :type wl: np.array of float :param kappa_clear: Extinction coefficient from the clear atmosphere (combination of line absorption, CIA, bound-free and free-free absorption, and Rayleigh scattering) (m^-1). :type kappa_clear: 4D np.array of float :param kappa_cloud: Extinction coefficient from the cloudy / haze contribution (m^-1). :type kappa_cloud: 4D np.array of float :param enable_deck: 1 if the model contains a cloud deck, else 0. :type enable_deck: int :param enable_haze: 1 if the model contains a haze, else 0. :type enable_haze: int :param b_p: Impact parameter of planetary orbit (m) -- NOT in stellar radii! :type b_p: float :param y_p: Perpendicular distance from planet centre to the point where d = b_p (y coord. of planet centre as seen by observer in stellar z-y plane). :type y_p: float :param R_s: Stellar radius (m). :type R_s: float :param f_cloud: Terminator azimuthal cloud fraction for 2D/3D models. :type f_cloud: float :param phi_0: Azimuthal angle in terminator plane, measured clockwise from the North pole, where the patchy cloud begins for 2D/3D models (degrees). :type phi_0: float :param theta_0: Zenith angle from the terminator plane, measured towards the nightside, where the patchy cloud begins for 2D/3D models (degrees). :type theta_0: float :param phi_edge: Boundary angles for each sector (radians). :type phi_edge: np.array of float :param theta_edge: Boundary angles for each zone (radians). :type theta_edge: np.array of float :returns: Atmospheric transit depth as a function of wavelength. :rtype: transit_depth (np.array of float)