Working with all spectral orders

In muler you can load all spectral orders into an IGRINSSpectrumList.

[1]:
%config Completer.use_jedi = False
[2]:
from muler.igrins import IGRINSSpectrum, IGRINSSpectrumList
from specutils import Spectrum1D, SpectrumList
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format='retina'
Simply tell the IGRINS Spectrum where your file is located.
We will use the data stored in muler_example_data, but the path could be a local directory instead.
[3]:
path = 'https://github.com/OttoStruve/muler_example_data/raw/main/IGRINS/01_IGRINS_test_data/'
filename='SDCH_20201202_0059.spec_a0v.fits'
full_path = path + filename
[4]:
spec_list = IGRINSSpectrumList.read(full_path).normalize()
[5]:
spec_list.remove_nans().trim_edges().normalize(order_index=10).plot(color=None, ylo=0, yhi=2);
../_images/tutorials_All_spectral_orders_7_0.png

You can save each spectral order as an HDF5 file:

[6]:
save_files = False

if save_files:
    spec_list.remove_nans().trim_edges().to_HDF5(path='./', file_basename='demo2')