Skip to main content

Measure frequency shifts in solar-like oscillators using filtered cross-correlation

Project description

seismo-xl

Measure frequency shifts in solar-like oscillators using filtered cross-correlation.

This package implements the filtered cross-correlation method for computing variations in p-mode frequencies ($\delta\omega_\ell$) over time. It supports both Kepler and Virgo/SoHO data.

Method

The pipeline:

  1. Peakbagging — Fit mode parameters on the time-averaged power spectrum using apollinaire.
  2. Power spectrum construction — Build a model power spectrum from Lorentzian profiles + Harvey-like background + photon noise.
  3. MI filter construction — For each spherical harmonic degree $\ell$, construct a mode-isolation (MI) filter.
  4. Cross-correlation — Cross-correlate each chunk's power spectrum with the MI filter. The peak shift gives $\delta\omega_\ell$.
  5. Uncertainty — Monte Carlo realizations (noisify spectrum with $\chi^2_2$ distribution, re-run cross-correlation).

Installation

Prerequisites

  • Python ≥ 3.9
  • uv (recommended) or pip + venv
  • apollinaire — required for peakbagging

Using uv (recommended)

# Create virtual environment with Python 3.13
uv venv --python 3.13

# Activate
source .venv/bin/activate

# Install seismo-xl in editable mode
uv sync

# With peakbagging + notebooks (apollinaire, jupyter):
uv sync --all-extras

Using pip + venv

python3.13 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# With peakbagging:
pip install -e ".[all]"

Usage

1. Configuration

Edit config.yml (Kepler) or config_virgo.yml (Virgo/SoHO):

Navg: 180            # Sub-series length (days)
Nshift: 45           # Shift between sub-series (days)
Nmcmc: 10000         # MCMC iterations for peakbagging
nmin: 16             # Minimum radial order
nmax: 26             # Maximum radial order
freqmin: 150.        # Min frequency (μHz)
freqmax: 6000.       # Max frequency (μHz)
data_dir: "./data"   # Lightcurve directory
output_dir: "/path/to/output"

2. Peakbagging

Fit mode parameters on the average spectrum:

# Kepler
python peakbag_kepler.py --kic 8006161 --peakbag

# Virgo/SoHO
python peakbag_virgo.py --peakbag

3. Compute frequency shifts

python compute_delnu.py --kic 8006161 --lmax 3

4. Synthetic tests (Virgo/SoHO mode set)

python create_spectra.py --source valeriy --channel blue --Ncarr 3

Project structure

.
├── pyproject.toml          # Package metadata & dependencies
├── setup.py                # Legacy setup (editable install support)
├── src/
│   └── seismo_xl/
│       ├── __init__.py
│       ├── config.py           # YAML config loader with !include support
│       ├── globalvars.py       # Global constants & helper classes
│       ├── logger.py           # Logging utilities
│       ├── stellarspec.py      # Stellar power spectrum construction
│       └── utils.py            # Mode parameter readers & utilities
├── peakbag_kepler.py       # Kepler peakbagging entry point
├── peakbag_virgo.py        # Virgo/SoHO peakbagging entry point
├── compute_delnu.py        # Frequency shift computation
├── create_spectra.py       # Synthetic spectra (Virgo mode set)
├── config.yml              # Kepler configuration
├── config_virgo.yml        # Virgo/SoHO configuration
├── notebooks/              # Jupyter notebooks for analysis & validation
└── jobscripts/             # Slurm batch scripts

Dependencies

Package Role
numpy, scipy Numerical
matplotlib Plotting
h5py HDF5 I/O
pandas CSV data
pyyaml Config
astropy FITS reading
tqdm Progress bars
pyshtools Legendre polynomials
ritzLavelyPy Rotational splitting polynomials
apollinaire Peakbagging (optional, needed for --peakbag)

Notes

Configurable paths

All hardcoded scratch paths have been replaced with configurable CLI arguments or the .config file.

Script-level overrides (command-line args):

Script Flag Default Description
compute_delnu.py --output-dir config.ymloutput_dir Base dir for processed data
compute_delnu.py --papers-dir {output_dir}/papers Where paper figures are saved
create_spectra.py --scratch-dir /path/to/sun-intg Base dir for synthetic spectra
create_spectra.py --obs-dir (required) Dir with Larson_Schou_MDI_2015.dat for ref mode params

Package-level paths (.config file in repo root, one path per line):

# Line 0: eigenfunction directory (e.g., efs_Jesper)
# Line 1: Virgo/SoHO time-series data
# Line 2: processed output base
# Line 3: FWHM observations (contains Larson_Schou_MDI_2015.dat)
# Line 4: sun-integral processed/models
# Line 5: synthetics output

Create .config with your own paths before using globalvars.py features.

Citation

If you use this code in published research, please cite:

Kashyap, S., et al. (2025). Frequency shifts in solar-like oscillators using filtered cross-correlation. (In prep.)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seismo_xl-0.1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seismo_xl-0.1.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file seismo_xl-0.1.0.tar.gz.

File metadata

  • Download URL: seismo_xl-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for seismo_xl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 657b3d47ac7ebd1d5b972f9e6273f46dce2b3588ebf8272e2aa1eaabf4db259c
MD5 ffc4a88b1e13d728e1a4cad344611176
BLAKE2b-256 f21b0f3957e4eb511e63d4822ce2d3f91ebd88b56a3b21ba25187496a37589d8

See more details on using hashes here.

File details

Details for the file seismo_xl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: seismo_xl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for seismo_xl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9aec2e12b0c5a2214cd60a1cfe3795421e0b96fd1e1bee7ecf3d85aaa88b4dcf
MD5 ae94596da95b327cd3fe0115c8eede41
BLAKE2b-256 839edbe9659b81f5397f01760c19da58168d3dbb005b8f3f2d7714eaca0d2942

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page