Skip to content

Commit

Permalink
Use TessInfo object instead of separate variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mwcraig committed Nov 24, 2024
1 parent 30e8af4 commit 37c859f
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions stellarphot/notebooks/photometry/06-transit-fit-template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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"
]
},
Expand All @@ -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",
Expand Down Expand Up @@ -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",
")"
]
},
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 37c859f

Please sign in to comment.