SpectrographsProperties

class popurri.spectrograph.SpectrographsProperties(dirout='./', filprop='/home/docs/checkouts/readthedocs.org/user_builds/popurri/envs/latest/lib/python3.9/site-packages/popurri/./data/spectrograph/spectrograph_properties.csv')

Bases: object

General properties of spectrographs.

Attributes:
datapd.DataFrame

Spectrograph properties read from file.

diroutstr

Output directory to save files and figures.

Methods

Methods Summary

fig_wrange([filout, sh, sv, style])

Plot the wavelength range of the spectrograph.

plot_wrange_line([ax, xunit, xlabel, ...])

Plot the wavelength range for each instrument.

plot_wrange_rectangle([ax, xunit, xlabel, ...])

Plot the wavelength range for each instrument.

Methods Documentation

fig_wrange(filout=None, sh=False, sv=True, style='rectangle', **kwargs)

Plot the wavelength range of the spectrograph.

Parameters:
filoutstr, optional

The output file path to save the figure. If not provided, the figure will be saved in the directory specified by self.dirout with the filename inst_wrange.pdf.

shbool, optional

If True, display the figure using plt.show(). Default is False.

svbool, optional

If True, save the figure. Default is True.

style‘line’, ‘rectangle’, optional

Note: Thick lines (lw) can modify the wavelength range covered.

**kwargsdict, optional

Additional keyword arguments to be passed to self.plot_wrange().

Returns:
None
plot_wrange_line(ax=None, xunit='nm', xlabel=None, ylabel=None, title='', inst_in_plot=True, lisinst=None, yprop=None, cmap=None, va='bottom', lw=5)

Plot the wavelength range for each instrument.

Parameters:
axmatplotlib.axes.Axes, optional

The axes on which to plot. If not provided, the current axes will be used.

xunitstr, optional

The unit of the x-axis. Default is ‘nm’.

xlabelstr, optional

The label for the x-axis. If not provided, it will be generated based on the xunit.

ylabelstr, optional

The label for the y-axis.

titlestr, optional

The title of the plot.

inst_in_plotbool, optional

Whether to include the instrument acronym in the plot. Default is True. If False, it is recommended to add a legend.

lisinstlist, optional

A list of instrument names to plot. If not provided, all instruments will be plotted.

ypropstr, optional

The property to plot on the y-axis. If not provided, the y-axis will not be labeled.

cmapstr, optional

The colormap to use for coloring the lines. If not provided, lines will have a default color.

vastr or list, optional

The vertical alignment of the instrument acronym. If a list is provided, it should have the same length as lisinst. Default is ‘bottom’.

lwfloat, optional

The linewidth of the lines. Default is 5.

Returns:
axmatplotlib.axes.Axes

The axes on which the plot is created.

plot_wrange_rectangle(ax=None, xunit='nm', xlabel=None, ylabel=None, title='', inst_in_plot=True, lisinst=None, dyfrac=0.8, yprop=None, cmap=None, alpha=0.6, va='center')

Plot the wavelength range for each instrument.

Parameters:
axmatplotlib.axes.Axes, optional

The axes on which to plot. If not provided, the current axes will be used.

xunitstr, optional

The unit of the x-axis. Default is ‘nm’.

xlabelstr, optional

The label for the x-axis. If not provided, it will be generated based on the xunit.

ylabelstr, optional

The label for the y-axis.

titlestr, optional

The title of the plot.

inst_in_plotbool, optional

Whether to include the instrument acronym in the plot. Default is True. If False, it is recommended to add a legend.

lisinstlist, optional

A list of instrument names to plot. If not provided, all instruments will be plotted.

ypropstr, optional

The property to plot on the y-axis. If not provided, the y-axis will not be labeled.

cmapstr, optional

The colormap to use for coloring the lines. If not provided, lines will have a default color.

vastr or list, optional

The vertical alignment of the instrument acronym. If a list is provided, it should have the same length as lisinst. Default is ‘bottom’.

lwfloat, optional

The linewidth of the lines. Default is 5.

Returns:
axmatplotlib.axes.Axes

The axes on which the plot is created.