species.plot package

Submodules

species.plot.plot_color module

Module with functions for creating color-magnitude and color-color plot.

species.plot.plot_color.plot_color_color(boxes, objects=None, mass_labels=None, teff_labels=None, companion_labels=False, field_range=None, label_x='Color (mag)', label_y='Color (mag)', xlim=None, ylim=None, offset=None, legend='upper left', output='color-color.pdf')[source]

Function for creating a color-color diagram.

Parameters:
  • boxes (list(species.core.box.ColorColorBox, species.core.box.IsochroneBox, )) – Boxes with the color-color and isochrone data from photometric libraries, spectral libraries, and/or atmospheric models. The synthetic data have to be created with get_color_color(). These boxes contain synthetic colors for a given age and a range of masses.
  • objects (tuple(tuple(str, str, str, str), ),) – tuple(tuple(str, str, str, str, str, str, dict, dict), ), None Tuple with individual objects. The objects require a tuple with their database tag, the two filter names for the first color, and the two filter names for the second color. Optionally, a dictionary with keyword arguments can be provided for the object’s marker and label, respectively. For example, {'marker': 'o', 'ms': 10} for the marker and {'ha': 'left', 'va': 'bottom', 'xytext': (5, 5)}) for the label. Not used if set to None.
  • mass_labels (list(float, ), list(tuple(float, str), ), None) – Plot labels with masses next to the isochrone data of models. The list with masses has to be provided in Jupiter mass. Alternatively, a list of tuples can be provided with the planet mass and position of the label (‘left’ or ‘right), for example [(10., 'left'), (20., 'right')]. No labels are shown if set to None.
  • teff_labels (list(float, ), list(tuple(float, str), ), None) – Plot labels with temperatures (K) next to the synthetic Planck photometry. Alternatively, a list of tuples can be provided with the planet mass and position of the label (‘left’ or ‘right), for example [(1000., 'left'), (1200., 'right')]. No labels are shown if set to None.
  • companion_labels (bool) – Plot labels with the names of the directly imaged companions.
  • field_range (tuple(str, str), None) – Range of the discrete colorbar for the field dwarfs. The tuple should contain the lower and upper value (‘early M’, ‘late M’, ‘early L’, ‘late L’, ‘early T’, ‘late T’, ‘early Y). The full range is used if set to None.
  • label_x (str) – Label for the x-axis.
  • label_y (str) – Label for the y-axis.
  • output (str) – Output filename.
  • xlim (tuple(float, float)) – Limits for the x-axis.
  • ylim (tuple(float, float)) – Limits for the y-axis.
  • offset (tuple(float, float), None) – Offset of the x- and y-axis label.
  • legend (str) – Legend position.
Returns:

None

Return type:

NoneType

species.plot.plot_color.plot_color_magnitude(boxes, objects=None, mass_labels=None, teff_labels=None, companion_labels=False, field_range=None, label_x='Color (mag)', label_y='Absolute magnitude (mag)', xlim=None, ylim=None, offset=None, legend='upper left', output='color-magnitude.pdf')[source]

Function for creating a color-magnitude diagram.

Parameters:
  • boxes (list(species.core.box.ColorMagBox, species.core.box.IsochroneBox, )) – Boxes with the color-magnitude and isochrone data from photometric libraries, spectral libraries, and/or atmospheric models. The synthetic data have to be created with get_color_magnitude(). These boxes contain synthetic colors and magnitudes for a given age and a range of masses.
  • objects (tuple(tuple(str, str, str, str), ),) – tuple(tuple(str, str, str, str, str, str, dict, dict), ), None Tuple with individual objects. The objects require a tuple with their database tag, the two filter names for the color, and the filter names for the absolute magnitude. Optionally, a dictionary with keyword arguments can be provided for the object’s marker and label, respectively. For example, {'marker': 'o', 'ms': 10} for the marker and {'ha': 'left', 'va': 'bottom', 'xytext': (5, 5)}) for the label. Not used if set to None.
  • mass_labels (list(float, ), list(tuple(float, str), ), None) – Plot labels with masses next to the isochrone data of models. The list with masses has to be provided in Jupiter mass. Alternatively, a list of tuples can be provided with the planet mass and position of the label (‘left’ or ‘right), for example [(10., 'left'), (20., 'right')]. No labels are shown if set to None.
  • teff_labels (list(float, ), list(tuple(float, str), ), None) – Plot labels with temperatures (K) next to the synthetic Planck photometry. Alternatively, a list of tuples can be provided with the planet mass and position of the label (‘left’ or ‘right), for example [(1000., 'left'), (1200., 'right')]. No labels are shown if set to None.
  • companion_labels (bool) – Plot labels with the names of the directly imaged companions.
  • field_range (tuple(str, str), None) – Range of the discrete colorbar for the field dwarfs. The tuple should contain the lower and upper value (‘early M’, ‘late M’, ‘early L’, ‘late L’, ‘early T’, ‘late T’, ‘early Y). The full range is used if set to None.
  • label_x (str) – Label for the x-axis.
  • label_y (str) – Label for the y-axis.
  • xlim (tuple(float, float), None) – Limits for the x-axis. Not used if set to None.
  • ylim (tuple(float, float), None) – Limits for the y-axis. Not used if set to None.
  • offset (tuple(float, float), None) – Offset of the x- and y-axis label.
  • legend (str, None) – Legend position. Not shown if set to None.
  • output (str) – Output filename.
