Skip to main content

SPEARS : SPARCL Pipeline for Emission-Absorption Line Retrieval and Spectroscopy

Project description

SPEARS - Sparcl Pipeline for Emission-Absorption Line Retrieval and Spectroscopy

This library aims to provide users with a quick, and easily scalable pipeline for spectroscopic analysis of spectra from the DESI-EDR accessed through the SPARCL API at NOIRLAB. Provides a list of spectral lines present in a given spectrum, along with other information outlined in spectro_analyze header. Specific usage of each function can be found under Features.

Features

Main Functionality

  • spectro_analyze(limit, save_as_fits=False): Returns a list of QTables (or .fits file if specified) with the following headers:

    • ‘Ion’ (str): The ion type present

    • ‘Ion Line Wavelength’ (float64, angstrom): The wavelength of the present spectral line

    • ‘Spectral Flux at Line’ (float64, 1 / (erg17 cm2 s Angstrom)): The model-spectral flux at the given spectral line wavelength

    • ‘Observed Deviation’ (float64, angstrom): The distance from the observed spectral line and the actual line

    • ‘Normalized Deviation’ (float64, dimensionless): The observed deviation divided by the spectral resolution at that given wavelength

    • meta={‘id’}: id of spectrum, identical to dict key

Sub-modules

  • fetch_sparcl_ids(limit): Fetches the first n SPARCL ids, based on the limit provided.

  • sparcl_ids_to_spectra(sparcl_ids): Takes SPARCL ids and returns a list of Spectrum1D objects with each spectra’s flux, redshifted-accounted wavelength, and SPARCL id.

  • normalize_spectra(model_spectra): Takes an array of Spectrum1D object(s) and returns the continuum normalized spectra for each (continuum derived by median-filter smoothing original spectrum).

  • norm_spectra_to_lines(normalized_spectra, save_as_fits=False): Takes an array of normalized spectra, and returns the present spectral lines (and other info specified in spectro_analyze) in each in a list of QTables, or .fits file if specified.

Requirements

As listed in setup.py:

  • astropy==6.0.0

  • numpy==1.26.3

  • scipy==1.12.0

  • sparclclient==1.2.1

  • specutils==1.12.0

  • Unidecode==1.3.8

Installation

$ [sudo] pip install SPEARS

Usage

Retrieving spectral analysis info from the first 5 spectra in the database:

from SPEARS import SPEARS

sparcl_ids = SPEARS.fetch_sparcl_ids(limit=5)

info = SPEARS.spectro_analyze(sparcl_ids)

Documentation

Full documentation will be later uploaded to my GitHub.

License

MIT License

Copyright (c) 2024 Justin Domagala-Tang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Acknowledgments

  • Full accreditation can be found on my GitHub.

  • Thanks to NOIRLAB for supplying their vast spectral data for free through SPARCL API.

Contact

Email: justindomagalatang@hotmail.com

Project details


Download files

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

Source Distribution

SPEARS-0.1.4.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

SPEARS-0.1.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file SPEARS-0.1.4.tar.gz.

File metadata

  • Download URL: SPEARS-0.1.4.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for SPEARS-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5d000dad6c780f8b14d126fdd6ddf9e911ecc879d9ffc6adefd0606d849e6744
MD5 4d9248875118c12fc51a2ac1b1d9ffe7
BLAKE2b-256 304aab5b7ef7dd43dd21d4533115c1669fa382c078ffc11b73f6e844964d7f80

See more details on using hashes here.

File details

Details for the file SPEARS-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: SPEARS-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for SPEARS-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6b83f18a519540089e421123832f5e29353d189683a269a383170791e159e2bf
MD5 dd67187dcafd911bbe207e619a4190e8
BLAKE2b-256 fb2592cb693a65add771656743503ef1f76ea8311c82e1aa30daca04f964ae35

See more details on using hashes here.

Supported by

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