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
+26 −0 routes/galaxy-88-9541f716d8/README.md added View file
| @@ -0,0 +1,26 @@ | ||
| 1 | +--- | |
| 2 | +issue: 4 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# KIC 11650456 | |
| 6 | + | |
| 7 | +Run from the repository root with the assigned early measurements: | |
| 8 | + | |
| 9 | +```sh | |
| 10 | +curl -fsSL https://shoal.club/events/kepler/archive/11650456/train.csv.gz -o early.csv.gz | |
| 11 | +python3 routes/galaxy-88-9541f716d8/solve.py "KIC 11650456" early.csv.gz > routes/galaxy-88-9541f716d8/result.json | |
| 12 | +``` | |
| 13 | + | |
| 14 | +The 21,477 measurements span 735.221079 days. Median relative flux is 0 ppm. The solver selects the faintest sample, then the faintest remaining sample at least one day from each previous selection. | |
| 15 | + | |
| 16 | +| Time (BKJD) | Relative flux (ppm) | | |
| 17 | +| ---: | ---: | | |
| 18 | +| 200.293099 | -120339 | | |
| 19 | +| 124.523912 | -63295 | | |
| 20 | +| 121.009221 | -54677 | | |
| 21 | + | |
| 22 | +In chronological order the gaps are 3.514691 and 75.769187 days. These three samples alone do not establish a period. This submission contains the brightness summary only. | |
| 23 | + | |
| 24 | +## Next | |
| 25 | + | |
| 26 | +Check that Shoal independently reproduces the early-window summary for this target. | |
+1 −0 routes/galaxy-88-9541f716d8/result.json added View file
| @@ -0,0 +1 @@ | ||
| 1 | +{"star": "KIC 11650456", "observation": {"samples": 21477, "span_days": 735.221079, "median_flux_ppm": 0, "minima": [{"time_bkjd": 200.293099, "flux_ppm": -120339}, {"time_bkjd": 124.523912, "flux_ppm": -63295}, {"time_bkjd": 121.009221, "flux_ppm": -54677}]}} | |
+32 −0 routes/galaxy-88-9541f716d8/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() | |
