muler Quickstart

[1]:
from muler.igrins import IGRINSSpectrum
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 from muler.igrins import IGRINSSpectrum

File ~/checkouts/readthedocs.org/user_builds/muler/envs/latest/lib/python3.8/site-packages/muler/igrins.py:15
     13 import json
     14 from matplotlib import pyplot as plt
---> 15 from muler.echelle import EchelleSpectrum, EchelleSpectrumList
     16 from muler.utilities import Slit, concatenate_orders, resample_list, roll_along_axis, edge_normalize, isolate_and_normalize_hi_order, round_to_multiple, photometry
     17 from astropy.time import Time

File ~/checkouts/readthedocs.org/user_builds/muler/envs/latest/lib/python3.8/site-packages/muler/echelle.py:31
     29 from scipy.ndimage import median_filter, gaussian_filter1d
     30 import specutils
---> 31 from muler.utilities import apply_numpy_mask, is_list, resample_list
     34 # from barycorrpy import get_BC_vel
     35 from astropy.coordinates import SkyCoord, EarthLocation

File ~/checkouts/readthedocs.org/user_builds/muler/envs/latest/lib/python3.8/site-packages/muler/utilities.py:15
     13 from astropy.convolution import convolve, Gaussian1DKernel
     14 from scipy.ndimage import binary_dilation
---> 15 from astroquery.simbad import Simbad
     16 Simbad.add_votable_fields('V', 'B', 'J', 'H', 'K', 'parallax')
     17 LinInterpResampler = LinearInterpolatedResampler()

ModuleNotFoundError: No module named 'astroquery'

Simply pass in a path to an IGRINS Spectrum. You can download some example data from the standalone and free-to-use muler_example_data.

[2]:
! pwd
/home/docs/checkouts/readthedocs.org/user_builds/muler/checkouts/latest/docs
[3]:
! ls
Makefile  broader_ecosystem.rst  make.bat                  tutorials
_build    conf.py                quickstart.ipynb
_static   index.rst              requirements.txt
api.rst   install.rst            requirements_actions.txt
[4]:
path = 'https://github.com/OttoStruve/muler_example_data/raw/main/IGRINS/01_IGRINS_test_data/'
filename = 'SDCH_20201202_0059.spec_a0v.fits'
spec = IGRINSSpectrum(file=path+filename)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[4], line 3
      1 path = 'https://github.com/OttoStruve/muler_example_data/raw/main/IGRINS/01_IGRINS_test_data/'
      2 filename = 'SDCH_20201202_0059.spec_a0v.fits'
----> 3 spec = IGRINSSpectrum(file=path+filename)

NameError: name 'IGRINSSpectrum' is not defined

Normalize the spectrum by the median:

[5]:
%%capture
normalized_spectrum = spec.normalize()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[5], line 1
----> 1 normalized_spectrum = spec.normalize()

NameError: name 'spec' is not defined

The spectrum has wavelength, with units:

[6]:
normalized_spectrum.wavelength
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[6], line 1
----> 1 normalized_spectrum.wavelength

NameError: name 'normalized_spectrum' is not defined

The flux vector is the same length as wavelength:

[7]:
normalized_spectrum.flux.dtype, normalized_spectrum.shape
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[7], line 1
----> 1 normalized_spectrum.flux.dtype, normalized_spectrum.shape

NameError: name 'normalized_spectrum' is not defined
[ ]: