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]:
target | start time (UTC) | end time (UTC) | duration (minutes) | ra (h) | ra (m) | ra (s) | dec (d) | dec (m) | dec (s) | configuration |
---|---|---|---|---|---|---|---|---|---|---|
str9 | str23 | str23 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object |
Nemesis-5 | 2021-08-02 04:00:00.029 | 2021-08-02 08:00:00.029 | 239.99999999999994 | 23.0 | 48.0 | 47.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)
target | start time (UTC) | end time (UTC) | duration (minutes) | ra (h) | ra (m) | ra (s) | dec (d) | dec (m) | dec (s) | configuration |
---|---|---|---|---|---|---|---|---|---|---|
str11 | str23 | str23 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object |
Sp1845-6357 | 2021-08-01 22:56:20.017 | 2021-08-02 04:00:00.029 | 303.6668666666665 | 18.0 | 45.0 | 8.664480000022934 | -63.0 | -57.0 | -47.46239999999375 | {'filt': 'i', 'texp': '20'} |
Nemesis-5 | 2021-08-02 04:00:00.029 | 2021-08-02 08:00:00.029 | 239.99999999999994 | 23.0 | 48.0 | 47.59920000001159 | -7.0 | -51.0 | -48.66840000000053 | {'filt': 'I+z', 'texp': '59'} |
Sp2331-2749 | 2021-08-02 08:00:00.029 | 2021-08-02 10:40:00.017 | 159.9998 | 23.0 | 31.0 | 21.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]:
target | start time (UTC) | end time (UTC) | duration (minutes) | ra (h) | ra (m) | ra (s) | dec (d) | dec (m) | dec (s) | configuration |
---|---|---|---|---|---|---|---|---|---|---|
str9 | str23 | str23 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object |
WASP-85Ab | 2020-12-11 03:09:40.027 | 2020-12-11 07:08:00.027 | 238.3333333333334 | 11.0 | 43.0 | 38.00820000000698 | 6.0 | 33.0 | 49.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)
target | start time (UTC) | end time (UTC) | duration (minutes) | ra (h) | ra (m) | ra (s) | dec (d) | dec (m) | dec (s) | configuration |
---|---|---|---|---|---|---|---|---|---|---|
str11 | str23 | str23 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object |
NGTS-11 | 2020-12-10 19:05:40.009 | 2020-12-11 03:09:40.027 | 484.00029999999987 | 1.0 | 34.0 | 5.148000000001645 | -14.0 | -25.0 | -8.93639999999678 | {'filt=g', 'texp=10'} |
Sp0840+1824 | 2020-12-11 00:49:00.009 | 2020-12-11 03:09:40.027 | 140.66696666666675 | 8.0 | 40.0 | 29.634552000006664 | 18.0 | 24.0 | 8.726760000003821 | {'texp=26', 'filt=I+z'} |
WASP-85Ab | 2020-12-11 03:09:40.027 | 2020-12-11 07:07:41.682 | 238.0275833333333 | 11.0 | 43.0 | 38.00820000000698 | 6.0 | 33.0 | 49.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]:
target | start time (UTC) | end time (UTC) | duration (minutes) | ra (h) | ra (m) | ra (s) | dec (d) | dec (m) | dec (s) | configuration |
---|---|---|---|---|---|---|---|---|---|---|
str11 | str23 | str23 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object |
Trappist-1b | 2020-09-15 20:40:20.012 | 2020-09-15 22:21:00.012 | 100.66666666666669 | 23.0 | 6.0 | 28.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)
target | start time (UTC) | end time (UTC) | duration (minutes) | ra (h) | ra (m) | ra (s) | dec (d) | dec (m) | dec (s) | configuration |
---|---|---|---|---|---|---|---|---|---|---|
str13 | str23 | str23 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | object |
Sp0008+4918 | 2020-09-15 20:02:00.010 | 2020-09-15 20:40:20.012 | 38.333366666666834 | 0.0 | 8.0 | 55.362840000000055 | 49.0 | 18.0 | 56.32019999999159 | {'filt=I+z', 'texp=20'} |
Trappist-1b | 2020-09-15 20:40:20.012 | 2020-09-15 22:21:00.012 | 100.66666666666669 | 23.0 | 6.0 | 28.999920000019017 | -5.0 | -2.0 | -27.99996000000064 | {'filt': 'I+z', 'texp': '23'} |
Sp0008+4918_2 | 2020-09-15 22:21:00.012 | 2020-09-16 06:00:40.010 | 459.66663333333315 | 0.0 | 8.0 | 55.362840000000055 | 49.0 | 18.0 | 56.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 fornb_days
, number of days you wish to make plan for (starting at the date define inday
)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_blocksnb_days
, number of days you wish to upload (starting at the date define inday
)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