Skip to main content

A Python package for working with data from various echelle spectrographs

Project description

muler (μler)

version 0.5.2

DOI DOI

example workflow

A Python package for analyzing pipeline-processed data from high resolution near-infrared echelle spectrographs.

The echelle spectrum problem

Imagine you have just received data from the an echelle spectrograph like IGRINS or HPF and you want to start science. Oftentimes you will get handed pipeline-reduced data from the observatory facility. When you examine the data you may notice some remaining instrumental signals: telluric contamination artifact and instrument-induced slopes stand out. Or maybe you want to apply a barycentric correction based on telescope pointing information, but you're not sure which FITS header columns to use when multiple are available. You may want to normalize, deblaze (a.k.a. flatten), and plot the spectrum, or populate the spectrum into a pandas dataframe, or estimate a coarse radial velocity based on a noise-free stellar model atmosphere or a standard star template. Or maybe you want to measure an equivalent width, with or without an error bar. All of these operations are relatively routine, but their application, order, and algorithm choice may depend on the science case, and therefore they cannot be built into a default pipeline: it is up to you---the scientist---to conduct these activities.

Muler is intended to reduce the friction of getting started with near-IR echelle spectroscopy. Typical spectral analyses become only 2 or 3 lines of compact muler code, rather than hundreds of cells of Jupyter notebooks just to load and post-process a spectrum.

Plotting a sky-subtracted, flattened spectrum:

spectrum = HPFSpectrum(file=file, order=15)
spectrum.remove_nans().sky_subtract().deblaze().normalize().plot()

Measuring an equivalent width:

spectrum = HPFSpectrum(file=file, order=15)
clean_spectrum = spectrum.remove_nans().sky_subtract().deblaze().normalize()
ew = clean_spectrum.measure_ew()

Installation: pip and development version

We currently offer seamless installation with pip and conda! You can install muler in one line with:

pip install muler

or

conda install -c conda-forge muler

muler constantly changes and benefits from new community contributions like yours. We therefore recommend the slightly more tedious installation from the raw source code described on our Installation webpage. Installing from source code empowers you to modify the code for your purposes.

Our mission and your help

muler is aimed at collecting common spectral analysis methods into one place, simplifying the interactive process of astronomical discovery. We want to reduce the perceived complexity of working with echelle spectra, so that scientists have more time to focus on frontier science problems. We aspire to become a tool that new and experienced astronomers alike come to use and rely upon. In order to achieve these goals we need community contributions from practitioners like you.

That help can take many forms, even more creative outlets than most would guess. A great and easy first step is to :star: our repo or subscribe to notifications so that you can stay up to date as our project evolves. Glance around our tutorials, overall documentation, and Issues pages. Join our welcoming community and help us build some cool tools to make astronomy slightly easier, more reproducible, and more fun.

Spectrographs we currently support

We currently support the IGRINS, IGRINS-2, HPF, and NIRSPEC spectrographs. These three near-IR echelle spectrographs are attached to some of the greatest telescopes in the world: The Harlan J. Smith 2.7m Telescope, Gemini, HET, and Keck respectively. HPF differs from IGRINS, IGRINS-2, and NIRSPEC in its precision radial velocity (PRV) design. It uses fibers instead of slits. We do not purport to address the extreme precision demands of the PRV community, but we anticipate our package is still useful to a wide range of HPF science use cases. We are open to supporting new spectrographs in the future, but at the present time we are focused on building, testing, and maintaining the core features for these three spectrographs before we add new ones. One way to get a new instrument supported is to make a new GitHub Issue to describe the instrument and rationale for adding it to muler, so other community members can join the conversation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

muler-0.5.2-py3-none-any.whl (8.8 MB view details)

Uploaded Python 3

File details

Details for the file muler-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: muler-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for muler-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c6ba0b77e74ae8a05057c7c2bc7fce1539f713deba6be9c4a75e240061c9e4cd
MD5 2c957eabe0d6b46d31441ef7496cc2bf
BLAKE2b-256 a041bbb51e8b361a7056be1371db3d4c27c02bcb5a49f0c598658acf71a412d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page