box-least-squares
Run an Astropy Box Least Squares (BLS) search for transit-like signals and **resolve half/double-period aliases** before finalizing and refining the orbital period.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- box-least-squares
- description
- Run an Astropy Box Least Squares (BLS) search for transit-like signals and **resolve half/double-period aliases** before finalizing and refining the orbital period.
03 SKILL.md 正文
Steps
- Prepare arrays
time(days),flux, and (ideally)flux_err; remove NaNs and pre-detrend the light curve (e.g., withlightkurve.flatten) so stellar variability doesn’t dominate. - Build the BLS model:
model = BoxLeastSquares(time * u.day, flux, dy=flux_err)
- Do a broad BLS search over a sensible duration grid:
durations = np.linspace(0.01, 0.3, N) * u.daypg = model.autopower(durations, objective="likelihood")(or"snr"if correlated noise dominates)
- Collect the strongest candidates (not just the top one):
- Sort indices by
pg.powerdescending; take topkperiods.
- Sort indices by
- For each candidate period
P, explicitly test harmonics before choosing a “true” period:- Evaluate
Pand2P(and optionallyP/2) usingcompute_stats(period, duration, transit_time)with matching(duration, t0)from the periodogram peak. - Prefer the period that yields:
- higher
stats["depth_snr"](or better objective), and - odd/even consistency:
abs(stats["depth_odd"] - stats["depth_even"])small compared tostats["depth_err"], and - a plausible
stats["transit_count"](not spuriously inflated by a half-period fold).
- higher
- Evaluate
- After selecting the alias-resolved period
P_true, refine around bothP_trueand its nearest harmonic (if applicable) on a dense grid, then re-apply the same alias check:- Example:
periods = np.linspace(P_true*(1-0.002), P_true*(1+0.002), 20000) * u.day pg_ref = model.power(periods, duration_best, objective="likelihood")- If the refined peak lands near
P/2or2P, repeat Step 5 and keep the physically consistent choice.
- Example:
- Phase-fold at the final period (and optionally at
P/2and2P) as a sanity check that a single transit event repeats cleanly at the chosen period.
Expected Result
A best-fit orbital period that is not a harmonic/alias (e.g., avoids incorrectly reporting P/2 when odd/even statistics favor 2P) and is ready to be written (rounded) to the required output file.
04 同仓库更多 Skills
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms