Grid
Grid¶
- class frei.Grid(planet, lam=None, pressures=None, init_temperatures=None, lam_min=<Quantity 0.5 um>, lam_max=<Quantity 10. um>, n_wl_bins=500, P_toa=<Quantity 1.e-06 bar>, P_boa=<Quantity 200. bar>, n_layers=30, T_ref=<Quantity 2300. K>, P_ref=<Quantity 0.1 bar>, alpha=0.1)[source]¶
Bases:
object
Grid over temperatures, pressures and wavelengths.
If
lam
,pressures
, orinit_temperatures
are None, frei use the remaining keyword arguments to produce each grid.- Parameters
planet (Planet) – Planet object associated with this grid.
lam (Quantity or None (optional)) – Wavelength grid
pressures (Quantity or None (optional)) – Pressure grid
init_temperatures (Quantity or None (optioonal)) – Initial temperature grid at each pressure
lam_min (Quantity) – Minimum wavelength.
lam_max (Quantity) – Maximum wavelength
n_wl_bins (int) – Number of log-spaced bins in wavelength
P_toa (Quantity) – Pressure at the top of the atmosphere
P_boa (Quantity) – Pressure at the bottom of the atmosphere
n_layers (int) – Number of log-spaced bins in pressure
T_ref (Quantity) – Reference temperature at reference pressure
P_ref (Quantity) – Reference pressure
alpha (float (default = 0.1)) – Power law index of initial guess T-p profile
Methods Summary
emission_dashboard
(spec, final_temps, ...[, ...])Produce the "dashboard" plot with the outputs from
emission_spectrum
.emission_spectrum
([n_timesteps, ...])Compute the emission spectrum for this grid.
load_opacities
([species, path, opacities, ...])Load opacity tables from path.
Methods Documentation
- emission_dashboard(spec, final_temps, temperature_history, dtaus, T_eff=None, plot_phoenix=True, cache=False)[source]¶
Produce the “dashboard” plot with the outputs from
emission_spectrum
.- Parameters
spec (Spectrum1D) – Emission spectrum
final_temps (Quantity) – Final temperature grid
temperature_history (Quantity) – Grid of temperatures with dimensions (n_layers, n_timesteps)
dtaus (ndarray) – Change in optical depth in final iteration
T_eff (Quantity or None) – If not None, give the effective temperature of the PHOENIX model to plot in comparison, otherwise compute it on the fly.
plot_phoenix (bool) – If True, plot the corresponding PHOENIX model
cache (bool) – Cache the PHOENIX model spectrum if
plot_phoenix
is True.
- Returns
Matplotlib figure and axis objects.
- Return type
fig, ax
- emission_spectrum(n_timesteps=1, n_zero_crossings=2, convergence_dT=<Quantity 3. K>)[source]¶
Compute the emission spectrum for this grid.
- Parameters
- Returns
spec (specutils.Spectrum1D) – Emission spectrum
final_temps (astropy.units.Quantity) – Final temperature grid
temperature_history (astropy.units.Quantity) – Grid of temperatures with dimensions (n_layers, n_timesteps)
dtaus (numpy.ndarray) – Change in optical depth in final iteration
n_zero_crossings (int) – Number of changes in sign of ∆T in each layer before considered converged
- load_opacities(species=None, path=None, opacities=None, client=None, force_reload=False)[source]¶
Load opacity tables from path.
- Parameters
species (list or None (optional)) – List of species to load. If None, load all available.
path (str) – Path passed to ~glob.glob to find opacity netCDF files.
opacities (None or dict (optional)) – If opacities are already computed, simply pass them into the Grid object with this keyword argument.
client (None or Client) – Client for distributed dask computation on opacity tables
- Returns
opacities – Opacity dictionary of xarray.DataArray’s
- Return type