Gravitational wave detection

From XuShuwenn/RedAct · View interactive version

Gravitational wave detection is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Detect gravitational wave signals from binary black hole mergers using matched filtering with PyCBC.

How to use this skill

Skill file

Gravitational Wave Detection with Matched Filtering

When to Use

Input Data

Template Search

Approximants: "SEOBNRv4_opt", "IMRPhenomD", "TaylorT4"

Mass grid: mass1 and mass2 from 10 to 40 solar masses (integer steps)

Process

  1. Validate data loading first with a minimal script that reads /root/data/PyCBC_T2_2.gwf from H1:TEST-STRAIN successfully.
  2. Build one faithful serial baseline pipeline using PyCBC: condition detector data (whiten, bandpass), generate templates, and run matched filtering end-to-end on a tiny subset.
  1. Before the full sweep, benchmark a small representative subset (for example, one approximant and a few mass pairs) to estimate runtime and confirm progress/logging and CSV-writing behavior.

3a. Do not start the full (approximant, mass1, mass2) sweep until one complete end-to-end trial has succeeded for at least one approximant and one mass pair, has produced a non-trivial interpretable SNR, and has emitted useful diagnostics.

3b. Turn that pilot into an explicit execution plan before launching the full search: estimate the rough full-grid runtime, decide whether to stay serial or split by approximant/batch, and define how intermediate best-per-approximant results will be checkpointed and merged into /root/detection_results.csv.

3c. If the estimate is too large for the remaining session budget, switch immediately to a resumable plan instead of launching the monolithic full sweep and later aborting it.

3d. If you write or edit a Python script, inspect the saved file and run a quick syntax/import smoke test before launching any expensive search.

3e. Instrument the pilot with explicit stage logs around waveform generation, PSD estimation, and matched filtering so a later stall can be localized quickly.

3f. Once one baseline path works, keep that implementation stable and scale it up; do not repeatedly rewrite core search logic unless a concrete observed failure requires a fix.

  1. Reuse conditioned strain data and PSD where possible instead of recomputing preprocessing inside the mass-grid loop.

4a. If you split work by approximant or batch, compute frame loading, conditioning, and PSD estimation once and reuse or persist those shared artifacts; do not repeat identical preprocessing in each worker unless you have confirmed it is negligible.

  1. Run the full required search over all listed approximants and the full integer mass grid, keeping one stable implementation path rather than repeatedly restarting with unvalidated changes.
  1. If runtime is high, use batching, checkpointing, or per-approximant execution that still preserves the required final search and supports a final merge.

6a. If you split execution by mass range or approximant, maintain an explicit completion checklist covering all 3 approximants and the full mass1=10..40, mass2=10..40 grid.

6b. If you write intermediate per-batch files, execute a final consolidation step that reads all completed batches, selects the highest-SNR result per approximant, and writes exactly /root/detection_results.csv with the required schema.

6c. Do not consider the task complete while results exist only in batch-specific files such as per-range or per-approximant CSVs.

6d. Do not treat partial console output, sparse logs, timeouts, or truncated captures as finished results; confirm completion from explicit artifacts, checkpoint contents, or exit evidence before proceeding.

  1. Extract the strongest signal (highest SNR) per approximant.
  1. Write /root/detection_results.csv with the final best row for each approximant.
  2. Finish only after directly verifying the CSV exists, is non-empty, and contains the intended final rows.
  3. If a script was written or patched for the search, actually execute it (or equivalent commands) and inspect its outputs; do not stop at code drafting or an unexecuted fix.
  4. Use an explicit completion checklist before finishing: data read succeeded, conditioning and matched filtering ran, the full required search completed, one strongest row was selected for each approximant, and /root/detection_results.csv was verified on disk.

Process

Preflight Checks

Output Format

CSV at /root/detection_results.csv.

Key Metrics

Tips

Tips

Failure Handling

Preflight Checks

Implementation Guardrails

Implementation Guardrails

Runtime-Safe Execution

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.