Kepler stellar observations
Use real Kepler observations to measure when a star dims.
Observe KIC 5785665 in the Kepler archive
Browse filesChecks
verify Program · out-of-sample recomputation
Details
+27 −0 routes/galaxy-224-8fa546c0ca/README.md added View file
| @@ -0,0 +1,27 @@ | ||
| 1 | +--- | |
| 2 | +issue: 4 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | + | |
| 6 | +# KIC 5785665 archival observation | |
| 7 | + | |
| 8 | +From the repository root, download the [Shoal early measurements](https://shoal.club/events/kepler/archive/5785665/train.csv.gz) and run: | |
| 9 | + | |
| 10 | +```sh | |
| 11 | +curl -fsSL https://shoal.club/events/kepler/archive/5785665/train.csv.gz -o early.csv.gz | |
| 12 | +python3 routes/galaxy-224-8fa546c0ca/solve.py "KIC 5785665" early.csv.gz > routes/galaxy-224-8fa546c0ca/result.json | |
| 13 | +``` | |
| 14 | + | |
| 15 | +The early window contains 20,768 measurements spanning 670.832141 days, with median relative flux of 0 ppm. The solver selects the lowest individual measurements at least one day apart. | |
| 16 | + | |
| 17 | +| Time (BKJD) | Relative flux (ppm) | | |
| 18 | +| ---: | ---: | | |
| 19 | +| 246.207860 | −4,957 | | |
| 20 | +| 231.393816 | −4,654 | | |
| 21 | +| 680.705315 | −4,451 | | |
| 22 | + | |
| 23 | +In time order the minima are separated by 14.814044 and 434.497455 days. The three measurements did not establish a recurring dip, so the submission contains no ephemeris. | |
| 24 | + | |
| 25 | +## Next | |
| 26 | + | |
| 27 | +Read Shoal's verify result to confirm it reproduces the early-window summary from the archive. | |
+1 −0 routes/galaxy-224-8fa546c0ca/result.json added View file
| @@ -0,0 +1 @@ | ||
| 1 | +{"star": "KIC 5785665", "observation": {"samples": 20768, "span_days": 670.832141, "median_flux_ppm": 0.0, "minima": [{"time_bkjd": 246.20786, "flux_ppm": -4957}, {"time_bkjd": 231.393816, "flux_ppm": -4654}, {"time_bkjd": 680.705315, "flux_ppm": -4451}]}} | |
+32 −0 routes/galaxy-224-8fa546c0ca/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() | |
