API documentation¶
Echelle plotting¶
- echelle.echelle.echelle(freq, power, dnu, fmin=0.0, fmax=None, offset=0.0, sampling=0.1)[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
- echelle.echelle.plot_echelle(freq, power, dnu, ax=None, cmap='Blues', scale=None, interpolation=None, smooth=False, smooth_filter_width=50, **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
Interactive echelle¶
- echelle.interact.interact_echelle(freq, power, dnu_min, dnu_max, step=None, cmap='BuPu', ax=None, smooth=False, smooth_filter_width=50.0, scale=None, return_coords=False, backend='bokeh', notebook_url='localhost:8888', plot_method='fast', sampling=2, **kwargs)[source]¶
Creates an interactive echelle environment with a variable deltanu slider. If you’re working in a Jupyter notebook/lab environment, you must call %matplotlib notebook before running this.
- Parameters
freq (np.array) – Array of frequencies in the amplitude or power spectrum
power (np.array) – Corresponding array of power values
dnu_min (float) – Minimum deltanu value for the slider
dnu_max (float) – Maximum deltanu value for the slider
step (float, optional) – Step size by which to increment or decrement the slider, by default the frequency spacing
cmap (matplotlib.colormap, optional) – Colormap for the echelle diagram, by default ‘BuPu’
ax (matplotlib.axis, optional) – axis object on which to plot. If none is passed, one will be created, by default None
smooth_filter_width (float, optional) – Size of the Box1DKernel which is convolved with the power to smooth the spectrum. 1 performs no smoothing, by default 50.
scale (str, optional) – either ‘sqrt’ or ‘log’ or None. Scales the echelle to bring out more features, by default ‘sqrt’
return_coords (bool, optional) – If True, this will bind mouseclick events to the interactive plot. Clicking on the plot will store the values of the frequencies at the click event, and return them in a list object, by default False
plot_method (str, 'fast' or 'slow') – Uses either the fast pcolormesh function, or the slower imshow function. pcolormesh is much faster, but does not support interpolation.
sampling (float) –
**kwargs (dict) – Dictionary of arguments to be passed to echelle.echelle
- Returns
A list of clicked frequencies if return_coords=True.
- Return type
list