Skip to content

Commit

Permalink
Merge pull request #338 from bsipocz/MAINT_adding_spec_requirements
Browse files Browse the repository at this point in the history
MAINT: adding specroscopy requirements file
  • Loading branch information
bsipocz authored Sep 19, 2024
2 parents 2c78384 + 22dd910 commit e5bf2dd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 25 deletions.
10 changes: 10 additions & 0 deletions spectroscopy/requirements_spectra_generator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# List explicit python dependencies here. They are also spelt out at the
# beginning of the notebook, make sure the lists are consistent and only
# contain dependencies that are actually used in the notebook.
numpy
matplotlib
pandas
sparclclient
astropy
specutils
astroquery
52 changes: 27 additions & 25 deletions spectroscopy/spectra_generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ kernelspec:
# Extract Multi-Wavelength Spectroscopy from Archival Data


## Learning Goals
## Learning Goals
By the end of this tutorial, you will be able to:

• automatically load a catalog of sources

• search NASA and non-NASA resources for fully reduced spectra and load them using specutils

• store the spectra in a Pandas multiindex dataframe

• plot all the spectra of a given source


## Introduction:

### Motivation
A user has a source (or a sample of sources) for which they want to obtain spectra covering ranges of wavelengths from the UV to the far-IR. The large amount of spectra available enables multi-wavelength spectroscopic studies, which is crucial to understand the physics of stars, galaxies, and AGN. However, gathering and analysing spectra is a difficult endeavor as the spectra are distributed over different archives and in addition they have different formats which complicates their handling. This notebook showcases a tool for the user to conveniently query the spectral archives and collect the spectra for a set of objects in a format that can be read in using common software such as the Python `specutils` package. For simplicity, we limit the tool to query already reduced and calibrated spectra.
The notebook may focus on the COSMOS field for now, which has a large overlap of spectroscopic surveys such as with SDSS, DESI, Keck, HST, JWST, Spitzer, and Herschel. In addition, the tool enables the capability to search and ingest spectra from Euclid and SPHEREx in the feature. For this to work, the `specutils` functions may have to be update or a wrapper has to be implemented.
A user has a source (or a sample of sources) for which they want to obtain spectra covering ranges of wavelengths from the UV to the far-IR. The large amount of spectra available enables multi-wavelength spectroscopic studies, which is crucial to understand the physics of stars, galaxies, and AGN. However, gathering and analysing spectra is a difficult endeavor as the spectra are distributed over different archives and in addition they have different formats which complicates their handling. This notebook showcases a tool for the user to conveniently query the spectral archives and collect the spectra for a set of objects in a format that can be read in using common software such as the Python `specutils` package. For simplicity, we limit the tool to query already reduced and calibrated spectra.
The notebook may focus on the COSMOS field for now, which has a large overlap of spectroscopic surveys such as with SDSS, DESI, Keck, HST, JWST, Spitzer, and Herschel. In addition, the tool enables the capability to search and ingest spectra from Euclid and SPHEREx in the feature. For this to work, the `specutils` functions may have to be update or a wrapper has to be implemented.


### List of Spectroscopic Archives and Status
Expand All @@ -56,15 +56,15 @@ The ones with an asterisk (*) are the challenging ones.
## Input:

• Coordinates for a single source or a sample on the COSMOS field



## Output:

• A Pandas data frame including the spectra from different facilities

• A plot comparing the different spectra extracted for each source

## Non-standard Imports:

• ...
Expand All @@ -88,22 +88,24 @@ Andreas Faisst, Jessica Krick, Shoubaneh Hemmati, Troy Raen, Brigitta Sipőcz, D
+++

### Datasets that were considered but didn't end up being used:
#### IRTF:
#### IRTF:
- https://irsa.ipac.caltech.edu/Missions/irtf.html \
- The IRTF is a 3.2 meter telescope, optimized for infrared observations, and located at the summit of Mauna Kea, Hawaiʻi. \
- large library of stellar spectra \
- Not included here because the data are not currently available in an easily accessible, searchable format


```{code-cell}
# Ensure all dependencies are installed

!pip install -r requirements.txt
## Imports

This cell will install them if needed:

```{code-cell}
# Uncomment the next line to install dependencies if needed.
# !pip install -r requirements_spectra_generator.txt
```

```{code-cell}
## IMPORTS
import sys, os
import sys
import numpy as np
import os
Expand Down Expand Up @@ -200,12 +202,12 @@ We search a curated list of NASA astrophysics archives. Because each archive is

### 2.1 IRSA Archive

This archive includes spectra taken by
This archive includes spectra taken by

• Keck

• Spitzer/IRS



```{code-cell}
Expand All @@ -224,10 +226,10 @@ df_spec.append(df_spec_IRS)

### 2.2 MAST Archive

This archive includes spectra taken by
This archive includes spectra taken by

• HST (including slit spectroscopy)

• JWST (including MSA and slit spectroscopy)

```{code-cell}
Expand All @@ -242,7 +244,7 @@ df_spec.append(df_spec_HST)
```{code-cell}
# Herschel PACS & SPIRE from ESA TAP using astroquery
#This search is fully functional, but is commented out because it takes ~4 hours to run to completion
herschel_radius = 1.1
herschel_radius = 1.1
herschel_download_directory = 'data/herschel'
#if not os.path.exists(herschel_download_directory):
Expand Down

0 comments on commit e5bf2dd

Please sign in to comment.