Giter Club home page Giter Club logo

spectools's Introduction

spectools

v24.156.0

Developer: Tom Seccull

This is a personal collection of scripts I that use for reduction, processing, and analysis of astronomical spectroscopic data. I cannot make any guarantees that this software will either work, or be useful to others. Updates to these scripts may arrive in this repo randomly and without warning. Those that choose to use these scripts do so at their own risk. At very least, the shebang Python path at the top of each script should be updated to match the Python path in your system. Support from me may be limited. If, against all odds, any of the scripts in this repo end up being useful in your work, please consider citing the repo with the details provided in the CITATION.cff file. A Zenodo DOI may be obtained for this repo at some point in the future.

The scripts in this repo rely on other Python packages that deserve recognition if they are used. Please be sure to cite these as well where necessary:

Astropy, Matplotlib, NumPy, SciPy

scrap.py

v1.0.6

This is essentially a Python wrapper for Astropy's Astroscrappy, which is itself a Python implementation of Pieter van Dokkum's LA Cosmic. This script is used for detecting, masking, and cleaning cosmic ray hits in 2D spectroscopic data. A modular design is intended to facilitate easy processing of data observed with a variety of instruments. If Astroscrappy is used, both McCully et al., and van Dokkum should be cited:

Astroscrappy Docs

McCully et al. 2018, Astropy/Astroscrappy: v1.0.5 Zenodo Release (v1.0.5). Zenodo

van Dokkum 2001, PASP, 113, 1420

Requires: Astropy, Astroscrappy, NumPy, SciPy
Supported Instruments: GMOS-N, GMOS-S

fronge.py

v1.0.3

This script is designed to correct fringing in 2D spectroscopic data by creating a median fringe frame and subtracting it from science data. A modular design is intended to facilitate easy processing of data observed with a variety of instruments.

Requires: Astropy, NumPy
Supported Instruments: GMOS-N, GMOS-S

extinct.py

v1.0.0

This script applies an average extinction correction to input 1D astronomical spectroscopic data based on the measured atmospheric extinction curve of the observing site. The spectrum and its uncertainties are each multiplied by 10 ^ (0.4 * airmass * k(lambda)), where airmass is the median airmass at which the spectrum was observed and k(lambda) is the wavelength dependent extinction curve at the observing site given in magnitudes per unit airmass. Note that the extinction curves used here are averages that do not account for variable atmospheric extinction due to variable concentrations of atmospheric water vapour or scattering particles. When comparing or calibrating one corrected spectrum with another it is assumed that atmospheric conditions were stable across the consecutive observations of both targets. This script does not create new files, but instead just updates the input files. If this script is used, be sure to cite the appropriate article or link for the extinction curve. extinct.py is only readily compatible with spectra extracted by MOTES.

Requires: Astropy, Matplotlib, NumPy
Supported Instruments: GMOS-N, GMOS-S

Extinction Curve Sources:
GMOS-N - See the Gemini Observatory web pages.
GMOS-S - Stone & Baldwin 1983, MNRAS, 204, 347

stack.py

v1.0.2

This script takes multiple 1D spectra and combines them to produce a stacked 1D spectrum with reduced noise. All input spectra are scaled to unity at either a user-selected wavelength or the central wavelength of the spectra. The spectra are then all randomly resampled within their uncertainties to estimate the total combined distribution of possible values for each wavelength in the stacked spectrum. The uncertainty distribution of each data point in each spectrum is assumed to be Gaussian with the mean defined by the value of the data point and the standard deviation defined by its uncertainty. For the resulting distribution of resampled points at each wavelength element, its mean and median are found to be within one standard error of the mean from each other in almost all cases. Given its close proximity to the mean and its robustness against outliers, the median of the combined distribution in each wavelength element is taken as the value of the stacked spectrum at that wavelength. The standard error of the mean of the distribution is taken to be the uncertainty each stacked data point. stack.py is only readily compatible with spectra extracted by MOTES.

Requires: Astropy, Matplotlib, NumPy
Supported Instruments: GMOS-N, GMOS-S

divide.py

v0.0.5 - Under development

This script divides one 1D spectrum by another. divide.py expects both spectra to have a common wavelength axis and be the product of both extraction by MOTES and stacking by stack.py. Typical use of this script is to calibrate a spectrum of a minor planet with that of a solar twin or solar analog to derive the minor planet's reflectance spectrum.

Requires: Astropy, Matplotlib, NumPy

License

All scripts in this repo are licensed under GNU GPLv3

spectools's People

Contributors

tseccull avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.