Papers
Topics
Authors
Recent
Search
2000 character limit reached

PyIRD: Python Pipeline for IRD Spectroscopy

Updated 5 July 2026
  • PyIRD is a Python-based data reduction pipeline that converts raw two-dimensional IRD detector images into one-dimensional spectra for precise astronomical analyses.
  • It employs modular components like FitsSet and Stream2D to organize calibration steps, trace echelle orders, and implement an updated readout-noise removal using Gaussian Process modeling.
  • The pipeline modernizes legacy IRAF approaches, offering a semi-automatic, configurable workflow tailored for high-dispersion spectroscopy of faint targets such as brown dwarfs and exoplanets.

Searching arXiv for the PyIRD software note and the cited Subaru/IRD-REACH application papers to anchor the article with current identifiers. PyIRD is a Python-based data reduction pipeline for spectroscopic data obtained with IRD, the InfraRed Doppler instrument, and REACH, the Rigorous Exoplanetary Atmosphere Characterization with High dispersion coronagraphy mode, on the Subaru Telescope. It is designed to process raw two-dimensional detector images into one-dimensional extracted spectra in a semi-automatic manner, while avoiding dependence on IRAF. The software note emphasizes two defining characteristics: a fully Python workflow and an updated method for removing readout noise patterns from raw images, with particular relevance for faint targets such as brown dwarfs. The code is open source and available at https://github.com/prvjapan/pyird (Kasagi et al., 19 Jan 2026).

1. Instrumental scope and scientific setting

PyIRD is tailored specifically for high-resolution near-infrared spectroscopy with Subaru/IRD and with REACH, which combines adaptive optics, a coronagraph, and IRD. Its principal product is one-dimensional extracted spectra intended for downstream analyses including precise radial velocities, high-resolution atmospheric characterization of exoplanets and brown dwarfs, and general high-dispersion spectroscopy of both faint and bright targets (Kasagi et al., 19 Jan 2026).

The note places PyIRD within an active science program rather than presenting it as an isolated software artifact. It reports use in REACH high-dispersion spectra of the brown-dwarf companion HR 7672 B for atmospheric retrieval, in IRD spectra of the archetype T dwarf Gl 229 B for atmospheric characterization, in radial-velocity work on the single-lined spectroscopic binary V723 Mon, and in high-resolution atmospheric modeling work with ExoJAX2. This usage pattern indicates that the pipeline is intended to serve both high-precision, high-S/N observations and low-flux regimes where detector systematics are limiting (Kasagi et al., 19 Jan 2026).

Historically, IRD and REACH reductions relied on IRAF, often through instrument-specific CL/SPP scripts. PyIRD explicitly departs from that model. The note characterizes IRAF as legacy software, no longer supported by NOAO and discouraged by STScI, and situates PyIRD alongside Python-native reduction systems such as IGRINS PLP and PypeIt rather than PyRAF-based tools such as WARP. In that landscape, PyIRD is more instrument-specific than PypeIt and intentionally lightweight and easily configurable for Subaru infrared high-dispersion work (Kasagi et al., 19 Jan 2026).

2. Pipeline organization and reduction workflow

The software is organized as a pure Python, semi-automatic workflow in which, once configured for a night, a single Python script can reduce raw frames to one-dimensional spectra. The note presents the process as a sequence of logically separated steps, each associated with its own instance name in the flowchart, rather than as a monolithic executable (Kasagi et al., 19 Jan 2026).

Two core abstractions structure this workflow. FitsSet collects relevant FITS files in a directory, organizes them by ID and metadata, and provides a unified interface for applying reduction steps to selected subsets such as flats or science exposures. Stream2D manages operations on two-dimensional images and allows a chain of processing steps to be applied consistently across many frames. This design makes the pipeline night-oriented and batch-oriented at the same time: calibration products and reference files can be generated once and then reused in later steps of the same reduction sequence (Kasagi et al., 19 Jan 2026).

The reduction stages follow the standard pattern for high-dispersion spectroscopy. The note describes file organization and metadata handling, streamed image operations, calibration and reference-file generation, order tracing, flat-fielding and detector-response correction, wavelength calibration, spectral extraction, and spectrum combination. It also states that traced orders are subsequently used in extraction and wavelength calibration. For wavelength calibration, the note indicates a conventional per-order dispersion solution, generically expressible as

λ(p,o)=i,jaijpioj,\lambda(p,o) = \sum_{i,j} a_{ij}\,p^i\,o^j,

while also making clear that the short software note does not specify the exact polynomial degree or coefficients (Kasagi et al., 19 Jan 2026).

The workflow is described as semi-automatic rather than fully unattended. The note indicates that the main night-long reduction can be completed in tens of minutes by running one script, whereas choices such as calibration sets, masking, and quality control may still require user supervision, although those details are not elaborated there. This suggests an operational model centered on rapid routine reduction with limited but nonzero interactive oversight.

3. Detector preprocessing and readout-pattern modeling

PyIRD follows the usual near-infrared echelle preprocessing logic, including dark and bias handling, flat-fielding, bad-pixel or bad-column treatment, and background subtraction at a conceptual level. The software note, however, gives detailed emphasis only to readout-noise removal, presenting it as the primary technical update relative to earlier IRAF-based practice (Kasagi et al., 19 Jan 2026).

