{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 🐷 Susie Special Timing Object Usage" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "🔵 Import the necessary python libraries and Susie objects." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "from susie.timing_data import TimingData" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🔵 Other Timing Data Formats and Options\n", "\n", "The default option (shown in the example above) for timing data:\n", "\n", "* Is in JD TDB timing format and system\n", "* Includes mid-time uncertainties\n", "* Includes both transits AND occultations\n", "\n", "However, there are a number of options you have for creating timing objects. A few include:\n", "\n", "* Timing formats and systems different from JD TDB. For example, you can specify that your data is in JD with UTC timing system. If you do not specify the timing system, the code will default to UTC and will automatically correct for barycentric light travel time.\n", "\n", " NOTE: If you choose to specify a different timing format and/or systems, or if you choose not to specify the timing system, REMEMBER the code will automatically convert your time to JD TDB timing format and system. If this happens, you will need to include some additional information including the position of your object in the sky (in RA and Dec) and the position of your observing location on Earth (in longitude and latitude). You ARE REQUIRED to input the coordinates of your object. You ARE NOT REQUIRED to specify your location on Earth, but this will generate a default position on Earth that corresponds to the North Pole.\n", "\n", "* No mid-time uncertainties. In this case, a placeholder list of 1s will be generated for functional purposes.\n", "\n", "* No list specifying transits and occultations. If you do not include a list specifying if the data included is a transit or occultation (this will be the tra_or_occ parameter), then the code defaults to transits and will generate a list of 'tra' that has a number of values equal to the number of values of your epochs array.\n", "\n", "Below are examples of how these options would work." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 🔷 Download the example timing data (includes transit and occultation data in Barycentric Julian Date) from the GitHub repository" ] }, { "cell_type": "code", "execution_count": 3, "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": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 🔷 Using Timing Data that is NOT in JD TDB Format and/or System\n", "\n", "Using timing data that is not corrected for barcentric light travel time and is in a timing format and system other than JD TDB. For example, we will assume this data is in the JD timing format with the UTC time scale. \n", "\n", "NOTE: If you do not include a timing system parameter when you create the TimingData object, it will default to UTC and correct for barycentric light travel time" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 🔹 Option 1: Including BOTH Object Coordinates and Observatory Coordinates\n", "\n", "For this example, we show creating the object:\n", "* WITHOUT specifying the timing system, which will default to UTC\n", "* WITH specifying the timing system as UTC\n", "\n", "Note: These will both be the exact same because if the object is not given a timing system, it will default to UTC.\n", "\n", "\n", "We also include positional data for both:\n", "* the **object coordinates**, which includes the right ascension and declination of WASP 12-b\n", "* the **location of the observatory**, which includes the latitude and longitude of the Boise State observatory. \n", "\n", "Note: This data was not collected from the BSU observatory, we just use this as an example. Also note, this data is already corrected for barycentric light travel time, so the resulting data is not actually correct. This is JUST AN EXAMPLE. " ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Recieved time format jd and time scale None. Correcting all times to BJD timing system with TDB time scale. If no time scale is given, default is automatically assigned to UTC. If this is incorrect, please set the time format and time scale for TransitTime object.\n", "WARNING: Using ICRS coordinates in degrees of RA and Dec (np.float64(97.64), np.float64(29.67)) for time correction. Using geodetic Earth coordinates in degrees of longitude and latitude (np.float64(-116.21), np.float64(43.6)) for time correction.\n", "WARNING: Recieved time format jd and time scale utc. Correcting all times to BJD timing system with TDB time scale. If no time scale is given, default is automatically assigned to UTC. If this is incorrect, please set the time format and time scale for TransitTime object.\n", "WARNING: Using ICRS coordinates in degrees of RA and Dec (np.float64(97.64), np.float64(29.67)) for time correction. Using geodetic Earth coordinates in degrees of longitude and latitude (np.float64(-116.21), np.float64(43.6)) for time correction.\n" ] } ], "source": [ "# Not including time scale. Will default to UTC\n", "timing_obj2 = TimingData('jd', epochs, mid_times, mid_time_uncertainties=mid_time_errs, object_ra=97.64, object_dec=29.67, observatory_lat=43.60, observatory_lon=-116.21)\n", "# OR including time scale as UTC\n", "timing_obj2 = TimingData('jd', epochs, mid_times, mid_time_uncertainties=mid_time_errs, time_scale='utc', object_ra=97.64, object_dec=29.67, observatory_lat=43.60, observatory_lon=-116.21)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now the TimingData object contains the corrected mid-times and mid-time uncertainties. To see these corrected values, you can print the variables of the object by running the code below." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# Uncomment this ↓↓↓↓ to see the real data!\n", "\n", "# for key, value in vars(timing_obj2).items():\n", "# print(f\"{key}: {value}\\n\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 🔹 Option 2: Including ONLY Object Coordinates\n", "\n", "We can also opt to **not include any observatory coordinates** (due to not knowing where to data was taken, for example). If this is not passed in, the object will default to the gravitational center of the Earth at x=0, y=0, z=0. \n", "\n", "We include positional data for the **object coordinates**, which includes the right ascension and declination of WASP 12-b. \n", "\n", "Note: This data is already corrected for barycentric light travel time, so the resulting data is not actually correct. This is JUST AN EXAMPLE. \n", "\n", " Don't be scared of the warnings! These are just warnings, nothing is wrong." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Recieved time format jd and time scale utc. Correcting all times to BJD timing system with TDB time scale. If no time scale is given, default is automatically assigned to UTC. If this is incorrect, please set the time format and time scale for TransitTime object.\n", "WARNING: Unable to process observatory coordinates (None, None). Using gravitational center of Earth.\n", "WARNING: Using ICRS coordinates in degrees of RA and Dec (np.float64(97.64), np.float64(29.67)) for time correction. Using geodetic Earth coordinates in degrees of longitude and latitude (np.float64(0.0), np.float64(90.0)) for time correction.\n" ] } ], "source": [ "# Including time scale as UTC. NOT passing in observatory coordinates\n", "timing_obj3 = TimingData('jd', epochs, mid_times, mid_time_uncertainties=mid_time_errs, time_scale='utc', object_ra=97.64, object_dec=29.67)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# Uncomment this ↓↓↓↓ to see the real data!\n", "\n", "# for key, value in vars(timing_obj3).items():\n", "# print(f\"{key}: {value}\\n\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 🔷 Using Timing Data that does NOT include uncertainties\n", "\n", "We do not have to include uncertainties for our mid-time data. If no uncertainties are given, the object will generate a default placeholder of 1's with the same number of values that are in your `epochs` array." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Recieved value of None for mid time uncertainties. Auto-populating placeholder values of 0.001 for uncertainties.\n" ] } ], "source": [ "# Create new transit times object with above data\n", "timing_obj4 = TimingData('jd', epochs, mid_times, time_scale='tdb')" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "# Uncomment this ↓↓↓↓ to see the real data!\n", "\n", "# for key, value in vars(timing_obj4).items():\n", "# print(f\"{key}: {value}\\n\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 🔷 Using Timing Data that does NOT include a transit or occultation array\n", "\n", "We also do not need to include a `tra_or_occ` array. For example, if you only have transit data, you most likely would not include a `tra_or_occ` array because all of your data are transits. If we do not provide an array for `tra_or_occ`, then the object will generate a default placeholder of 'tra' with the same number of values that are in your `epochs` array." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "# Create new transit times object with above data\n", "timing_obj5 = TimingData('jd', epochs, mid_times, mid_time_uncertainties=mid_time_errs, time_scale='tdb')" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "# Uncomment this ↓↓↓↓ to see the real data!\n", "\n", "# for key, value in vars(timing_obj5).items():\n", "# print(f\"{key}: {value}\\n\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are many different ways to create your TimingData object. Once you have created the TimingData object with as much information as you can provide, continue with the [**🔵 Basic Usage**](https://susie.readthedocs.io/en/latest/basic_usage.html) workflow tutorial." ] } ], "metadata": { "kernelspec": { "display_name": "docs_env", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }