Powered by OpenAIRE graph
Found an issue? Give us feedback
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/ ZENODOarrow_drop_down
image/svg+xml art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos Open Access logo, converted into svg, designed by PLoS. This version with transparent background. http://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg art designer at PLoS, modified by Wikipedia users Nina, Beao, JakobVoss, and AnonMoos http://www.plos.org/
ZENODO
Software
Data sources: ZENODO
addClaim

iSTARMOD: a Python Code to Quantify Chromospheric Activity by Using Spectral Subtraction Technique

Authors: Labarga Avalos, Fernando; Montes, David;

iSTARMOD: a Python Code to Quantify Chromospheric Activity by Using Spectral Subtraction Technique

Abstract

# iSTARMOD โ€” Spectral Subtraction for Chromospheric Activity **iSTARMOD** is a Python implementation of the spectral subtraction technique designed to quantify chromospheric activity in late-type stars using high-resolution spectra. It is the modern evolution of the original **STARMOD** code, rewritten to improve usability, modularity, and integration with contemporary scientific workflows. --- ## ๐Ÿ”ฌ Scientific Background The spectral subtraction technique isolates chromospheric emission by subtracting a synthetic reference spectrum (constructed from inactive stars) from an observed spectrum. This allows measurement of **excess emission equivalent widths (EW)** in key activity indicators such as: - Hฮฑ and Balmer series - Ca II H & K - Ca II infrared triplet (IRT) - He I D3, Na I D1/D2 - Near-IR lines (Paฮฒ, He I ฮป10830) These measurements can be converted into **chromospheric fluxes** using ฯ‡-factor calibrations included with the code. --- ## โš™๏ธ Features - Iterative least-squares spectral fitting - Doppler shift + rotational broadening (Gray profile) - Support for **single stars and SB2 binaries** - Automatic **equivalent width (EW)** computation - Error estimation (Cayrel formula) - Batch processing of large spectral datasets - Compatible with FITS and simple ASCII spectra The code operates **order-by-order on echelle spectra**, improving robustness against instrumental effects and continuum uncertainties. ---## ๐Ÿš€ Installation ```bashgit clone https://github.com/flabarga/iSTARMOD.gitcd iSTARMODpip install -r requirements.txt``` Dependencies include: - numpy - scipy - astropy- matplotlib > โš ๏ธ Note: This project uses Tkinter also for visualization. On some Linux systems,> you may need to install it separately (e.g., `sudo apt-get install python3-tk`).--- ## โ–ถ๏ธ Quick Start 1. Prepare your observed spectrum (FITS or ASCII)2. Select appropriate **reference star spectrum(s)**3. Create a configuration file (`.sm`)4. Run: ```bashpython iStarmod.py ```>โš ๏ธ Note: Within iStarmod.py you must include the name of the .sm file as an input parameter in the call to the function starmod>There are two additional default parameters: 'plot' to plot the figure (set to True by default), and debugging to print additional output messages (set to False by default)>When running a batch of spectra, the plot parameter should be put to 'False' As noted, in the command starmod("filename.sm") the parameter "filename.sm" can specify its absolute or relative path. If no path is specified the "filename.sm" input file must be found in the same directory where the executable is located. As an example, from the files provided in this repository, the content of the python file is:```bashfrom istarmod_automat_reloaded import * starmod("pwand_n3_cah_34_wvl.sm")```Future version must include a main function and then a wrapper giving a clean CLI entry point to the application. --- ## ๐Ÿงพ Configuration File (`.sm`) The `.sm` file defines the full fitting setup using: ```KEYWORD = value``` ### Key Sections #### 1. General Information```iniIM_PATH = ./RES_PATH = ./OBJ_NAME = target_spectrum.fits```>โš ๏ธ Note:>The name of target spectrum can contain the wildcard "*" to process batch of spectra, with similar names.>The RES_PATH parameter allows defining the path to the output files #### 2. Output```iniSYN_SPEC = YESSYN_NAME = synthetic_outputSUB_NAME = subtracted_output``` #### 3. Fitting Parameters```iniN_ITER = 8PIX_ZONE = 6520 6600PIX_EXCL = 6520 6524PIX_EXCL = 6558 6570``` #### 4. Reference Star (Primary)```iniPRM_NAME = ref_star.fitsPRM_RAD = -20.0 varPRM_ROT = 5.0 varPRM_WGT = 1.0 fix``` #### 5. Secondary Star (optional, SB2)```iniSEC_NAME = ref2.fits OR NONESEC_RAD = 20.0 varSEC_ROT = 10.0 varSEC_WGT = 0.3 var``` #### 6. Spectral Region```iniAPERTURE = 34LINE = Halpha``` #### 7. Additional Algorithm & Visualization Parameters```iniWVL_DISPLAY_RANGE = 6550 6580 USE_RV_VALUES = NO ```>โš ๏ธ Note:>The WVL_DISPLAY_RANGE additional parameter allows defining the wavelength zone to be displayed in the output figure>The USE_RV_VALUES additional parameter allows storing the RV values calculated in previous runs of the algorithm. --- ## ๐Ÿ”„ Workflow 1. Continuum normalization 2. Doppler alignment 3. Rotational broadening 4. Synthetic spectrum construction 5. Subtraction 6. EW computation A successful subtraction yields near-zero residuals outside activity lines. --- ## Output - Synthetic spectrum (`SYN_NAME`)- Subtracted spectrum (`SUB_NAME`)- Equivalent widths (EW)- Diagnostic plots --- ## ๐Ÿ” Reproducibility & Paper Figures This repository includes all components required to reproduce the main figures and results from the associated publication. ### Included - Example spectra (or retrieval instructions)- Reference star spectra- Configuration files (`.sm`)- Figure-generation scripts- ฯ‡-factor based flux calculation routines --- ### โ–ถ๏ธ Reproducing Spectral Subtraction Figures Example (Hฮฑ, single star): ```bashpython iStarmod.py ``` Outputs:- synthetic spectrum- subtracted spectrum- diagnostic plots Expected:- RMS โ‰ฒ 0.5- clear Hฮฑ excess emission --- ### Reproducing Binary Star Cases (SB2) ```bashpython iStarmod.py ``` Expected:- correct two-component decomposition- EW uncertainties ~1โ€“2% --- ### ๐Ÿ“ Paper Configurations Several configurations used in the publication are stored in: ```configs/paper/``` Naming convention: ```<target>_<line>_<instrument>.sm``` --- ### Reproducibility Checklist - Install dependencies - Download or link datasets - Run `.sm` configurations - Execute plotting scripts - Compare outputs with paper figures --- ### โš ๏ธ Notes Results depend critically on:- reference star selection- spectral type matching - S/N and normalization quality Small variations may affect RMS and EW values. --- ## Applications - Stellar activity characterization - Time-series analysis - Spectroscopic surveys - Radial velocity activity mitigation --- ## Citation If you use this code, please cite: ```Labarga, F. & Montes, D. (2026)iSTARMOD: A Python Code to Quantify Chromospheric ActivityThe Astronomical Journal, 171, 15``` --- ## ๐Ÿค Contributing Pull requests are welcome. Please include:- clear description- test cases- documentation updates --- ## ๐Ÿ“„ License Open-source (see LICENSE file). --- ## ๐Ÿ”ญ Future Work - Extended ฯ‡ calibrations and analysis- Enhanced visualization tools- Time series analysis (e.g. Lyapunov exponents, activity period, etc.)- RV verification

Powered by OpenAIRE graph
Found an issue? Give us feedback