Skip to main content

Algorithm developed to conduct a systematic search for exoplanets orbiting eclipsing binary stars.

Project description

Stanley Pipeline

Stanley is a research pipeline for detecting, modeling, and analyzing eclipsing binaries and potential circumbinary planets (CBPs) in space-based photometric data. It was originally developed for the Kepler CBP sample and has since been extended to large-scale searches in TESS light curves. In circumbinary systems, planetary transits do not occur at regular intervals and transit durations vary significantly due to the orbital motion of both stars around the barycenter. As a result, conventional single-star transit search algorithms perform poorly. Stanley implements methods specifically optimized for the variable-timing and variable-duration transit signatures unique to circumbinary planets.

Core Capabilities

Detrending

  • Iterative cosine (COFIAM-like) filtering
  • TESS-specific quadratic baseline removal
  • Variable-duration biweight filters
  • Outlier / flare / kink removal
  • Optional ellipsoidal and reflection trend modeling

Binary Modeling & Validation

  • Robust eclipse identification
  • Multi-stage BLS period and harmonic validation
  • Extraction of binary parameters (P, e, omega, eclipse depths and widths)

Secondary Eclipse Vetting

  • Geometric feasibility tests
  • Inclination / eccentricity constraints

Transit Timing Variation Search

  • N-body forward modeling via REBOUND
  • Variable-duration transit stacking matched to dynamically predicted timing signatures

Scalable Execution

  • Fully HPC-compatible (SLURM)
  • Each module (detrending, search, analysis) may run independently or as a unified pipeline
  • Interpolative potential for less computational load

Scientific Context

Stanley was first validated on the Kepler circumbinary-planet sample, where it successfully recovered all known CBPs including Kepler-47 b/c/d, searched for additional planets using variable-duration stacked transit detection, and demonstrated sensitivity to planets smaller than roughly three Earth radii in about half the systems. The current version extends the pipeline to TESS, enabling large-scale searches of low-mass eclipsing binaries and supporting demographic studies of small circumbinary planets.

Repository Structure and Data Requirements

This repository contains only the core source code (stanley_cbp/). All static catalogs needed at runtime are packaged inside:

stanley_cbp/Databases/

For standard local or Jupyter-based usage, users do not need to download any external data or set any environment variables.

Instead, when running the pipeline (typically from the Tutorials/ folder), Stanley automatically creates and manages a local runtime workspace containing:

  • LightCurves/
  • PlanetSearchOutput/
  • UserGeneratedData/

This workspace is created relative to the working directory and requires no manual configuration.

Runtime workspace (HPC / cluster use)

For large-scale or cluster-based runs, users may optionally define a runtime workspace via an environment variable:

export STANLEY_RUN_ROOT="/path/to/your/STANLEY/Runs"

When STANLEY_RUN_ROOT is set, all runtime products (light curves, diagnostics, and search outputs) are written under this directory instead of the local working directory. This is recommended for HPC environments where scratch space, quotas, or shared filesystems are involved.

If STANLEY_RUN_ROOT is not set, STANLEY falls back to the default local behavior described above.

Installation

Install from PyPI: pip install stanley_cbp

Or install from a locally built wheel: pip install dist/stanley_cbp-0.1.X-py3-none-any.whl

Environment setup (recommended)

For reproducible installations, this repository provides two Conda environment files:

environment.yml — for local machines and Jupyter-based workflows

clusterEnvironment.yml — for HPC or cluster environments

Users can create and activate an environment using either file, for example:

conda env create -f environment.yml conda activate stanley_env

or, for cluster usage:

conda env create -f clusterEnvironment.yml conda activate stanley_env

Once the environment is active, install STANLEY using one of the methods above.

Using Stanley in Python

Example workflow:

Import:
from stanley_cbp import runDetrendingModule, Stanley_FindPlanets, runAnalysisModule

Detrending example:
result_det = runDetrendingModule(SystemName="TIC260128333", DetrendingName="DemoDetrend", UseSavedData=0)

Search example:
Stanley_FindPlanets(SearchName="DemoSearch", SystemName="TIC260128333", DetrendingName="DemoDetrend", totalSectors=1, currentSector=1)

Analysis example:
analysis_out = runAnalysisModule(searchName="DemoSearch", systemName="TIC260128333", totalSectors=1)

Tutorials

A Tutorials/ directory is provided with example Jupyter notebooks.
These notebooks assume:

  • a local stanley_cbp installation,
  • that the directory where the notebook is run will automatically function as the runtime workspace,
  • and that Stanley will generate all required folders (LightCurves/, PlanetSearchOutput/, UserGeneratedData/) as needed.

The tutorials demonstrate detrending, running the CBP search, interpreting outputs, and generating diagnostic figures.

Licensing

This package is released under the MIT License.

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

stanley_cbp-0.1.68.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

stanley_cbp-0.1.68-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file stanley_cbp-0.1.68.tar.gz.

File metadata

  • Download URL: stanley_cbp-0.1.68.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for stanley_cbp-0.1.68.tar.gz
Algorithm Hash digest
SHA256 b27f8a7bd78da6fde03c61bf80d9f4d4c86ab9cd10ff8aedab3b11e033350cf6
MD5 5023df5a3477428ca7173e399c349c7c
BLAKE2b-256 bc3ab4b86635bd26f5d7b3cf8dd8dbb5c5c295f3b7768423ea1dbe0bf40b71ef

See more details on using hashes here.

File details

Details for the file stanley_cbp-0.1.68-py3-none-any.whl.

File metadata

  • Download URL: stanley_cbp-0.1.68-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for stanley_cbp-0.1.68-py3-none-any.whl
Algorithm Hash digest
SHA256 4a6d375f3b554509b0762a807dfb37c193818fadc6f7055166bc949c3252f618
MD5 bb572d4f84e67d4e539d8fcca04500f3
BLAKE2b-256 b8d529ef4bf82776f0dcd7a22c90c5d360ab7e06b22f5593e058f9f2c083c813

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