plotting

This module contains a general set of plotting methods for that are inherited by the different classes of PBjam, so that they can be used to show the status of each step that has been performed.

pbjam.plotting.echelle(freq, power, dnu, fmin=0.0, fmax=None, offset=0.0, sampling=0.001)[source]

Calculates the echelle diagram. Use this function if you want to do some more custom plotting.

Parameters:
  • freq (array-like) – Frequency values

  • power (array-like) – Power values for every frequency

  • dnu (float) – Value of deltanu

  • fmin (float, optional) – Minimum frequency to calculate the echelle at, by default 0.

  • fmax (float, optional) – Maximum frequency to calculate the echelle at. If none is supplied, will default to the maximum frequency passed in freq, by default None

  • offset (float, optional) – An offset to apply to the echelle diagram, by default 0.0

Returns:

The x, y, and z values of the echelle diagram.

Return type:

array-like

pbjam.plotting.plot_echelle(freq, power, numax, dnu, ax=None, cmap='Blues', scale=None, interpolation=None, smooth=False, smooth_filter_width=50, offset=0.0, **kwargs)[source]

Plots the echelle diagram.

Parameters:
  • freq (numpy array) – Frequency values

  • power (array-like) – Power values for every frequency

  • dnu (float) – Value of deltanu

  • ax (matplotlib.axes._subplots.AxesSubplot, optional) – A matplotlib axes to plot into. If no axes is provided, a new one will be generated, by default None

  • cmap (str, optional) – A matplotlib colormap, by default ‘BuPu’

  • scale (str, optional) – either ‘sqrt’ or ‘log’ or None. Scales the echelle to bring out more features, by default ‘sqrt’

  • interpolation (str, optional) – Type of interpolation to perform on the echelle diagram through matplotlib.pyplot.imshow, by default ‘none’

  • smooth_filter_width (float, optional) – Amount by which to smooth the power values, using a Box1DKernel

  • **kwargs (dict) – Dictionary of arguments to be passed to echelle.echelle

Returns:

The plotted echelle diagram on the axes

Return type:

matplotlib.axes._subplots.AxesSubplot

class pbjam.plotting.plotting[source]

Class inherited by PBjam modules to plot results

This is used to standardize the plots produced at various steps of the peakbagging process.

The methods will plot the relevant result based on the class they are being called from.

reference(stage='posterior', ID=None)[source]

Make a corner plot of the prior sample with relevant overplotted values.

pbjam.plotting.smooth_power(freq, power, smooth_filter_width)[source]

Smooths the input power array with a Box1DKernel from astropy :param power: Array of power values :type power: array-like :param smooth_filter_width: filter width :type smooth_filter_width: float

Returns:

Smoothed power

Return type:

array-like