pyird 1.2.0
Python pipeline for infrared detectors, and/or IRD/REACH
License: MIT
Requires Python: >=3.10

<img src=documents/figures/pyird_logo.png width=70%>

PyIRD
===========
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/prvjapan/pyird/blob/develop/LICENSE)
[![Version](https://img.shields.io/badge/version-v1.2.0-blue?logo=github)](https://github.com/prvjapan/pyird/releases/tag/v1.2.0)
[![PyPI Version](https://img.shields.io/pypi/v/pyird)](https://pypi.org/project/pyird/)
[![Run pytest](https://github.com/prvjapan/pyird/actions/workflows/main.yml/badge.svg)](https://github.com/prvjapan/pyird/actions/workflows/main.yml)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-prvjapan%2Fpyird-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/prvjapan/pyird)<!-- DeepWiki badge generated by https://deepwiki.ryoppippi.com/ -->
[![status](https://joss.theoj.org/papers/07f33aeb83c3e80cc6d30882d299d710/status.svg)](https://joss.theoj.org/papers/07f33aeb83c3e80cc6d30882d299d710)

`PyIRD` is a Python-based pipeline for reducing spectroscopic data obtained with [IRD](https://ird.mtk.nao.ac.jp/IRDpub/index_tmp.html) and [REACH](https://secondearths.sakura.ne.jp/reach/) on the Subaru Telescope. 
It is designed to process raw images into one-dimensional spectra in a semi-automatic manner. 
Unlike traditional methods, it does not rely on IRAF (Tody et al. [1986](https://ui.adsabs.harvard.edu/abs/1986SPIE..627..733T/abstract), [1993](https://ui.adsabs.harvard.edu/abs/1993ASPC...52..173T/abstract)), a software traditionally used for astronomical data reduction. This approach simplifies the workflow while maintaining efficiency and accuracy.
Additionally, the pipeline includes an updated method for removing readout noise patterns from raw images, enabling efficient extraction of spectra even for faint targets such as brown dwarfs.

Read the [docs](https://secondearths.sakura.ne.jp/pyird/tutorials/IRD_stream.html) or [deepwiki for PyIRD](https://deepwiki.com/prvjapan/pyird).

Install
------------------

```
pip install pyird
```

or

```
git clone https://github.com/prvjapan/pyird.git
cd pyird
pip install .
```

Examples
------------------

`PyIRD` is designed to perform data reduction semi-automatically by following a general workflow for high-dispersion spectroscopic data reduction (e.g., readout noise subtraction, flat fielding, aperture extraction, wavelength calibration, and normalization).

See the following examples how to create 1D spectra from raw data.
- [pyird/examples/python/IRD_stream.py](https://github.com/prvjapan/pyird/blob/master/examples/python/IRD_stream.py) -- for IRD data; read [the docs](https://secondearths.sakura.ne.jp/pyird/tutorials/IRD_stream.html) for the detailed explanation.
- [pyird/examples/python/REACH_stream.py](https://github.com/prvjapan/pyird/blob/master/examples/python/REACH_stream.py) -- for REACH data; basically the same as `IRD_stream.py`, but with the variable `inst` set to `REACH` instead.

The raw data for `IRD_stream.py` can be downloaded from the [Zenodo repository](https://zenodo.org/records/14614004). 


License
------------------------------
`PyIRD` is publicly available under the MIT license. For developers, please read [CONTRIBUTING.md](https://github.com/prvjapan/pyird/blob/develop/CONTRIBUTING.md).