forked from https://github.com/mzechmeister/viper Should be same license !
  • Python 98.9%
  • Shell 1.1%
Find a file
alexis eb9c6f14c2 Constrain RV when no telluric features available, add update instructions to README
Fix RV (unc=0) when a stellar template is provided but no telluric lines
are available to serve as wavelength reference — prevents wild RV divergence.
In global_atm mode, bound RV to ±30 km/s from initial guess. Also add
"Updating" subsection to README for remote server installs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:03:40 +01:00
data Add complete CLI flags reference table to README 2026-02-17 16:12:42 +01:00
vipere Constrain RV when no telluric features available, add update instructions to README 2026-03-23 15:03:40 +01:00
LICENSE Create LICENCE 2023-11-30 14:00:26 +01:00
pyproject.toml Convert to proper package layout, fixing uv tool install (thx Thomas) 2026-03-05 10:14:59 +01:00
README.md Constrain RV when no telluric features available, add update instructions to README 2026-03-23 15:03:40 +01:00

vipere - Telluric correction for CRIRES+ spectra

Forked and adapted from viper by Zechmeister & Koehler. Simplified to a single-file tool focused on telluric removal and stellar template creation for CRIRES+ data.

Author: Alexis Lavail (with help from Claude)

Requirements

  • Python >= 3.10
  • astropy, matplotlib, numpy, scipy

Installation

Install as a global command with uv:

uv tool install -e /path/to/vipere

The -e (editable) flag means changes to the code take effect immediately without reinstalling. You can then run vipere from anywhere on your system.

Updating

If installed with -e (editable), just pull the latest version:

cd /path/to/vipere && git pull

Changes take effect immediately — no reinstall needed.

If installed without -e, reinstall after pulling:

cd /path/to/vipere && git pull
uv tool install -e . --force

Usage

vipere "data/WASP18/cr2res*.fits" \
  -createtpl -telluric add -tsig 10 -tpl_wave tell \
  -deg_norm 2 -deg_wave 2 -o data/WASP18/tpl1

Alternatively, run directly without installing:

uv run vipere.py "data/WASP18/cr2res*.fits" -createtpl -telluric add -o output

See vipere -? for all options.

Key flags

Flag Description Default
-o Output basename for result files tmp
-oset Order index range (e.g. 1:22 for 21 orders); auto-detected from FITS if omitted auto
-nset Spectrum index range : (all)
-createtpl Create a stellar template from multiple observations off
-telluric Telluric mode: add (per-molecule coefficients) or add2 (combined non-water coefficient) off
-global_atm Fit atmosphere globally across all orders (shared RV + atm coefficients) off
-wavecorr_2d Interpolate wavelength solution for unfitted orders via 2D polynomial fit per chip off
-tellshift Allow a wavelength shift of the telluric model off
-tell_bic BIC threshold for telluric model selection (0 to disable) 10
-tsig Relative sigma for weighting telluric regions 1
-tpl_wave Output wavelength grid: initial, berv, or tell initial
-tpl_noRV Do not apply stellar RV shift to telluric-corrected spectrum (with -createtpl) off
-deg_norm Polynomial degree for flux normalisation 3
-deg_wave Polynomial degree for wavelength solution 3
-deg_bkg Polynomial degree for background model 0
-oversampling Oversampling factor for the template auto
-ip IP model: g, ag, sg, bg, mg, mcg g
-kapsig Kappa-sigma clipping values per stage (0 = no clipping) 0
-kapsig_ctpl Kappa-sigma for outlier clipping in template creation 0.6
-plot Plot level: 0 = off, 1 = with pause, 2 = without pause (saves PNG) 0
-rv_guess Initial RV guess [km/s] 1.0
-vcut Trim observation to range valid for model [km/s] 100
-fix Fix parameters (e.g. -fix wave for stabilised instruments) none
-molec Molecules to include (all for automatic selection) all
-nexcl Ignore spectra matching string pattern none
-wgt Weighted fit: error (use data errors) or tell (upweight tellurics) off
-config_file YAML config file to override defaults none

Citation

If you use this tool, please cite the original viper pipeline: https://ui.adsabs.harvard.edu/abs/2021ascl.soft08006Z