{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Using `spock_chilean` with a script" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The next few lines are meant to show you an example of how to use ``spock_chilean``. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For each target you wish to schedule you will need to provide:\n", "* A name\n", "* RA (in degrees)\n", "* DEC (in gegrees)\n", "* the time the observations start\n", "* the time the observations end\n", "* the filter \n", "* the exposure time\n", "* the J magnitude (*optional*)\n", "* the spectra type (*optional*)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Initialisation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First open a jupyter Notebook and copy the following cells. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import SPOCK_chilean\n", "from SPOCK_chilean.make_night_plans import chilean_time\n", "import warnings\n", "warnings.filterwarnings('ignore')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "telescope = 'Ganymede' # name of telescope allocated\n", "date = '2021-07-07' # start of night date\n", "\n", "\n", "chilean_nb_target = 2 # number of target to observe this night\n", "counts = 5000 # counts of images per targets (no limit = 5000)\n", "\n", "chilean_plans = chilean_time(date, telescope) # Initialize the chilean_time object\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data frame with information on targets" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DateTelescopeNameStartEndRADECFiltertexpCountsVmagSpT
02021-07-07GanymedeCh_WASP-1572021-07-07 22:30:00.0002021-07-08 03:00:00.000201.655291-8.317598r'10500012.90G2
12021-07-07GanymedeCh_HATS-242021-07-08 03:00:00.0002021-07-08 09:15:00.000268.890697-61.747324r'10500012.83F8
\n", "
" ], "text/plain": [ " Date Telescope Name Start \\\n", "0 2021-07-07 Ganymede Ch_WASP-157 2021-07-07 22:30:00.000 \n", "1 2021-07-07 Ganymede Ch_HATS-24 2021-07-08 03:00:00.000 \n", "\n", " End RA DEC Filter texp Counts Vmag \\\n", "0 2021-07-08 03:00:00.000 201.655291 -8.317598 r' 10 5000 12.90 \n", "1 2021-07-08 09:15:00.000 268.890697 -61.747324 r' 10 5000 12.83 \n", "\n", " SpT \n", "0 G2 \n", "1 F8 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "target_chilean = pd.DataFrame({'Date': date, 'Telescope': telescope, 'Name': 'Ch_WASP-157',\n", " 'Start': '2021-07-07 22:30:00.000',\n", " 'End': '2021-07-08 03:00:00.000',\n", " 'RA': 201.6552906,\n", " 'DEC': -8.3175976, 'Filter': 'r\\'',\n", " 'texp': 10,\n", " 'Counts': counts, 'Vmag': 12.9, 'SpT': 'G2'},\n", " index=[0])\n", "if chilean_nb_target > 1:\n", " other_target = {'Date': date, 'Telescope': telescope, 'Name': 'Ch_HATS-24',\n", " 'Start': '2021-07-08 03:00:00.000',\n", " 'End': '2021-07-08 09:15:00.000',\n", " 'RA': 268.8906975,\n", " 'DEC': -61.7473242,\n", " 'Filter': 'r\\'',\n", " 'texp': 10,\n", " 'Counts': counts, 'Vmag': 12.83, 'SpT': 'F8'}\n", " target_chilean = target_chilean.append(other_target, ignore_index=True, sort=False)\n", "\n", "display(target_chilean)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Make night_blocks" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[32mINFO: \u001b[30mThe optimum exposure time for Ch_WASP-157 SpT G2 and V magnitude 12.9 with Filter r' is: 10.214588666607755seconds\n", "For texp:10s, expected peak [ADU]:\t 44054.63741002936\n", "\u001b[32mINFO: \u001b[30m the exposure time chosen is ok, no saturation expected.\n", "\u001b[32mINFO: \u001b[30mThe optimum exposure time for Ch_HATS-24 SpT F8 and V magnitude 12.83 with Filter r' is: 9.897065800902036seconds\n", "For texp:10s, expected peak [ADU]:\t 45468.021437119896\n", "\u001b[32mINFO: \u001b[30m the exposure time chosen is ok, no saturation expected.\n" ] }, { "data": { "text/html": [ "Table length=2\n", "\n", "\n", "\n", "\n", "\n", "
targetstart time (UTC)end time (UTC)duration (minutes)ra (h)ra (m)ra (s)dec (d)dec (m)dec (s)configuration
str11str23str23float64float64float64float64float64float64float64str26
Ch_WASP-1572021-07-07 22:45:48.1792021-07-08 03:00:00.000254.1970165818929713.026.037.269744000010405-8.0-19.0-3.35135999999693{'filt': "r'", 'texp': 10}
Ch_HATS-242021-07-08 03:00:00.0002021-07-08 09:15:00.000374.999999776482617.055.033.767400000006376-61.0-44.0-50.367120000004775{'filt': "r'", 'texp': 10}
" ], "text/plain": [ "\n", " target start time (UTC) ... configuration \n", " str11 str23 ... str26 \n", "----------- ----------------------- ... --------------------------\n", "Ch_WASP-157 2021-07-07 22:45:48.179 ... {'filt': \"r'\", 'texp': 10}\n", " Ch_HATS-24 2021-07-08 03:00:00.000 ... {'filt': \"r'\", 'texp': 10}" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "chilean_plans.make_night_block(target_chilean)\n", "SPOCK_chilean.read_night_block(telescope, date)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Check night_blocks respect SPECULOOS constraints" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[32mINFO: \u001b[30mOK, filter chosen for Ch_WASP-157 is in the list\n", "\u001b[32mINFO: \u001b[30mOK, exposure time chosen for Ch_WASP-157 is >10s\n", "\u001b[32mINFO: \u001b[30mOK, field Ch_WASP-157 respects the elevation constraint\n", "\u001b[32mINFO: \u001b[30mOK, field Ch_WASP-157 respects the moon constraint\n", "\u001b[32mINFO: \u001b[30mOk, field Ch_WASP-157 is scheduled for more than 15 min\n", "\u001b[32mINFO: \u001b[30mOK, field Ch_WASP-157 does not contain a SPECULOOS target\n", "\u001b[32mINFO: \u001b[30mCheck completed, for Ch_WASP-157, you can send the night_blocks to educrot@uliege.be or to GXG831@student.bham.ac.uk. \n", "\u001b[32mINFO: \u001b[30mOK, filter chosen for Ch_HATS-24 is in the list\n", "\u001b[32mINFO: \u001b[30mOK, exposure time chosen for Ch_HATS-24 is >10s\n", "\u001b[32mINFO: \u001b[30mOK, field Ch_HATS-24 respects the elevation constraint\n", "\u001b[32mINFO: \u001b[30mOK, field Ch_HATS-24 respects the moon constraint\n", "\u001b[32mINFO: \u001b[30mOk, field Ch_HATS-24 is scheduled for more than 15 min\n", "\u001b[32mINFO: \u001b[30mOK, field Ch_HATS-24 does not contain a SPECULOOS target\n", "\u001b[32mINFO: \u001b[30mCheck completed, for Ch_HATS-24, you can send the night_blocks to educrot@uliege.be or to GXG831@student.bham.ac.uk. \n" ] }, { "data": { "text/plain": [ "True" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "chilean_plans.check_night_blocks()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.0" } }, "nbformat": 4, "nbformat_minor": 4 }