From 37c859f8c565a19f67ff660cbb3f98ba3d36654a Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Sun, 24 Nov 2024 10:52:53 -0600 Subject: [PATCH] Use TessInfo object instead of separate variables --- .../photometry/06-transit-fit-template.ipynb | 35 +++++-------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/stellarphot/notebooks/photometry/06-transit-fit-template.ipynb b/stellarphot/notebooks/photometry/06-transit-fit-template.ipynb index 31e5835d..dc0ab710 100644 --- a/stellarphot/notebooks/photometry/06-transit-fit-template.ipynb +++ b/stellarphot/notebooks/photometry/06-transit-fit-template.ipynb @@ -244,25 +244,8 @@ }, "outputs": [], "source": [ - "# Enter your object's period here\n", - "period = tess_info.period\n", - "\n", - "# Enter the epoch here\n", - "epoch = tess_info.epoch # Time(2458761.602894, scale='tdb', format='jd')\n", - "\n", - "# Enter the duration below\n", - "duration = tess_info.duration\n", - "\n", - "# Enter the transit depth here -- get the \"ppm\" value from ExoFOP-TESS\n", - "depth = tess_info.depth_ppt\n", - "\n", - "# Enter object name\n", - "obj = f\"TIC {tess_info.tic_id}\"\n", - "\n", - "\n", - "# 👇👇👇 BUG 🐛 BUG 🐛 BUG 🐛 BUG 👇👇👇👇\n", "# Enter filter\n", - "phot_filter = \"rp\"" + "phot_filter = passband.value" ] }, { @@ -363,8 +346,8 @@ }, "outputs": [], "source": [ - "cycle_number = int((then - epoch) / period + 1)\n", - "that_transit = cycle_number * period + epoch\n", + "cycle_number = int((then - tess_info.epoch) / tess_info.period + 1)\n", + "that_transit = cycle_number * tess_info.period + tess_info.epoch\n", "that_transit" ] }, @@ -383,9 +366,9 @@ }, "outputs": [], "source": [ - "start = that_transit - duration / 2\n", + "start = that_transit - tess_info.duration / 2\n", "mid = that_transit\n", - "end = that_transit + duration / 2\n", + "end = that_transit + tess_info.duration / 2\n", "\n", "after_transit = (photometry[\"bjd\"] - 2400000 * u.day) > end\n", "\n", @@ -546,9 +529,9 @@ "source": [ "mod.setup_model(\n", " t0=mid.jd - 2400000, # midpoint, BJD\n", - " depth=depth, # parts per thousand\n", - " duration=duration.to(\"day\").value, # days\n", - " period=period.to(\"day\").value, # days\n", + " depth=tess_info.depth, # parts per thousand\n", + " duration=tess_info.duration.to(\"day\").value, # days\n", + " period=tess_info.period.to(\"day\").value, # days\n", ")" ] }, @@ -856,7 +839,7 @@ "plt.xlabel(\"Barycentric Julian Date (TDB)\", fontname=\"Arial\")\n", "plt.ylabel(\"Relative Flux (normalized)\", fontname=\"Arial\")\n", "plt.title(\n", - " f\"{obj}.01 UT{date_obs}\\nPaul P. Feder Observatory 0.4m ({phot_filter} filter, {exposure_time} exp, fap 10-25-40)\",\n", + " f\"TIC {tess_info.tic_id}.01 UT{date_obs}\\nPaul P. Feder Observatory 0.4m ({phot_filter} filter, {exposure_time} exp, fap 10-25-40)\",\n", " fontsize=14,\n", " fontname=\"Arial\",\n", ")\n",