Papers
Topics
Authors
Recent
Search
2000 character limit reached

iSTARMOD: Python Code for Stellar Chromospheric Activity

Updated 16 December 2025
  • iSTARMOD is a Python-based tool that implements spectral subtraction to isolate chromospheric excess emission in late-type stars.
  • The code automates continuum normalization, radial velocity correction, and equivalent width integration to convert spectra into absolute surface fluxes using calibrated chi-functions.
  • Its modular design supports rapid processing and integration into large-scale pipelines, aiding in mitigating activity-induced RV jitter in exoplanet searches.

iSTARMOD is a Python-based code for quantifying chromospheric activity in late-type stars using the spectral subtraction technique. It is an updated and extended version of the original STARMOD code, reimplemented for modern usability, modularity, and workflow integration. iSTARMOD provides quantitative measurements of chromospheric excess emission in several activity indicators and automates the conversion of equivalent width excesses into absolute surface fluxes using calibrated χ\chi-functions. It supports rapid processing and is designed for integration into large-scale stellar activity and exoplanet search pipelines (Labarga et al., 9 Dec 2025).

1. Spectral Subtraction Technique

The core principle underlying iSTARMOD is the spectral subtraction technique, which isolates chromospheric “excess” emission by removing a synthetic photospheric template from the observed stellar spectrum. The method proceeds as follows:

  • Template construction: One or multiple inactive reference star spectra Fref,i(λ)F_{\mathrm{ref},i}(\lambda) are chosen. Each is Doppler-shifted to correct for radial velocity Δvr,i\Delta v_{r,i} using λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c).
  • Rotational broadening: Reference spectra are convolved with a Gray-profile kernel G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon) (with ϵ=0.6\epsilon=0.6 by default), and optionally with a macroturbulent Gaussian.
  • Template combination: For multi-component systems (e.g., SB2), the synthetic template Fsyn(λ)F_{\mathrm{syn}}(\lambda) is a weighted sum: Fsyn=iwiFref,iF_{\mathrm{syn}} = \sum_i w_i F_{\mathrm{ref},i}, enforcing wi=1\sum w_i = 1.
  • Subtraction and measurement: The residual spectrum is constructed as Residual(λ)=Fobs(λ)Fsyn(λ)Residual(\lambda) = F_{obs}(\lambda) - F_{syn}(\lambda), and the excess equivalent width Fref,i(λ)F_{\mathrm{ref},i}(\lambda)0 is calculated.
  • Activity flux: Chromospheric line surface flux is then Fref,i(λ)F_{\mathrm{ref},i}(\lambda)1, with final calibration applied as Fref,i(λ)F_{\mathrm{ref},i}(\lambda)2.

This approach enables quantitative isolation of chromospheric activity signatures in HFref,i(λ)F_{\mathrm{ref},i}(\lambda)3 and other Balmer lines, He I D3, Na I D1 and D2, Ca II H & K, Ca II infrared triplet, Paschen series, and He I Fref,i(λ)F_{\mathrm{ref},i}(\lambda)410830.

2. Preprocessing: Continuum Normalization, Radial Velocity Alignment, and Template Matching

A sequence of preprocessing steps ensures accurate subtraction:

  • Rebinning: Spectra are resampled to a constant Fref,i(λ)F_{\mathrm{ref},i}(\lambda)5 grid as needed.
  • Continuum placement: Adopts ARES methodology to locate line-free continuum windows and fits a low-order polynomial (2nd–4th order), normalizing spectra to unity.
  • Radial velocity correction: Shifts are split into integer and fractional pixel displacements, achieved via array reindexing and local linear Lagrange interpolation. Least-squares minimization of Fref,i(λ)F_{\mathrm{ref},i}(\lambda)6 (excluding activity line pixels) is used to fit Fref,i(λ)F_{\mathrm{ref},i}(\lambda)7.
  • Rotational broadening: Performed via convolution with the Gray-profile kernel; Fref,i(λ)F_{\mathrm{ref},i}(\lambda)8 can be fit or fixed.
  • Component weighting: For SB2s, weights Fref,i(λ)F_{\mathrm{ref},i}(\lambda)9, Δvr,i\Delta v_{r,i}0 are set by luminosity ratio or fitted, with Δvr,i\Delta v_{r,i}1. Component EWs de-blended using two-Lorentzian fits and corrected by Δvr,i\Delta v_{r,i}2.
  • Diagnostic metrics: Successful subtraction yields Δvr,i\Delta v_{r,i}3 (normalized units) outside excluded pixel regions.

3. Δvr,i\Delta v_{r,i}4-Function Calibrations for Surface Flux Determination

iSTARMOD includes a suite of calibrations for Δvr,i\Delta v_{r,i}5-functions, translating measured Δvr,i\Delta v_{r,i}6 to surface fluxes (Δvr,i\Delta v_{r,i}7):

  • Formalism: Δvr,i\Delta v_{r,i}8, and Δvr,i\Delta v_{r,i}9 with λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)0.
  • Calibration grid: BT-Settl-CIFIST synthetic spectra spanning λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)1 K, λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)2, [Fe/H] = 0, degraded to λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)3.
  • Functional form:

λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)4

  • Representative coefficients (for Hλ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)5): λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)6, λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)7, λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)8, higher-order λ=λ0(1+vr/c)\lambda' = \lambda_0 (1+v_r/c)9 for G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)0.
  • Tabulated fits: Annex A, Table 1, provides coefficients for each line/group (HG(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)1, Ca II H & K, He I D3+Na D, Ca II IRT, Paschen, He I 10830), along with G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)2.

Calibrated G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)3-functions enable fully automated and uniform flux computation for large stellar samples.

4. Software Design, Modules, and User Parameters

iSTARMOD is implemented in Python 3, relying on dependencies including Astropy, NumPy, SciPy, optional ARES, and Matplotlib. Its modular architecture separates IO, continuum fitting, radial velocity shifting, rotational broadening, synthetic spectrum synthesis, subtraction, equivalent width integration, flux calibration, and plotting.

Key modules and their roles:

Module Functionality Input/Output
istarmod.io FITS/dat reading, rebinning Spectra (obs/ref), output files
istarmod.continuum ARES-based continuum fit, normalization Input spectrum, normalized spectrum
istarmod.rvshift Integer and fractional pixel shift for RV correction Input/shifted spectrum
istarmod.rotbroaden Gray-profile convolution for G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)4 broadening Spectrum, broadened spectrum
istarmod.synth Weighted synthetic template construction Obs/ref spectra, synthetic spectrum
istarmod.subtract Residual calculation (G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)5) Observed/synthetic, residual
istarmod.ew EW integration, Cayrel error formula Residual, EW/uncertainty
istarmod.chi G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)6 interpolation, flux computation EW, surface flux
istarmod.plot Visualization of fits and residuals All, graphical output

User interaction occurs primarily via configuration files (inputParameters.sm) and Python API calls. Inputs include: active and reference spectra (FITS or .dat), initial G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)7, G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)8, weights, flags for variable/fixed parameters, and detailed spectral regions to analyze. Outputs are normalized/broadened templates, subtracted residuals, and summary tables of G(v;vsini,ϵ)G(v; v\,\sin\,i, \epsilon)9 and uncertainties.

5. Usage Example and Workflow

A typical workflow with iSTARMOD proceeds:

  1. Load observed spectrum: ISTARMOD.load_spectrum("target.fits")
  2. Specify reference star: Input spectrum path, ϵ=0.6\epsilon=0.60, ϵ=0.6\epsilon=0.61, weight, variable/fixed flags.
  3. Set fitting zone and exclusion window: Define spectral windows and exclude chromospheric line cores from the fit.
  4. Initialize and run subtraction: Normalize continuum, fit ϵ=0.6\epsilon=0.62 and ϵ=0.6\epsilon=0.63, synthesize and subtract template.
  5. Measure chromospheric ϵ=0.6\epsilon=0.64 and uncertainty: Via numerical integration and Cayrel formula.
  6. Convert to surface flux: Apply ϵ=0.6\epsilon=0.65-function calibrations at known ϵ=0.6\epsilon=0.66.
  7. Repeat for all lines of interest: Automated via script or notebook.

Batch processing across many stars or spectra is supported, as is integration into larger data reduction pipelines. Output products include both machine- and human-readable data.

6. Pipeline Integration and Radial Velocity Jitter Mitigation

iSTARMOD is designed for rapid and automated integration with spectroscopic survey pipelines such as CARMENES DR1. It supports hands-off workflow—continuum normalization, inactive template subtraction, EW measurement, and flux calculation—in batch mode across large data volumes.

In the context of precision radial velocity (RV) measurements, iSTARMOD facilitates:

  • Mitigation of activity-induced RV jitter: Subtracting chromospheric emission lines before cross-correlation reduces spurious RV shifts due to line-shape changes from activity.
  • Flagging and downweighting strong activity epochs: Analysis of residual spectra enables identification of flares or activity epochs, aiding in selection of quiescent data for exoplanet searches.

Output residuals, EWs, and fluxes can be programmatically incorporated into high-level analysis workflows.

7. Distribution, Documentation, and Extensibility

iSTARMOD is publicly available under open access (Zenodo DOI 10.5281/zenodo.17329154, GitHub flabarga/iSTARMOD) with comprehensive documentation covering the Python API, configuration syntax, ϵ=0.6\epsilon=0.67-factor calibration procedures, and worked examples (Labarga et al., 9 Dec 2025). The package includes several practical examples to facilitate learning and rapid adoption. Direct integration with common astronomical analysis environments and notebooks is supported. This architecture positions iSTARMOD as a versatile tool for both large-scale stellar activity surveys and detailed studies of individual targets.

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 iSTARMOD Code.