firepype 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- firepype-0.0.1/LICENSE +21 -0
- firepype-0.0.1/PKG-INFO +153 -0
- firepype-0.0.1/README.md +120 -0
- firepype-0.0.1/firepype/__init__.py +27 -0
- firepype-0.0.1/firepype/calibration.py +520 -0
- firepype-0.0.1/firepype/cli.py +296 -0
- firepype-0.0.1/firepype/coadd.py +105 -0
- firepype-0.0.1/firepype/config.py +55 -0
- firepype-0.0.1/firepype/detection.py +517 -0
- firepype-0.0.1/firepype/extraction.py +198 -0
- firepype-0.0.1/firepype/io.py +248 -0
- firepype-0.0.1/firepype/pipeline.py +339 -0
- firepype-0.0.1/firepype/plotting.py +234 -0
- firepype-0.0.1/firepype/telluric.py +1401 -0
- firepype-0.0.1/firepype/utils.py +344 -0
- firepype-0.0.1/firepype.egg-info/PKG-INFO +153 -0
- firepype-0.0.1/firepype.egg-info/SOURCES.txt +27 -0
- firepype-0.0.1/firepype.egg-info/dependency_links.txt +1 -0
- firepype-0.0.1/firepype.egg-info/entry_points.txt +3 -0
- firepype-0.0.1/firepype.egg-info/requires.txt +14 -0
- firepype-0.0.1/firepype.egg-info/top_level.txt +2 -0
- firepype-0.0.1/pyproject.toml +63 -0
- firepype-0.0.1/setup.cfg +4 -0
- firepype-0.0.1/tests/test_cli_help.py +23 -0
- firepype-0.0.1/tests/test_config.py +28 -0
- firepype-0.0.1/tests/test_imports.py +5 -0
- firepype-0.0.1/tests/test_io.py +36 -0
- firepype-0.0.1/tests/test_utils.py +53 -0
- firepype-0.0.1/tests/test_version.py +6 -0
firepype-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gemma Cheng
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
firepype-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: firepype
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: FIRE AB-pair NIR reduction pipeline
|
|
5
|
+
Author: Gemma Cheng
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/gemma-cheng/firepype
|
|
8
|
+
Project-URL: Repository, https://github.com/gemma-cheng/firepype.git
|
|
9
|
+
Project-URL: Issues, https://github.com/gemma-cheng/firepype/issues
|
|
10
|
+
Keywords: astronomy,spectroscopy,FIRE,infrared,data-reduction
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: numpy>=1.22
|
|
20
|
+
Requires-Dist: scipy>=1.9
|
|
21
|
+
Requires-Dist: astropy>=5.2
|
|
22
|
+
Requires-Dist: matplotlib>=3.6
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
26
|
+
Requires-Dist: ruff; extra == "dev"
|
|
27
|
+
Requires-Dist: black; extra == "dev"
|
|
28
|
+
Requires-Dist: isort; extra == "dev"
|
|
29
|
+
Requires-Dist: mypy; extra == "dev"
|
|
30
|
+
Requires-Dist: build; extra == "dev"
|
|
31
|
+
Requires-Dist: twine; extra == "dev"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# firepype
|
|
35
|
+
|
|
36
|
+
Python pipeline for Magellan/FIRE Prism-mode data. Experimental; validated on a limited dataset. Verify outputs against established pipelines (e.g. [FireHose_v2](https://github.com/jgagneastro/FireHose_v2/)).
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
- Slit edge and object detection with robust heuristics
|
|
41
|
+
- Arc 1D extraction and line matching
|
|
42
|
+
- Robust Chebyshev dispersion solution with optional anchors
|
|
43
|
+
- Parity-aware A–B/B–A differencing and robust negative-beam scaling
|
|
44
|
+
- Footprint median extraction with error estimates
|
|
45
|
+
- Interpolation-edge masking and inverse-variance coaddition
|
|
46
|
+
- Telluric correction:
|
|
47
|
+
- POS-only standard extraction
|
|
48
|
+
- Band-wise scaling with deep-gap masking
|
|
49
|
+
- Vega model broadened to the instrument resolution
|
|
50
|
+
- Transmission (T) smoothing only inside dense contiguous regions
|
|
51
|
+
- Optional QA plots: arc overlays, labeled arc 1D, final coadd, telluric T(λ), corrected spectra
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
Installation (PyPi):
|
|
56
|
+
|
|
57
|
+
```python -m venv .venv
|
|
58
|
+
. .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
59
|
+
python -m pip install -U pip
|
|
60
|
+
pip install firepype
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Alternatively, install from source:
|
|
64
|
+
|
|
65
|
+
```python -m venv .venv
|
|
66
|
+
. .venv/bin/activate
|
|
67
|
+
python -m pip install -U pip
|
|
68
|
+
git clone https://github.com/gemma-cheng/firepype
|
|
69
|
+
cd firepype
|
|
70
|
+
pip install -e .[dev]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Requirements:
|
|
74
|
+
- Python 3.10–3.12
|
|
75
|
+
- numpy ≥ 1.22, scipy ≥ 1.9, astropy ≥ 5.2, matplotlib ≥ 3.6
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Quickstart
|
|
79
|
+
|
|
80
|
+
Minimal end-to-end reduction:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
firepype \
|
|
84
|
+
--raw-dir /path/to/raw \
|
|
85
|
+
--out-dir ./out \
|
|
86
|
+
--arc /path/to/raw/fire_0123.fits \
|
|
87
|
+
--ref-list /path/to/ref/line_list.lst \
|
|
88
|
+
--spec "1-4, 10-7"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Telluric/response only:
|
|
92
|
+
```
|
|
93
|
+
firepype-telluric \
|
|
94
|
+
--standard ./out/standard_extracted.fits \
|
|
95
|
+
--out-dir ./out/telluric \
|
|
96
|
+
--stype A0V --plot
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Outputs
|
|
100
|
+
- ./output/qa/ … if QA enabled
|
|
101
|
+
- Coadded spectrum FITS: wavelength_um, flux
|
|
102
|
+
- Telluric and response FITS in out/telluric/
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## Basic Tutorials
|
|
106
|
+
|
|
107
|
+
Basic usage tutorials can be found in the [`tutorials`](./tutorials/) directory
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Notes on telluric method
|
|
111
|
+
|
|
112
|
+
- Standard extraction: POS-only column, tuned aperture/background; alternative beam used if POS median is non-positive
|
|
113
|
+
- Wavecal: average across a small footprint around the chosen standard column, using ARC + line list
|
|
114
|
+
- Vega model: broadened to instrument resolution (R ~ 6000 by default) in log-λ space
|
|
115
|
+
- 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
|
|
116
|
+
- Transmission T(λ): computed and lightly smoothed only within dense contiguous support (prevents spreading across gaps)
|
|
117
|
+
- 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
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
## Limitations and validation
|
|
121
|
+
|
|
122
|
+
- Tested on a limited set of FIRE Prism-mode observations; results are not guaranteed.
|
|
123
|
+
- Validate outputs against established pipelines (e.g. [FireHose_v2](https://github.com/jgagneastro/FireHose_v2/)):
|
|
124
|
+
- Wavelength RMS per region
|
|
125
|
+
- Sky residuals around OH lines
|
|
126
|
+
- Merged-order continuity
|
|
127
|
+
- S/N consistency
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT (see [`LICENSE`](./LICENSE)).
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## File Structure
|
|
136
|
+
|
|
137
|
+
- `firepype/`
|
|
138
|
+
- `__init__.py` — package API (exposes `run_ab_pairs`, `apply_telluric_correction`)
|
|
139
|
+
- `config.py` — dataclasses for configuration
|
|
140
|
+
- `io.py` — FITS I/O, path builders, ID pairing
|
|
141
|
+
- `utils.py` — math helpers, masks, line-list loader
|
|
142
|
+
- `calibration.py` — peak detection, line matching, dispersion solver
|
|
143
|
+
- `detection.py` — slit/object detection, parity, negative scaling
|
|
144
|
+
- `extraction.py` — 1D extraction routines
|
|
145
|
+
- `coadd.py` — coaddition accumulator
|
|
146
|
+
- `plotting.py` — optional QA plotting
|
|
147
|
+
- `pipeline.py` — high-level AB-pair orchestration
|
|
148
|
+
- `telluric.py` — telluric correction API
|
|
149
|
+
- `cli.py` — command-line interface (pipeline + telluric subcommand if enabled)
|
|
150
|
+
- `tests/` — minimal tests for core functionality
|
|
151
|
+
- `pyproject.toml` — packaging configuration
|
|
152
|
+
- `README.md` — this file
|
|
153
|
+
- `LICENSE`
|
firepype-0.0.1/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# firepype
|
|
2
|
+
|
|
3
|
+
Python pipeline for Magellan/FIRE Prism-mode data. Experimental; validated on a limited dataset. Verify outputs against established pipelines (e.g. [FireHose_v2](https://github.com/jgagneastro/FireHose_v2/)).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Slit edge and object detection with robust heuristics
|
|
8
|
+
- Arc 1D extraction and line matching
|
|
9
|
+
- Robust Chebyshev dispersion solution with optional anchors
|
|
10
|
+
- Parity-aware A–B/B–A differencing and robust negative-beam scaling
|
|
11
|
+
- Footprint median extraction with error estimates
|
|
12
|
+
- Interpolation-edge masking and inverse-variance coaddition
|
|
13
|
+
- Telluric correction:
|
|
14
|
+
- POS-only standard extraction
|
|
15
|
+
- Band-wise scaling with deep-gap masking
|
|
16
|
+
- Vega model broadened to the instrument resolution
|
|
17
|
+
- Transmission (T) smoothing only inside dense contiguous regions
|
|
18
|
+
- Optional QA plots: arc overlays, labeled arc 1D, final coadd, telluric T(λ), corrected spectra
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
Installation (PyPi):
|
|
23
|
+
|
|
24
|
+
```python -m venv .venv
|
|
25
|
+
. .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
26
|
+
python -m pip install -U pip
|
|
27
|
+
pip install firepype
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Alternatively, install from source:
|
|
31
|
+
|
|
32
|
+
```python -m venv .venv
|
|
33
|
+
. .venv/bin/activate
|
|
34
|
+
python -m pip install -U pip
|
|
35
|
+
git clone https://github.com/gemma-cheng/firepype
|
|
36
|
+
cd firepype
|
|
37
|
+
pip install -e .[dev]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Requirements:
|
|
41
|
+
- Python 3.10–3.12
|
|
42
|
+
- numpy ≥ 1.22, scipy ≥ 1.9, astropy ≥ 5.2, matplotlib ≥ 3.6
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Quickstart
|
|
46
|
+
|
|
47
|
+
Minimal end-to-end reduction:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
firepype \
|
|
51
|
+
--raw-dir /path/to/raw \
|
|
52
|
+
--out-dir ./out \
|
|
53
|
+
--arc /path/to/raw/fire_0123.fits \
|
|
54
|
+
--ref-list /path/to/ref/line_list.lst \
|
|
55
|
+
--spec "1-4, 10-7"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Telluric/response only:
|
|
59
|
+
```
|
|
60
|
+
firepype-telluric \
|
|
61
|
+
--standard ./out/standard_extracted.fits \
|
|
62
|
+
--out-dir ./out/telluric \
|
|
63
|
+
--stype A0V --plot
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Outputs
|
|
67
|
+
- ./output/qa/ … if QA enabled
|
|
68
|
+
- Coadded spectrum FITS: wavelength_um, flux
|
|
69
|
+
- Telluric and response FITS in out/telluric/
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Basic Tutorials
|
|
73
|
+
|
|
74
|
+
Basic usage tutorials can be found in the [`tutorials`](./tutorials/) directory
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Notes on telluric method
|
|
78
|
+
|
|
79
|
+
- Standard extraction: POS-only column, tuned aperture/background; alternative beam used if POS median is non-positive
|
|
80
|
+
- Wavecal: average across a small footprint around the chosen standard column, using ARC + line list
|
|
81
|
+
- Vega model: broadened to instrument resolution (R ~ 6000 by default) in log-λ space
|
|
82
|
+
- 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
|
|
83
|
+
- Transmission T(λ): computed and lightly smoothed only within dense contiguous support (prevents spreading across gaps)
|
|
84
|
+
- 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
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Limitations and validation
|
|
88
|
+
|
|
89
|
+
- Tested on a limited set of FIRE Prism-mode observations; results are not guaranteed.
|
|
90
|
+
- Validate outputs against established pipelines (e.g. [FireHose_v2](https://github.com/jgagneastro/FireHose_v2/)):
|
|
91
|
+
- Wavelength RMS per region
|
|
92
|
+
- Sky residuals around OH lines
|
|
93
|
+
- Merged-order continuity
|
|
94
|
+
- S/N consistency
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT (see [`LICENSE`](./LICENSE)).
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## File Structure
|
|
103
|
+
|
|
104
|
+
- `firepype/`
|
|
105
|
+
- `__init__.py` — package API (exposes `run_ab_pairs`, `apply_telluric_correction`)
|
|
106
|
+
- `config.py` — dataclasses for configuration
|
|
107
|
+
- `io.py` — FITS I/O, path builders, ID pairing
|
|
108
|
+
- `utils.py` — math helpers, masks, line-list loader
|
|
109
|
+
- `calibration.py` — peak detection, line matching, dispersion solver
|
|
110
|
+
- `detection.py` — slit/object detection, parity, negative scaling
|
|
111
|
+
- `extraction.py` — 1D extraction routines
|
|
112
|
+
- `coadd.py` — coaddition accumulator
|
|
113
|
+
- `plotting.py` — optional QA plotting
|
|
114
|
+
- `pipeline.py` — high-level AB-pair orchestration
|
|
115
|
+
- `telluric.py` — telluric correction API
|
|
116
|
+
- `cli.py` — command-line interface (pipeline + telluric subcommand if enabled)
|
|
117
|
+
- `tests/` — minimal tests for core functionality
|
|
118
|
+
- `pyproject.toml` — packaging configuration
|
|
119
|
+
- `README.md` — this file
|
|
120
|
+
- `LICENSE`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# firepype/__init__.py
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
__version__ = "0.0.1"
|
|
5
|
+
|
|
6
|
+
from .config import (
|
|
7
|
+
PipelineConfig,
|
|
8
|
+
RunSpec,
|
|
9
|
+
QASettings,
|
|
10
|
+
WavecalSettings,
|
|
11
|
+
ExtractionSettings,
|
|
12
|
+
SlitDetectionSettings,
|
|
13
|
+
)
|
|
14
|
+
from .pipeline import run_ab_pairs
|
|
15
|
+
from .telluric import apply_telluric_correction
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"__version__",
|
|
19
|
+
"PipelineConfig",
|
|
20
|
+
"RunSpec",
|
|
21
|
+
"QASettings",
|
|
22
|
+
"WavecalSettings",
|
|
23
|
+
"ExtractionSettings",
|
|
24
|
+
"SlitDetectionSettings",
|
|
25
|
+
"run_ab_pairs",
|
|
26
|
+
"apply_telluric_correction",
|
|
27
|
+
]
|