pytmosph3r.plot.plotutils
Module Contents
- label_from_dim(dim='wls', units=None)[source]
Returns spectral label (either wavelength or wavenumber).
- get_spectral(wl, wn, w_units='wls')[source]
Returns either wavelength or wavenumber based on w_units value (‘wls’, ‘wns’).
- clipped_colorbar(CS, extend: pytmosph3r.util.util.Optional[pytmosph3r.util.util.Literal[neither, min, max, both]] = None, **kwargs)[source]
- class BasePlot(name, *args, **kwargs)[source]
Bases:
pytmosph3r.log.Logger
,exo_k.util.spectral_object.Spectral_object
Standard logging using logger library
- Parameters:
name (str) – Name used for logging
plots. (Default values for) –
- x_colors
- modes = ['transmission', 'emission', 'lightcurve', 'phasecurve']
- interactive = True
- altitudes = ['surface', 'middle', 'top']
Altitudes to plot. Possible values are indices or
surface
,top
ormiddle
.
- latitudes = ['north', 'equator', 'south']
Latitudes to plot. Possible values are indices or
north
,south
orequator
.north
is latitude0
.
- longitudes = ['day', 'terminator', 'night']
Longitudes to plot. Possible values are indices or
day
,night
orterminator
.night
is longitude0
.
- static figure(ax=None, figsize=None)[source]
Simply create a figure. Returns a boolean ‘save’ on top of fig and ax, to know if we should save the figure or not.
- plot_columns(func, latitudes=None, longitudes=None, name='plot', legend=None, figsize=None, nrows=None, ncols=None, title=None, *args, **kwargs)[source]
Iterate over vertical columns (lat,lon).
- plot_column(ax, x, y, latitude=None, longitude=None, *args, **kwargs)[source]
Plot something at column (lat,lon).
- spectrum_label(mode)[source]
Label for ‘spectra’ plots.
- Parameters:
mode (str) – Among transmission/emission/lightcurve/phasecurve. Defaults to transmission.
- get_value_dim(index, dim)[source]
Returns the value at
index
in the dimensiondim
.- Parameters:
index (int) – Index of the value we’re looking for.
dim (str) – Dimension of the value we’re looking for. Among “altitude”, “latitude” or “longitude”.
- flux(mode=None, phase=None, wl=None, wn=None, resolution=None, noise=True, ax=None, color=None)[source]
Get flux (spectrum or curve) of a mode, with a resolution of N points, noised or not. Equal to \((Rp/Rs)^2\) (if normalized).
- Parameters:
mode (str, optional) – transmission/emission/lightcurve/phasecurve. Defaults to None.
phase (array | float, optional) – Phase(s) to select. Incompatible with wl or wn. Defaults to None.
wl (array | float, optional) – Wavelength to select. Incompatible with phase or wn. Defaults to None.
wl – Wavenumber to select. Incompatible with phase or wl. Defaults to None.
resolution (int, optional) – Number of points to bin to. Not used with wl or wn. Defaults to None.
noise (bool, optional) – Noise the spectrum? Defaults to True.
- Returns:
flux (exo_k.Spectrum) of which the X axis is either wavelengths, or phases.
- curve(mode=None, **kwargs)[source]
Returns light/phasecurve (as an array). Lightcurve is \(1-(Rp/Rs)^2\).
- init_spectral(wl=None, wn=None, default_wl=15, mode=None)[source]
Init both wavelengths and wavenumbers to equivalent values.
- Returns:
(ws, wl, wn, w_units) where ws is the spectral array corresponding to w_units (either wls or wns).
- Return type:
tuple
- get_spectral(wl=None, wn=None, w_units=None, default_wl=15, mode=None)[source]
Choose which spectral units to plot (wavelengths or wavenumbers).
- find_spectral(wl=None, wn=None, **kwargs)[source]
Find the index of spectral point equal to either wavelength wl or wavenumber wn. Defines
w_index
.
- class LoadPlot[source]
Class to load HDF5 file or
model
attribute. Inherited byPlot
.- property model
- property atmosphere
Dict.
- property wns
- property wnedges
- property spectrum
- property noised_spectrum
- property noise
Planet radius.
- property grid
- property n_layers
- property n_levels
- property n_longitudes
- property n_latitudes
- property Rp
Planet radius.
- property Rs
Star radius.
- property R
Planet radius scaled using
r_factor
.
- property z_idx
- property input_z
- property input_z_levels
- property z_levels
- property z
- property altitude
- property r
- property pressure
- property pressure_levels
- property p_min
- property temperature
- property gas_mix_ratio
- property aerosols
- property shape
- set_mode_attr(mode)[source]
Set attributes for modes (emission/phasecurve/transmission/lightcurve), which have parameters both in Model and in Output.