{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 🐷💫 Susie Package Astroplan Schedule Generation Example" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🔵 Import the necessary python libraries and Susie objects." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Importing any packages and libraries needed, (Susie package coming directly from filesystem)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "from susie.timing_data import TimingData\n", "from susie.ephemeris import Ephemeris" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🔵 Import Data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Download the timing data (that includes occultations) from the GitHub repository" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "url = 'https://raw.githubusercontent.com/BoiseStatePlanetary/susie/main/example_data/wasp12b_tra_occ.csv'\n", "\n", "# Read the CSV file directly from the URL\n", "data = pd.read_csv(url)\n", "tra_or_occs = np.array(data[\"tra_or_occ\"])\n", "epochs = np.array(data[\"epoch\"].astype('int'))\n", "mid_times = np.array(data[\"mid_time\"])\n", "mid_time_errs = np.array(data[\"mid_time_err\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🔵 The Package" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 🔷 **STEP 1:** Add your transit and occultation data to the TimingData object." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Create new transit times object with above data\n", "timing_obj = TimingData('jd', epochs, mid_times, mid_time_uncertainties=mid_time_errs, tra_or_occ=tra_or_occs, time_scale='tdb')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 🔷 **STEP 2:** Create the Ephemeris object and add your TimingData object." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "ephemeris_obj = Ephemeris(timing_obj)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We'll use the quadratic model for this example. Get the model data dictionary from the ephemeris object." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "quad_model_data = ephemeris_obj.fit_ephemeris(\"quadratic\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we need two main objects to get the observing schedule\n", " 1. The Observer object, which is created using the observer's Earth location (with longitude, latitude, and elevation if known)\n", " 2. The Target object, which is created using the star's sky coordinates (with either the star's name or the right ascension and declination)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "# Create observer object (at Boise State)\n", "observer_obj = ephemeris_obj.create_observer_obj(timezone=\"US/Mountain\", longitude=-116.208710, latitude=43.602,\n", " elevation=821, name=\"BoiseState\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# Create target object (WASP-12)\n", "target_obj = ephemeris_obj.create_target_obj(\"WASP-12\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can call get observing schedule. For this we will need\n", " 1. Model data dictionary from ouru desired ephemeris (we will use the quadratic ephemeris that we created above)\n", " 2. A timezone (we will use US/Mountain for Boise State time)\n", " 3. The observer object (created above)\n", " 4. The target object (created above)\n", " 5. The number of transits we want in our schedule\n", " 6. The number of occultations we want in our schedule\n", " 7. The observation start time, which will be the moment we start looking for observable transits/occultations\n", " 8. And one of the two:\n", " - The name of the exoplanet, which will be used to get an eclipse duration OR\n", " - The eclipse duration itself if the object is either not a known exoplanet or you want to customize this parameter" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Unrecognized unit: 'hour' for column pl_trandur. [astroquery.ipac.nexsci.nasa_exoplanet_archive.core]\n", "WARNING: Unrecognized unit: 'hour' for column pl_trandur.\n" ] }, { "data": { "text/html": [ "
| \n", " | ingress | \n", "egress | \n", "type | \n", "
|---|---|---|---|
| 5 | \n", "2024-01-09 20:13:13 -0700 | \n", "2024-01-09 23:13:16 -0700 | \n", "occultation | \n", "
| 6 | \n", "2024-01-10 22:24:51 -0700 | \n", "2024-01-11 01:24:55 -0700 | \n", "occultation | \n", "
| 7 | \n", "2024-01-12 00:36:30 -0700 | \n", "2024-01-12 03:36:34 -0700 | \n", "occultation | \n", "
| 0 | \n", "2024-01-15 20:17:16 -0700 | \n", "2024-01-15 23:17:19 -0700 | \n", "transit | \n", "
| 1 | \n", "2024-01-16 22:28:54 -0700 | \n", "2024-01-17 01:28:58 -0700 | \n", "transit | \n", "
| 2 | \n", "2024-01-18 00:40:33 -0700 | \n", "2024-01-18 03:40:37 -0700 | \n", "transit | \n", "
| 8 | \n", "2024-01-21 20:21:18 -0700 | \n", "2024-01-21 23:21:22 -0700 | \n", "occultation | \n", "
| 9 | \n", "2024-01-22 22:32:57 -0700 | \n", "2024-01-23 01:33:01 -0700 | \n", "occultation | \n", "
| 10 | \n", "2024-01-24 00:44:36 -0700 | \n", "2024-01-24 03:44:39 -0700 | \n", "occultation | \n", "
| 3 | \n", "2024-01-27 20:25:21 -0700 | \n", "2024-01-27 23:25:25 -0700 | \n", "transit | \n", "
| 4 | \n", "2024-01-28 22:37:00 -0700 | \n", "2024-01-29 01:37:04 -0700 | \n", "transit | \n", "
| 11 | \n", "2024-02-02 20:29:24 -0700 | \n", "2024-02-02 23:29:28 -0700 | \n", "occultation | \n", "