:py:mod:`pytmosph3r.plot.plotutils` =================================== .. py:module:: pytmosph3r.plot.plotutils Module Contents --------------- .. py:function:: time_fmt(time, units=None) Format time in days, hours or seconds. .. py:function:: units_from_dim(dim='wls') Get units from dim (wls/wns/phases/times). .. py:function:: label_from_dim(dim='wls', units=None) Returns spectral label (either wavelength or wavenumber). .. py:function:: get_spectral(wl, wn, w_units='wls') Returns either wavelength or wavenumber based on `w_units` value ('wls', 'wns'). .. py:function:: clipped_colorbar(CS, extend: pytmosph3r.util.util.Optional[pytmosph3r.util.util.Literal[neither, min, max, both]] = None, **kwargs) .. py:function:: path_leaf(path) .. py:function:: legend_out(ax, x0=1, y0=1, direction='v', padpoints=3, **kwargs) .. py:class:: BasePlot(name, *args, **kwargs) Bases: :py:obj:`pytmosph3r.log.Logger`, :py:obj:`exo_k.util.spectral_object.Spectral_object` Standard logging using logger library :param name: Name used for logging :type name: str :param Default values for plots.: .. py:attribute:: x_colors .. py:attribute:: modes :value: ['transmission', 'emission', 'lightcurve', 'phasecurve'] .. py:attribute:: interactive :value: True .. py:attribute:: altitudes :value: ['surface', 'middle', 'top'] Altitudes to plot. Possible values are indices or :attr:`surface`, :attr:`top` or :attr:`middle`. .. py:attribute:: latitudes :value: ['north', 'equator', 'south'] Latitudes to plot. Possible values are indices or :attr:`north`, :attr:`south` or :attr:`equator`. :attr:`north` is latitude :attr:`0`. .. py:attribute:: longitudes :value: ['day', 'terminator', 'night'] Longitudes to plot. Possible values are indices or :attr:`day`, :attr:`night` or :attr:`terminator`. :attr:`night` is longitude :attr:`0`. .. py:method:: figure(ax=None, figsize=None) :staticmethod: Simply create a figure. Returns a boolean 'save' on top of fig and ax, to know if we should save the figure or not. .. py:method:: plot_columns(func, latitudes=None, longitudes=None, name='plot', legend=None, figsize=None, nrows=None, ncols=None, title=None, *args, **kwargs) Iterate over vertical columns (lat,lon). .. py:method:: plot_column(ax, x, y, latitude=None, longitude=None, *args, **kwargs) Plot something at column (lat,lon). .. py:method:: save_column(label) .. py:method:: set_title(ax=None, title=None, *args, **kwargs) .. py:method:: legend(ax=None, fig=None, ncol=1, prop={'size': 11}, frameon=False, *args, **kwargs) .. py:method:: save_plot(name='plot', suffix=None, out_folder=None, interactive=None, *args, **kwargs) .. py:method:: legend2D(axes) .. py:method:: spectrum_label(mode) Label for 'spectra' plots. :param mode: Among transmission/emission/lightcurve/phasecurve. Defaults to transmission. :type mode: str .. py:method:: get_value_dim(index, dim) Returns the value at :attr:`index` in the dimension :attr:`dim`. :param index: Index of the value we're looking for. :type index: int :param dim: Dimension of the value we're looking for. Among "altitude", "latitude" or "longitude". :type dim: str .. py:method:: bin_down(resolution=200, spectrum=None, copy=True) .. py:method:: flux(mode=None, phase=None, wl=None, wn=None, resolution=None, noise=True, ax=None, color=None) Get flux (spectrum or curve) of a mode, with a resolution of N points, noised or not. Equal to :math:`(Rp/Rs)^2` (if normalized). :param mode: transmission/emission/lightcurve/phasecurve. Defaults to None. :type mode: str, optional :param phase: Phase(s) to select. Incompatible with `wl` or `wn`. Defaults to None. :type phase: array | float, optional :param wl: Wavelength to select. Incompatible with `phase` or `wn`. Defaults to None. :type wl: array | float, optional :param wl: Wavenumber to select. Incompatible with `phase` or `wl`. Defaults to None. :type wl: array | float, optional :param resolution: Number of points to bin to. Not used with `wl` or `wn`. Defaults to None. :type resolution: int, optional :param noise: Noise the spectrum? Defaults to True. :type noise: bool, optional :returns: flux (`exo_k.Spectrum`) of which the X axis is either wavelengths, or phases. .. py:method:: curve(mode=None, **kwargs) Returns light/phasecurve (as an array). Lightcurve is :math:`1-(Rp/Rs)^2`. .. py:method:: x_axis_curve(x_axis='phases', x_units=None, mode='lightcurve') .. py:method:: init_time(phase=None, time=None, time_units=None) .. py:method:: init_spectral(wl=None, wn=None, default_wl=15, mode=None) 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). :rtype: tuple .. py:method:: get_spectral(wl=None, wn=None, w_units=None, default_wl=15, mode=None) Choose which spectral units to plot (wavelengths or wavenumbers). .. py:method:: find_spectral(wl=None, wn=None, **kwargs) Find the index of spectral point equal to either wavelength `wl` or wavenumber `wn`. Defines :attr:`w_index`. .. py:method:: mode(mode) Returns 'mode' object (transmission/lightcurve/emission/phasecurve). Returns self if None. .. py:method:: getattr(mode, attr) Get attribute :attr:`attr` from mode :attr:`mode`. .. py:class:: LoadPlot Class to load HDF5 file or :attr:`model` attribute. Inherited by :class:`~pytmosph3r.plot.plot.Plot`. .. py:property:: model .. py:property:: atmosphere Dict. .. py:property:: wns .. py:property:: wnedges .. py:property:: spectrum .. py:property:: noised_spectrum .. py:property:: noise Planet radius. .. py:property:: grid .. py:property:: n_layers .. py:property:: n_levels .. py:property:: n_longitudes .. py:property:: n_latitudes .. py:property:: Rp Planet radius. .. py:property:: Rs Star radius. .. py:property:: R Planet radius scaled using :attr:`r_factor`. .. py:property:: z_idx .. py:property:: input_z .. py:property:: input_z_levels .. py:property:: z_levels .. py:property:: z .. py:property:: altitude .. py:property:: r .. py:property:: pressure .. py:property:: pressure_levels .. py:property:: p_min .. py:property:: temperature .. py:property:: gas_mix_ratio .. py:property:: aerosols .. py:property:: shape .. py:method:: set_mode_attr(mode) Set attributes for modes (emission/phasecurve/transmission/lightcurve), which have parameters both in Model and in Output. .. py:method:: transmission() .. py:method:: emission() .. py:method:: lightcurve() .. py:method:: phasecurve() .. py:method:: mode(mode) Returns 'mode' object (transmission/lightcurve/emission/phasecurve). Returns self if None. .. py:method:: transmittance(phase=None, wl=None, wn=None) .. py:method:: interp_transmittances(phase, wl=None, wn=None) .. py:method:: rays(mode='transmission') .. py:method:: close() .. py:function:: plot_sector_star(rS, aS, Rs, r, a, r_i=None, a_i=None, ax=None) Plot star at position (rS, aS), radius Rs over sector(s) with bounds r and a. r_i and a_i are (optional) intersection points with a and r, respectively.