Skip to content

phase_fold

Phase-fold a light curve on a known period.

Category Time series
Backend numpy - implemented here on top of numpy primitives
Version 1.0.1
Reads ctx.light_curves
Writes light_curves.folded

Parameters

Parameter Default Required Description
period None yes Folding period, in the light curve's time unit (required).
epoch 0.0 - Reference time mapped to phase 0.
light_curve_key None - Key in ctx.light_curves to fold; null uses the first one.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("phase_fold", ctx, {
    "period": "<value>",
    "epoch": 0.0,
    "light_curve_key": None
})

The CLI loads a single 1-D spectrum with --input; this algorithm needs ctx.light_curves. Run it from Python or as a step of a pipeline preset.

{
  "tool": "phase_fold",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "period": "<value>",
      "epoch": 0.0,
      "light_curve_key": null
    }
  }
}

Every algorithm is an MCP tool of the same name; describe_algorithm returns this page's metadata as JSON.

References

  • Stellingwerf 1978, ApJ 224, 953 — phase dispersion minimization ; defines the phase-folding convention φ = ((t − t₀)/P) mod 1 used here.
  • Lafler & Kinman 1965, ApJS 11, 216 — period search by folding the light curve on trial periods.
  • lomb_scargle - Compute a Lomb-Scargle periodogram and report the dominant period.