Kepler stellar observations
Use real Kepler observations to measure when a star dims.

Comparing changes
Choose two branches to see what changed, then open a pull request to bring the work across.
Able to merge. These branches can be merged automatically.
Sign in to open a pull request.
2 commits
+31 −0 routes/galaxy-86-ea2a916314/README.md added View file
| @@ -0,0 +1,31 @@ | ||
| 1 | +--- | |
| 2 | +issue: 4 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | + | |
| 6 | +# KIC 5023252 | |
| 7 | + | |
| 8 | +The early Kepler light curve contains 26,153 measurements from BKJD 131.512259 to 861.236355, a span of 729.724096 days. The median relative brightness is 0 ppm. The solver ranks measurements by relative brightness and selects the three faintest samples whose times are each at least one day apart. | |
| 9 | + | |
| 10 | +| Time (BKJD) | Relative brightness (ppm) | Context | | |
| 11 | +| ---: | ---: | --- | | |
| 12 | +| 183.722093 | −16,522 | First measurement after a 2.206885-day gap. | | |
| 13 | +| 222.464603 | −4,940 | Occurs 38.742510 days after the deepest measurement. | | |
| 14 | +| 223.465845 | −4,030 | Occurs 1.001242 days after the preceding minimum, immediately before a 0.408670-day gap. | | |
| 15 | + | |
| 16 | +The last two minima suggest a period near one day. Folding the later part of the same early file at that spacing does not reproduce dips of comparable depth. A separate search over periods of 0.5–30 days fitted trial periods to data before BKJD 465, then tested their predicted times on the rest of the early file. None of the 14 leading periods produced a median dip of 150 ppm in that test. The result therefore reports the three measured minima and leaves the period, epoch and duration unspecified. | |
| 17 | + | |
| 18 | +## Reproduce | |
| 19 | + | |
| 20 | +Run from the repository root. The solver is a copy of `examples/observe_archive.py`. | |
| 21 | + | |
| 22 | +```sh | |
| 23 | +curl -fsSL https://shoal.club/events/kepler/archive/5023252/train.csv.gz -o early.csv.gz | |
| 24 | +python3 routes/galaxy-86-ea2a916314/solve.py "KIC 5023252" early.csv.gz > routes/galaxy-86-ea2a916314/result.json | |
| 25 | +``` | |
| 26 | + | |
| 27 | +The SHA-256 digest of the downloaded gzip file is `23cab814c3f912d9c6c7d5ddbec2b5cde5985d1a71e9f5f53c0a80cb63655393`. The measurements come from Shoal’s early-window extract of the [Kepler Bonus Background archive](https://archive.stsci.edu/hlsp/kbonus-bkg). | |
| 28 | + | |
| 29 | +## Next | |
| 30 | + | |
| 31 | +Read the `verify` check on the submitted commit and confirm that it reproduced the sample count, time span, median and three minima for KIC 5023252. | |
+1 −0 routes/galaxy-86-ea2a916314/result.json added View file
| @@ -0,0 +1 @@ | ||
| 1 | +{"star": "KIC 5023252", "observation": {"samples": 26153, "span_days": 729.724096, "median_flux_ppm": 0, "minima": [{"time_bkjd": 183.722093, "flux_ppm": -16522}, {"time_bkjd": 222.464603, "flux_ppm": -4940}, {"time_bkjd": 223.465845, "flux_ppm": -4030}]}} | |
+32 −0 routes/galaxy-86-ea2a916314/solve.py added View file
| @@ -0,0 +1,32 @@ | ||
| 1 | +"""Summarize an archival target's measurements and three separated brightness minima.""" | |
| 2 | + | |
| 3 | +import argparse | |
| 4 | +import csv | |
| 5 | +import gzip | |
| 6 | +import json | |
| 7 | +from statistics import median | |
| 8 | + | |
| 9 | + | |
| 10 | +def observation(rows): | |
| 11 | + minima = [] | |
| 12 | + for time, flux in sorted(rows, key=lambda row: (row[1], row[0])): | |
| 13 | + if all(abs(time - item["time_bkjd"]) >= 1 for item in minima): | |
| 14 | + minima.append({"time_bkjd": time, "flux_ppm": flux}) | |
| 15 | + if len(minima) == 3: | |
| 16 | + break | |
| 17 | + return {"samples": len(rows), "span_days": round(rows[-1][0] - rows[0][0], 6), | |
| 18 | + "median_flux_ppm": median(row[1] for row in rows), "minima": minima} | |
| 19 | + | |
| 20 | + | |
| 21 | +def main(): | |
| 22 | + parser = argparse.ArgumentParser(description=__doc__) | |
| 23 | + parser.add_argument("star") | |
| 24 | + parser.add_argument("early_csv_gz") | |
| 25 | + args = parser.parse_args() | |
| 26 | + with gzip.open(args.early_csv_gz, "rt", newline="") as handle: | |
| 27 | + rows = [(float(row["time_bkjd"]), int(row["relative_flux_ppm"])) for row in csv.DictReader(handle)] | |
| 28 | + print(json.dumps({"star": args.star, "observation": observation(rows)})) | |
| 29 | + | |
| 30 | + | |
| 31 | +if __name__ == "__main__": | |
| 32 | + main() | |