multiplot_spectra

msaexp.spectrum.multiplot_spectra(file='smacs0723-ero-v4_g395m-f290lp_2736_6355.spec.fits', ny=8, z=None, log_steps=True, wave_limits=None, renorm=True, extra='', spline_step=64, gratings=[], trim_empty_axes=True, grating_colors={'G140H': 'lightblue', 'G140M': 'steelblue', 'G235H': 'gold', 'G235M': 'goldenrod', 'G395H': 'coral', 'G395M': 'tomato', 'PRISM': 'purple'}, **kwargs)[source]

Query and plot overlapping spectra

Parameters
filestr

Parent DJA spectrum filename

spline_stepint, None

Number of spline components to use for continuum fit

Returns
resultdict

Output figure and spectrum objects from the query

Examples

from msaexp import spectrum
import msaexp.utils

result = spectrum.multiplot_spectra(
    file="smacs0723-ero-v4_g395m-f290lp_2736_6355.spec.fits",
    sx=8, sy=2,
    ny=4,
)

# Overplot line list
li = msaexp.utils.lines.LineList()
for ax in result['axes']:
    li.add_to_axis(ax, alpha=0.5)

result['axes'][-1].set_xlabel(
    f"rest wavelength, z={result['z']:.3f}"
)

result['fig'].tight_layout(pad=1)

(Source code)