The relevant detector context is the IRD H2RG infrared array, which is read out through multiple channels. The note identifies the resulting readout pattern as the dominant noise source for faint-object observations, especially for brown dwarfs and faint companions. PyIRD addresses this with an updated method that first computes a per-channel median profile and then refines that description with a two-dimensional Gaussian Process model implemented through the gpkron package. The result is a two-dimensional model of the readout pattern, denoted N(x,y)N(x,y), which is subtracted from the raw image to yield the corrected image

Icorr(x,y)=I(x,y)N(x,y).I_{\mathrm{corr}}(x,y) = I(x,y) - N(x,y).

The note states that this produces “a higher level of readout noise pattern removal” than older reductions and is crucial when the astrophysical signal is comparable to the amplitude of the pattern itself (Kasagi et al., 19 Jan 2026).

The note does not report explicit numerical metrics such as RMS suppression or S/N gain, but it does provide qualitative and visual validation. The emphasis on per-channel modeling and GP refinement indicates that PyIRD treats detector artifacts as structured spatial systematics rather than as simple additive offsets. A plausible implication is that the pipeline’s main methodological contribution lies less in redefining extraction theory than in improving the fidelity of detector-domain calibration before extraction begins.

4. Order tracing, calibration products, and extracted spectra

Using flats or other bright reference frames, PyIRD identifies and traces echelle orders on the detector and stores the resulting order masks and center curves for later extraction. The note describes these steps in generic high-dispersion terms and makes clear that the order layout and detector geometry are instrument-specific and encoded for IRD and REACH (Kasagi et al., 19 Jan 2026).

Once tracing and calibrations are available, one-dimensional spectra are extracted order by order. The note does not specify whether the extraction is strictly box extraction or optimal extraction, and it does not present a PyIRD-specific extraction formula. It likewise does not detail the functional form of the blaze correction, although flat frames are used to remove pixel-to-pixel sensitivity variations and to estimate the blaze response. The output stage includes the possibility of combining multiple exposures to increase S/N and produces final one-dimensional spectra together with associated wavelength arrays and uncertainties (Kasagi et al., 19 Jan 2026).

These products are intended to be directly usable for radial-velocity analysis, atmospheric retrieval, and cross-correlation workflows. At the same time, the note is explicit about scope boundaries. It does not describe telluric correction, instrumental line-spread-function modeling, scattered-light subtraction, or fringing removal in detail, and it presents PyIRD primarily as a detector-level and geometric-calibration pipeline rather than as a complete science-analysis environment. High-level spectral modeling is therefore left to external tools, including ExoJAX2 in the cited use cases (Kasagi et al., 19 Jan 2026).

5. Software implementation and operating model

PyIRD is implemented entirely in Python and has no IRAF, SPP, or PyRAF component. The note identifies Astropy, NumPy, SciPy, pandas, and gpkron as key dependencies. Within that software stack, FitsSet functions as the FITS-collection and metadata-indexing layer, while Stream2D acts as the two-dimensional processing layer through which image operations are chained and applied systematically (Kasagi et al., 19 Jan 2026).

The operational model is explicitly script-driven. A typical observing night is reduced by adapting or writing a single Python script that instantiates a FitsSet, configures a Stream2D chain for steps such as dark or flat handling, pattern removal, and extraction, and then runs the reduction to completion. According to the note, this typically yields one-dimensional spectra in “several tens of minutes,” whereas the earlier IRAF-based approach required “about half a day,” in part because of manual interaction and configuration (Kasagi et al., 19 Jan 2026).

The note also emphasizes extensibility. Because the pipeline is organized around high-level Python classes, users can customize reduction steps by adding new functions or modifying existing ones, and alternative algorithms can be inserted into the Stream2D workflow. This suggests a design preference for transparent, locally modifiable reduction scripts rather than a rigid instrument-control framework.

6. Validation status, limitations, and ecosystem position

The note treats practical scientific use as the principal form of validation. It points to successful application in brown-dwarf atmospheric characterization, radial-velocity analyses, and ExoJAX2-based modeling, and it presents the improvement in readout-noise removal as particularly important for faint targets. At the same time, it does not provide explicit quantitative performance figures such as achieved radial-velocity precision, S/N improvement factors, or direct numerical comparisons with older IRAF reductions (Kasagi et al., 19 Jan 2026).

Several limitations are either stated directly or follow immediately from the note’s scope. PyIRD is specific to IRD and REACH rather than being a general-purpose echelle-reduction framework. It concentrates on detector-level calibration and one-dimensional extraction, leaving telluric treatment, IP modeling, and detailed science inference to downstream codes. It is semi-automatic rather than fully automatic, so some manual configuration and quality control are still likely to be required on problematic nights or unusual setups. The note also does not describe detailed documentation, cookbook-style examples, or future development plans, beyond the implication of continued use in recent publications (Kasagi et al., 19 Jan 2026).

Within the broader reduction-software ecosystem, PyIRD occupies a distinct niche. It combines IRAF independence with instrument specificity, prioritizing a lightweight Python workflow for Subaru near-infrared high-dispersion spectroscopy. This suggests a deliberate trade-off: broader frameworks may offer greater instrument generality, but PyIRD encodes the fixed order locations, multi-channel readout structure, and typical detector behavior of IRD and REACH more directly. In that sense, its significance lies in modernizing a mature instrument workflow without recasting it as a universal reduction system.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to PyIRD.