Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicaluna committed Aug 17, 2021
2 parents 8567f3e + d0b2b9e commit c359061
Show file tree
Hide file tree
Showing 15 changed files with 2,215 additions and 757 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# `muler` (_μler_)
### version 0.0.3dev :construction: :construction_worker: :building_construction:

### version 0.1

<a href="https://muler.readthedocs.io/en/latest/"><img src="https://img.shields.io/badge/Read-the%20docs-blue"></a>
<a href="https://pypi.org/project/muler/"><img src="https://img.shields.io/badge/pip_install-muler-yellow"></a>
<a href="https://sites.google.com/site/igrinsatgemini/"><img src="https://img.shields.io/badge/Works_with-IGRINS-brightgreen"></a>
<a href="https://hpf.psu.edu/"><img src="https://img.shields.io/badge/Works_with-HPF-brightgreen"></a>
<a href="https://www2.keck.hawaii.edu/inst/nirspec/"><img src="https://img.shields.io/badge/Works_with-Keck_NIRSPEC-brightgreen"></a>
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](https://www.as.utexas.edu/astronomy/research/people/jaffe/igrins.html) or [HPF](https://hpf.psu.edu/) 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](https://en.wikipedia.org/wiki/Telluric_contamination) artifact and instrument-induced slopes stand out. Or maybe you want to apply a [barycentric correction](https://sites.psu.edu/astrowright/2014/09/16/barycentric-corrections-at-1-mms/) based on telescope pointing information, but you're not sure which [FITS header](https://docs.astropy.org/en/stable/io/fits/usage/headers.html) 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](https://pandas.pydata.org/docs/user_guide/index.html) dataframe, or estimate a coarse radial velocity based on a noise-free stellar [model atmosphere](https://en.wikipedia.org/wiki/Model_photosphere) 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.
Imagine you have just received data from the an echelle spectrograph like [IGRINS](https://www.as.utexas.edu/astronomy/research/people/jaffe/igrins.html) or [HPF](https://hpf.psu.edu/) 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](https://en.wikipedia.org/wiki/Telluric_contamination) artifact and instrument-induced slopes stand out. Or maybe you want to apply a [barycentric correction](https://sites.psu.edu/astrowright/2014/09/16/barycentric-corrections-at-1-mms/) based on telescope pointing information, but you're not sure which [FITS header](https://docs.astropy.org/en/stable/io/fits/usage/headers.html) 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](https://pandas.pydata.org/docs/user_guide/index.html) dataframe, or estimate a coarse radial velocity based on a noise-free stellar [model atmosphere](https://en.wikipedia.org/wiki/Model_photosphere) 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.

Typical spectral analyses becomes only 2 or 3 lines of `muler` code.
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:

Expand All @@ -30,14 +32,13 @@ ew = clean_spectrum.measure_ew(center_wavelength=10830.0)

### Installation: `pip` and development version

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

``` bash
```bash
pip install 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](https://muler.readthedocs.io/en/latest/install.html). Installing from source code empowers you to modify the code for your purposes.

`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](https://muler.readthedocs.io/en/latest/install.html). Installing from source code empowers you to modify the code for your purposes.

### Our mission and your help

Expand All @@ -47,4 +48,4 @@ That help can take many forms, even more creative outlets than most would guess.

### Spectrographs we currently support

We currently support the [IGRINS](https://www.as.utexas.edu/astronomy/research/people/jaffe/igrins.html) and [HPF](https://hpf.psu.edu/) spectrographs. These two near-IR echelle spectrographs are attached to some of the greatest telescopes in the world: [Gemini](https://www.gemini.edu/) and [HET](https://mcdonaldobservatory.org/research/telescopes/HET) respectively. They both have a connection to UT Austin, where the `muler` project got its start. HPF differs from IGRINS in its _precision radial velocity_ (PRV) design. 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, with [Keck NIRSPEC](https://www2.keck.hawaii.edu/inst/nirspec/) on our radar. One way to get a new instrument supported is to make a new GitHub [Issue](https://github.com/OttoStruve/muler/issues) to describe the instrument so other community members can join the conversation.
We currently support the [IGRINS](https://www.as.utexas.edu/astronomy/research/people/jaffe/igrins.html), [HPF](https://hpf.psu.edu/), and [NIRSPEC](https://www2.keck.hawaii.edu/inst/nirspec/) spectrographs. These three near-IR echelle spectrographs are attached to some of the greatest telescopes in the world: [Gemini](https://www.gemini.edu/), [HET](https://mcdonaldobservatory.org/research/telescopes/HET), and [Keck](https://www.keckobservatory.org/) respectively. HPF differs from IGRINS 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](https://github.com/OttoStruve/muler/issues) to describe the instrument an rationale for adding it to `muler` so other community members can join the conversation.
7 changes: 7 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ API

The API is under active development and should be considered a strawman design. Feedback is welcomed.

.. automodule:: muler.echelle
:members:

.. automodule:: muler.igrins
:members:

.. automodule:: muler.hpf
:members:


.. automodule:: muler.nirspec
:members:
1,032 changes: 1,032 additions & 0 deletions docs/tutorials/Combining_uncertainties_with_specutils.ipynb

Large diffs are not rendered by default.

107 changes: 88 additions & 19 deletions docs/tutorials/HPF_tutorial.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Getting started


Manipulate all spectral orders at once <All_spectral_orders.ipynb>

Combining uncertainties with specutils <Combining_uncertainties_with_specutils.ipynb>
7 changes: 3 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ dependencies:
- numpy
- scipy
- matplotlib
- astropy>=4.0
- astropy=4.1
- astroquery
- specutils # Manually install the dev version from GitHub
- specutils=1.3 # Manually install the dev version from GitHub
- tqdm
- pandas
- bokeh>=1.0
- bokeh=2.2.3
- jupyter
- ipython
- seaborn
- scikit-learn
- h5py # needed for `to_hdf5` method
- pytest
- sphinx # for documentation and testing
Expand Down
33 changes: 33 additions & 0 deletions environment_M1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: muler_dev
channels:
- conda-forge
- nodefaults
dependencies:
- python=3.8
- numpy
- scipy
- matplotlib
- astropy>=4.0
- astroquery
- specutils # Manually install the dev version from GitHub
- tqdm
- pandas
- bokeh>=1.0
- jupyter
- ipython
- seaborn
- scikit-learn
- h5py # needed for `to_hdf5` method
- pytest
- sphinx # for documentation and testing
- nbsphinx # for documentation and testing
- numpydoc # for documentation and testing
- sphinx-automodapi # for documentation and testing
- black
- isort
- tox
- pip
- pip:
- sphinx-material
- twine
- celerite2
13 changes: 11 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@

setuptools.setup(
name="muler",
version="0.0.2",
version="0.1",
author="gully",
author_email="igully@gmail.com",
description="A Python package for working with data from IGRINS and HPF",
long_description="A Python package for working with echelle spectra from IGRINS and HPF",
long_description_content_type="text/markdown",
url="https://github.com/OttoStruve/muler",
install_requires=["numpy", "scipy", "astropy", "specutils", "pandas", "celerite2", "matplotlib", "h5py"],
install_requires=[
"numpy",
"scipy",
"astropy",
"specutils",
"pandas",
"celerite2",
"matplotlib",
"h5py",
],
packages=setuptools.find_packages(where="src"),
package_dir={"": "src"},
classifiers=[
Expand Down
Loading

0 comments on commit c359061

Please sign in to comment.