Papers
Topics
Authors
Recent
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 EWexcess=[Fobs(λ)Fsyn(λ)]dλEW_{excess} = \int [F_{obs}(\lambda) - F_{syn}(\lambda)]\,d\lambda is calculated.
  • Activity flux: Chromospheric line surface flux is then Fline=Residualdλ\mathcal{F}'_{\mathrm{line}} = \int Residual\,d\lambda, with final calibration applied as FS(λ)=χ(λ,Teff)EWexcessF_S(\lambda) = \chi(\lambda, T_{\mathrm{eff}}) \cdot EW_{excess}.

This approach enables quantitative isolation of chromospheric activity signatures in Hα\alpha 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 λ\lambda10830.

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 Δλ\Delta\lambda 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 rms=[FobsFsyn]2rms = \sum [F_{obs} - F_{syn}]^2 (excluding activity line pixels) is used to fit vrv_r.
  • Rotational broadening: Performed via convolution with the Gray-profile kernel; vsiniv\,\sin\,i can be fit or fixed.
  • Component weighting: For SB2s, weights w1w_1, w2w_2 are set by luminosity ratio or fitted, with w=1\sum w = 1. Component EWs de-blended using two-Lorentzian fits and corrected by 1/wi1/w_i.
  • Diagnostic metrics: Successful subtraction yields rms0.5rms \lesssim 0.5 (normalized units) outside excluded pixel regions.

3. χ\chi-Function Calibrations for Surface Flux Determination

iSTARMOD includes a suite of calibrations for χ\chi-functions, translating measured EWexcessEW_{excess} to surface fluxes (ergcm2s1\mathrm{erg\,cm}^{-2}\,\mathrm{s}^{-1}):

  • Formalism: log(Lline/Lbol)=logχ+logEW\log(L_\mathrm{line}/L_\mathrm{bol}) = \log \chi + \log EW, and Fline=χ(Teff)EWexcess\mathcal{F}_\mathrm{line} = \chi(T_\mathrm{eff})\cdot EW_{excess} with Fline/σTeff4=Lline/Lbol\mathcal{F}_\mathrm{line}/\sigma T_\mathrm{eff}^4 = L_\mathrm{line}/L_\mathrm{bol}.
  • Calibration grid: BT-Settl-CIFIST synthetic spectra spanning Teff[2200,7000]T_\mathrm{eff} \in [2200, 7000] K, logg=4.55.5\log g = 4.5-5.5, [Fe/H] = 0, degraded to R85000R \approx 85\,000.
  • Functional form:

χ=C0(Teff/Ts)α10P5(Teff),orlogχ=C1+αlogTeff+β1Teff++β5Teff5\chi = C_0 (T_\mathrm{eff}/T_s)^\alpha\,10^{P_5(T_\mathrm{eff})}, \quad \text{or} \quad \log \chi = C_1 + \alpha \log T_\mathrm{eff} + \beta_1 T_\mathrm{eff} + \ldots + \beta_5 T_\mathrm{eff}^5

  • Representative coefficients (for Hα\alpha): C1=0.0046±0.0002C_1 = -0.0046 \pm 0.0002, α=0.1281±0.0006\alpha = 0.1281 \pm 0.0006, β1=1.01×103\beta_1 = -1.01\times10^{-3}, higher-order βj=0\beta_j = 0 for j>1j > 1.
  • Tabulated fits: Annex A, Table 1, provides coefficients for each line/group (Hα\alpha, Ca II H & K, He I D3+Na D, Ca II IRT, Paschen, He I 10830), along with R2R^2.

Calibrated χ\chi-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 vsiniv\,\sin\,i broadening Spectrum, broadened spectrum
istarmod.synth Weighted synthetic template construction Obs/ref spectra, synthetic spectrum
istarmod.subtract Residual calculation (FobsFsynF_{obs}-F_{syn}) Observed/synthetic, residual
istarmod.ew EW integration, Cayrel error formula Residual, EW/uncertainty
istarmod.chi χ(Teff)\chi(T_\mathrm{eff}) 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 vrv_r, vsiniv\,\sin\,i, weights, flags for variable/fixed parameters, and detailed spectral regions to analyze. Outputs are normalized/broadened templates, subtracted residuals, and summary tables of EWexcessEW_{excess} 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, vrv_r, vsiniv\,\sin\,i, 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 vrv_r and vsiniv\,\sin\,i, synthesize and subtract template.
  5. Measure chromospheric EWexcessEW_{excess} and uncertainty: Via numerical integration and Cayrel formula.
  6. Convert to surface flux: Apply χ\chi-function calibrations at known TeffT_\mathrm{eff}.
  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, χ\chi-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)

Whiteboard

Topic to Video (Beta)

Follow Topic

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