Python pipeline for Magellan/FIRE Prism-mode data
Project description
firepype
Python pipeline for Magellan/FIRE Prism-mode data. Experimental; validated on a limited dataset. Verify outputs against established pipelines (e.g. FireHose_v2).
Features
- Slit edge and object detection with robust heuristics
- Arc 1D extraction and line matching
- Robust Chebyshev dispersion solution with optional anchors
- Parity-aware A–B/B–A differencing and robust negative-beam scaling
- Footprint median extraction with error estimates
- Interpolation-edge masking and inverse-variance coaddition
- Telluric correction:
- POS-only standard extraction
- Band-wise scaling with deep-gap masking
- Vega model broadened to the instrument resolution
- Transmission (T) smoothing only inside dense contiguous regions
- Optional QA plots: arc overlays, labeled arc 1D, final coadd, telluric T(λ), corrected spectra
Installation
Installation (PyPi):
. .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install -U pip
pip install firepype
Alternatively, install from source:
. .venv/bin/activate
python -m pip install -U pip
git clone https://github.com/gemma-cheng/firepype
cd firepype
pip install -e .[dev]
Requirements:
- Python 3.10–3.12
- numpy ≥ 1.22, scipy ≥ 1.9, astropy ≥ 5.2, matplotlib ≥ 3.6
Quickstart
Minimal end-to-end reduction:
firepype \
--raw-dir /path/to/raw \
--out-dir ./out \
--arc /path/to/raw/fire_0123.fits \
--ref-list /path/to/ref/line_list.lst \
--spec "1-4, 10-7"
Telluric/response only:
firepype-telluric \
--standard ./out/standard_extracted.fits \
--out-dir ./out/telluric \
--stype A0V --plot
Outputs
- ./output/qa/ … if QA enabled
- Coadded spectrum FITS: wavelength_um, flux
- Telluric and response FITS in out/telluric/
Basic Tutorials
Basic usage tutorials can be found in the tutorials directory
Notes on telluric method
- Standard extraction: POS-only column, tuned aperture/background; alternative beam used if POS median is non-positive
- Wavecal: average across a small footprint around the chosen standard column, using ARC + line list
- Vega model: broadened to instrument resolution (R ~ 6000 by default) in log-λ space
- Continuum: robust Chebyshev fit to the standard/model ratio within each band (J/H/K), excluding deep telluric gaps and known A0V intrinsic lines; fit is used to normalize before deriving T
- Transmission T(λ): computed and lightly smoothed only within dense contiguous support (prevents spreading across gaps)
- Application: science flux and errors are divided by T within overlap where T_min ≤ T ≤ T_max; elsewhere, values are left as NaN to avoid artifacts
Limitations and validation
- Tested on a limited set of FIRE Prism-mode observations; results are not guaranteed.
- Validate outputs against established pipelines (e.g. FireHose_v2):
- Wavelength RMS per region
- Sky residuals around OH lines
- Merged-order continuity
- S/N consistency
License
MIT (see LICENSE).
File Structure
firepype/__init__.py— package API (exposesrun_ab_pairs,apply_telluric_correction)config.py— dataclasses for configurationio.py— FITS I/O, path builders, ID pairingutils.py— math helpers, masks, line-list loadercalibration.py— peak detection, line matching, dispersion solverdetection.py— slit/object detection, parity, negative scalingextraction.py— 1D extraction routinescoadd.py— coaddition accumulatorplotting.py— optional QA plottingpipeline.py— high-level AB-pair orchestrationtelluric.py— telluric correction APIcli.py— command-line interface (pipeline + telluric subcommand if enabled)
tests/— minimal tests for core functionalitypyproject.toml— packaging configurationREADME.md— this fileLICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file firepype-0.0.3.tar.gz.
File metadata
- Download URL: firepype-0.0.3.tar.gz
- Upload date:
- Size: 44.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f70e98469c7ff0f1ea84fb4fe91b1a75fcab00f421e5fc52e4f4cf2e8bc206f
|
|
| MD5 |
74517901c287086aba18133caa113f69
|
|
| BLAKE2b-256 |
3d1ceee42a4300bf6450c5db0cf4ac0bbf7311a44b9c15b20c7a3db2062b3d59
|
Provenance
The following attestation bundles were made for firepype-0.0.3.tar.gz:
Publisher:
python-publish.yml on gemma-cheng/firepype
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
firepype-0.0.3.tar.gz -
Subject digest:
1f70e98469c7ff0f1ea84fb4fe91b1a75fcab00f421e5fc52e4f4cf2e8bc206f - Sigstore transparency entry: 909217670
- Sigstore integration time:
-
Permalink:
gemma-cheng/firepype@7e2bc78456091db84fb3f3cb8fe742d1b3cef179 -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/gemma-cheng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7e2bc78456091db84fb3f3cb8fe742d1b3cef179 -
Trigger Event:
release
-
Statement type:
File details
Details for the file firepype-0.0.3-py3-none-any.whl.
File metadata
- Download URL: firepype-0.0.3-py3-none-any.whl
- Upload date:
- Size: 47.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7268888cf94c209d11d4f8f09cf464804ec647582219b848567d45a4f4a2a558
|
|
| MD5 |
8aeb17454db8864ae3824f4bae8e4334
|
|
| BLAKE2b-256 |
77dbc08c7603a3b717f25e2b0c78977718b6cf26bf0c515abccdebe43751578c
|
Provenance
The following attestation bundles were made for firepype-0.0.3-py3-none-any.whl:
Publisher:
python-publish.yml on gemma-cheng/firepype
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
firepype-0.0.3-py3-none-any.whl -
Subject digest:
7268888cf94c209d11d4f8f09cf464804ec647582219b848567d45a4f4a2a558 - Sigstore transparency entry: 909217674
- Sigstore integration time:
-
Permalink:
gemma-cheng/firepype@7e2bc78456091db84fb3f3cb8fe742d1b3cef179 -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/gemma-cheng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7e2bc78456091db84fb3f3cb8fe742d1b3cef179 -
Trigger Event:
release
-
Statement type: