Short-term scheduling

Here we present the short-term scheduling module. The short-term scheduling module of spock has been concived to modify existing plan in order to add special or follow up observations, like transits or monitoring for instance.

Note: Before you insert new observations and upload them please make sure you have informed the SPECULOOS consortium

1- Special target

WARNING: First of all, users must ensure that they have entered requiered information of the target they wish to schedule in the WG6 spread sheet. Either under the tab Annex_Targets_V2-STARS for a external program observation without specific ephemeris or the tab Annex_Targets_V1-PLANETS if ephemeris (mostly transits) are required.

For a special observation with given start/end time

Here is the existing night_blocks for a given date and a given telescope:

[28]:
import SPOCK.stats as SPOCKstats

SPOCKstats.read_night_plans_server(telescope='Io',date='2021-08-01')
[28]:
target start time (UTC) end time (UTC) duration (minutes) ra (h) ra (m) ra (s) dec (d) dec (m) dec (s) configuration
0 Sp1845-6357 2021-08-01 22:56:20.017 2021-08-02 04:44:00.017 347.666667 18.0 45.0 8.66448 -63.0 -57.0 -47.4624 {'filt': 'i', 'texp': '20'}
1 Sp2331-2749 2021-08-02 04:44:20.017 2021-08-02 10:40:00.017 355.666667 23.0 31.0 21.75288 -27.0 -49.0 -49.6056 {'filt': 'I+z', 'texp': '28'}

First you want to create the night_blocks . The only esstial information are:

  • the name of the site, ex: obs_name = 'SSO'

  • the name of the telescope (because there can be several telescope per site), ex: telescope ='Europa'

  • the date the night starts, ex: day_of_night ='2020-12-12 15:00:00'

  • and the name of your target, input_name = 'Trappist-1'

  • start and end time in a list, ex: start_end_range = ['2020-12-12 23:00:00','2020-12-13 01:00:00']

NB: you must first have filled info on the target on the WG6 spread sheet beforehand

This is the block you wish to insert:

[29]:
import SPOCK.short_term_scheduler as SPOCKST
from astropy.time import Time

schedule = SPOCKST.Schedules()

schedule.load_parameters()
schedule.day_of_night = Time('2021-08-01 15:00:00')
schedule.observatory_name = 'SSO'
schedule.telescope = 'Io'
schedule.start_end_range = Time(['2021-08-02 04:00:00','2021-08-02 08:00:00'])

schedule.special_target_with_start_end(input_name="Nemesis-5")


INFO:  Not using moon phase in ETC

[29]:
Table length=1
targetstart time (UTC)end time (UTC)duration (minutes)ra (h)ra (m)ra (s)dec (d)dec (m)dec (s)configuration
str9str23str23float64float64float64float64float64float64float64object
Nemesis-52021-08-02 04:00:00.0292021-08-02 08:00:00.029239.9999999999999423.048.047.59920000001159-7.0-51.0-48.66840000000053{'filt': 'I+z', 'texp': '59'}

Now you modify existing plan to insert your observation block:

[30]:
schedule.make_scheduled_table()
schedule.planification()
schedule.make_night_block()
INFO:  Local path does not exist yet
INFO:  situation 9
INFO:  situation 2
INFO:  no transition block

Here is how the modified |night blocks| looks like:

[31]:
display(schedule.scheduled_table_sorted)
Table length=3
targetstart time (UTC)end time (UTC)duration (minutes)ra (h)ra (m)ra (s)dec (d)dec (m)dec (s)configuration
str11str23str23float64float64float64float64float64float64float64object
Sp1845-63572021-08-01 22:56:20.0172021-08-02 04:00:00.029303.666866666666518.045.08.664480000022934-63.0-57.0-47.46239999999375{'filt': 'i', 'texp': '20'}
Nemesis-52021-08-02 04:00:00.0292021-08-02 08:00:00.029239.9999999999999423.048.047.59920000001159-7.0-51.0-48.66840000000053{'filt': 'I+z', 'texp': '59'}
Sp2331-27492021-08-02 08:00:00.0292021-08-02 10:40:00.017159.999823.031.021.752880000023254-27.0-49.0-49.60559999999447{'filt': 'I+z', 'texp': '28'}

For a special target that you wish to observe as much as possible

Here is the existing |night blocks| for a given date and a given telescope:

[32]:
import SPOCK.stats as SPOCKstats

SPOCKstats.read_night_plans_server(telescope='Artemis',date='2020-12-10')
[32]:
target start time (UTC) end time (UTC) duration (minutes) ra (h) ra (m) ra (s) dec (d) dec (m) dec (s) configuration
0 NGTS-11 2020-12-10 19:05:40.009 2020-12-11 00:49:00.009 343.333333 1.0 34.0 5.148000 -14.0 -25.0 -8.93640 {'filt=g', 'texp=10'}
1 Sp0840+1824 2020-12-11 00:49:00.009 2020-12-11 06:53:20.009 364.333333 8.0 40.0 29.634552 18.0 24.0 8.72676 {'texp=26', 'filt=I+z'}

First you want to create the night_blocks . The only essential information needed are:

  • the name of the site, ex: obs_name = 'SSO'

  • the name of the telescope (because there can be several telescope per site), ex: telescope = 'Europa'

  • the date the night starts, ex: day_of _night = '2020-12-12 15:00:00'

  • and the name of your target, input_name = 'Trappist-1'

NB: you must first have filled info on the target in target_list_special.txt beforehand

[33]:
import SPOCK.short_term_scheduler as SPOCKST
from astropy.time import Time

schedule = SPOCKST.Schedules()

schedule.load_parameters()
schedule.day_of_night = Time('2020-12-10 15:00:00')
schedule.observatory_name = 'SNO'
schedule.telescope = 'Artemis'
schedule.special_target(input_name="WASP-85Ab")



[33]:
Table length=1
targetstart time (UTC)end time (UTC)duration (minutes)ra (h)ra (m)ra (s)dec (d)dec (m)dec (s)configuration
str9str23str23float64float64float64float64float64float64float64object
WASP-85Ab2020-12-11 03:09:40.0272020-12-11 07:08:00.027238.333333333333411.043.038.008200000006986.033.049.45220639999988{'filt': "g'", 'texp': '10'}
[34]:
schedule.make_scheduled_table()
schedule.planification()
schedule.make_night_block()
INFO:  Local path does not exist yet
INFO:  situation 7
INFO:  situation 10, no change made to initial schedule
INFO:  situation 7
INFO:  no transition block

Here is how the modified night_blocks looks like:

[35]:
display(schedule.scheduled_table_sorted)
Table length=3
targetstart time (UTC)end time (UTC)duration (minutes)ra (h)ra (m)ra (s)dec (d)dec (m)dec (s)configuration
str11str23str23float64float64float64float64float64float64float64object
NGTS-112020-12-10 19:05:40.0092020-12-11 03:09:40.027484.000299999999871.034.05.148000000001645-14.0-25.0-8.93639999999678{'filt=g', 'texp=10'}
Sp0840+18242020-12-11 00:49:00.0092020-12-11 03:09:40.027140.666966666666758.040.029.63455200000666418.024.08.726760000003821{'texp=26', 'filt=I+z'}
WASP-85Ab2020-12-11 03:09:40.0272020-12-11 07:07:41.682238.027583333333311.043.038.008200000006986.033.049.45220639999988{'filt': "g'", 'texp': '10'}

2- Follow-up

Here is the existing night_blocks for a given date and a given telescope:

[36]:
import SPOCK.stats as SPOCKstats

SPOCKstats.read_night_plans_server(telescope='Artemis',date='2020-09-15')
[36]:
target start time (UTC) end time (UTC) duration (minutes) ra (h) ra (m) ra (s) dec (d) dec (m) dec (s) configuration
0 Sp0008+4918 2020-09-15 20:02:00.010 2020-09-16 06:00:40.010 598.666667 0.0 8.0 55.36284 49.0 18.0 56.3202 {'filt=I+z', 'texp=20'}
[37]:
import SPOCK.short_term_scheduler as SPOCKST
from astropy.time import Time

schedule = SPOCKST.Schedules()

schedule.load_parameters()
schedule.day_of_night = Time('2020-09-15 15:00:00')
schedule.observatory_name = 'SNO'
schedule.telescope = 'Artemis'

schedule.transit_follow_up(input_name="Trappist-1b")
INFO:  Trappist-1b next transit:  ['2020-09-15 21:05:27.228']

INFO:  start_transit of  Trappist-1b  :  2020-09-15 20:47:17.958
INFO:   end_transit of  Trappist-1b  :  2020-09-15 21:23:36.498
INFO:   Transit is expected to be full.
[37]:
Table length=1
targetstart time (UTC)end time (UTC)duration (minutes)ra (h)ra (m)ra (s)dec (d)dec (m)dec (s)configuration
str11str23str23float64float64float64float64float64float64float64object
Trappist-1b2020-09-15 20:40:20.0122020-09-15 22:21:00.012100.6666666666666923.06.028.999920000019017-5.0-2.0-27.99996000000064{'filt': 'I+z', 'texp': '23'}
[38]:
schedule.make_scheduled_table()
schedule.planification()
schedule.make_night_block()
INFO:  Local path does not exist yet
INFO:  situation 6
INFO:  no transition block
[39]:
display(schedule.scheduled_table_sorted)
Table length=3
targetstart time (UTC)end time (UTC)duration (minutes)ra (h)ra (m)ra (s)dec (d)dec (m)dec (s)configuration
str13str23str23float64float64float64float64float64float64float64object
Sp0008+49182020-09-15 20:02:00.0102020-09-15 20:40:20.01238.3333666666668340.08.055.36284000000005549.018.056.32019999999159{'filt=I+z', 'texp=20'}
Trappist-1b2020-09-15 20:40:20.0122020-09-15 22:21:00.012100.6666666666666923.06.028.999920000019017-5.0-2.0-27.99996000000064{'filt': 'I+z', 'texp': '23'}
Sp0008+4918_22020-09-15 22:21:00.0122020-09-16 06:00:40.010459.666633333333150.08.055.36284000000005549.018.056.32019999999159{'filt=I+z', 'texp=20'}

3- Save your plans and night blocks

If you are satisfied with this modified night_blocks you can save it. Executing this cell will upadate your local spock database. The night_blocks will be saved in your_spock_path + "/DATABASE/telescope/Archive_night_blocks/"

[40]:
schedule = SPOCKST.Schedules()
schedule.day_of_night = Time('2021-08-01 15:00:00')
schedule.telescope = 'Io'

SPOCKST.save_schedule(save=True,over_write=True,day=schedule.day_of_night,telescope=schedule.telescope)

INFO:  "/Users/elsaducrot/spock_2/night_blocks_propositions/night_blocks_Io_2021-08-01.txt" has been over-written to "/Users/elsaducrot/spock_2/DATABASE/Io/"

Now that you have saved the night block it’s time to create the ACP plans to send to the control PC of the corresonding telescope. To do so you just have to execute the cell below with the following information:

  • day, start date you wish to make ACP plans for

  • nb_days, number of days you wish to make plan for (starting at the date define in day)

  • telescope, name of the telescope at sake

ACP plans will be saved in your_spock_path + "/DATABASE/telescope/Plans_by_date/"

4- Make ACP format plans

[41]:
SPOCKST.make_plans(day = schedule.day_of_night,nb_days=1,telescope = schedule.telescope)

INFO:  Path exists and is:  /Users/elsaducrot/spock_2/DATABASE/Io/night_blocks_Io_2021-08-01.txt
WARNING:  not possible at that time because of altitude constraint, adding 20 degrees altitude

Now you can upload these ACP plans and night_blocks to the Cambridge Archive as well as the plans sent to the control PCs. You will just need to provide :

  • day, start date you for which you wish to upload plans and night_blocks

  • nb_days, number of days you wish to upload (starting at the date define in day)

  • telescope, name of the telescope at sake

5- upload your plans and night_blocks on the control computers and archive

[42]:
SPOCKST.upload_plans(day=schedule.day_of_night, nb_days=1,telescope = schedule.telescope)
-----> 2021-08-01 Plans uploaded on the Cambridge server
-----> 2021-08-01 Night plans uploaded on the Cambridge server
-----> 2021-08-01 Zip Plans_by_dates folder uploaded on the Cambridge server
-----> 2021-08-01 Zip Plans_by_dates folder uploaded on the HUB for Io
INFO:  Path local 'Gant chart' =  /Users/elsaducrot/spock_2/SPOCK_Figures/Preview_schedule.html
INFO:  Path database = 'Gant chart' =  speculoos@appcs.ra.phy.cam.ac.uk:/appct/data/SPECULOOSPipeline/Preview_schedule.html