Returns:

None

Return type:

NoneType

species.plot.plot_mcmc module

Module for plotting MCMC results.

species.plot.plot_mcmc.plot_photometry(tag, filter_id, burnin=None, xlim=None, output='photometry.pdf')[source]

Function to plot the posterior distribution of the synthetic photometry.

Parameters:
  • tag (str) – Database tag with the MCMC samples.
  • filter_id (str) – Filter ID.
  • burnin (int, None) – Number of burnin steps to exclude. All samples are used if set to None.
  • xlim (tuple(float, float), None) – Axis limits. Automatically set if set to None.
  • output (strr) – Output filename.
Returns:

None

Return type:

NoneType

species.plot.plot_mcmc.plot_posterior(tag, burnin=None, title=None, offset=None, title_fmt='.2f', limits=None, max_posterior=False, output='posterior.pdf')[source]

Function to plot the posterior distribution.

Parameters:
  • tag (str) – Database tag with the MCMC samples.
  • burnin (int, None) – Number of burnin steps to exclude. All samples are used if set to None.
  • title (str, None) – Plot title.
  • offset (tuple(float, float), None) – Offset of the x- and y-axis label.
  • title_fmt (str) – Format of the median and error values.
  • limits (tuple(tuple(float, float), ), None) – Axis limits of all parameters. Automatically set if set to None.
  • max_posterior (bool) – Plot the position of the sample with the maximum posterior probability.
  • output (str) – Output filename.
Returns:

None

Return type:

NoneType

species.plot.plot_mcmc.plot_walkers(tag, nsteps=None, offset=None, output='walkers.pdf')[source]

Function to plot the step history of the walkers.

Parameters:
  • tag (str) – Database tag with the MCMC samples.
  • nsteps (int, None) – Number of steps that are plotted.
  • offset (tuple(float, float), None) – Offset of the x- and y-axis label. Not used if set to None.
  • output (str) – Output filename.
Returns:

None

Return type:

NoneType

species.plot.plot_spectrum module

Module with a function for plotting spectra.

species.plot.plot_spectrum.plot_spectrum(boxes, filters=None, residuals=None, colors=None, xlim=None, ylim=None, ylim_res=None, scale=('linear', 'linear'), title=None, offset=None, legend=None, figsize=(7.0, 5.0), object_type='planet', quantity='flux', output='spectrum.pdf')[source]
Parameters:
  • boxes (list(species.core.box, )) – Boxes with data.
  • filters (list(str, ), None) – Filter IDs for which the transmission profile is plotted. Not plotted if set to None.
  • residuals (species.core.box.ResidualsBox, None) – Box with residuals of a fit. Not plotted if set to None.
  • colors (list(str, ), None) – Colors to be used for the different boxes. Note that a box with residuals requires a tuple with two colors (i.e., for the photometry and spectrum). Automatic colors are used if set to None.
  • xlim (tuple(float, float)) – Limits of the wavelength axis.
  • ylim (tuple(float, float)) – Limits of the flux axis.
  • ylim_res (tuple(float, float), None) – Limits of the residuals axis. Automatically chosen (based on the minimum and maximum residual value) if set to None.
  • scale (tuple(str, str)) – Scale of the axes (‘linear’ or ‘log’).
  • title (str) – Title.
  • offset (tuple(float, float)) – Offset for the label of the x- and y-axis.
  • legend (str, tuple, dict, None) – Location of the legend (str, tuple) or a dictionary with the **kwargs of matplotlib.pyplot.legend, e.g. {'loc': 'upper left', 'fontsize: 12.}.
  • figsize (tuple(float, float)) – Figure size.
  • object_type (str) – Object type (‘planet’ or ‘star’). With ‘planet’, the radius and mass are expressed in Jupiter units. With ‘star’, the radius and mass are expressed in solar units.
  • quantity (str) – The quantity of the y-axis (‘flux’ or ‘magnitude’).
  • output (str) – Output filename.
Returns:

None

Return type:

NoneType

Module contents