Commit a4da134abb6a9e42ae52d3feb8503d3864fb5344
1 parent
c3727d8b
Exists in
dev
Update AK.
Showing
1 changed file
with
9 additions
and
2 deletions
Show diff stats
src/core/pyros_django/scheduling/A_Scheduler.py
@@ -236,6 +236,10 @@ class A_Scheduler(Agent): | @@ -236,6 +236,10 @@ class A_Scheduler(Agent): | ||
236 | """ | 236 | """ |
237 | t0 = time.time() | 237 | t0 = time.time() |
238 | self.DPRINT = True | 238 | self.DPRINT = True |
239 | + | ||
240 | + # =================== | ||
241 | + # --- Initializations | ||
242 | + # =================== | ||
239 | # --- Get the incoming directory of the night | 243 | # --- Get the incoming directory of the night |
240 | info = self.get_infos() | 244 | info = self.get_infos() |
241 | rootdir = info['rootdir'] | 245 | rootdir = info['rootdir'] |
@@ -263,7 +267,10 @@ class A_Scheduler(Agent): | @@ -263,7 +267,10 @@ class A_Scheduler(Agent): | ||
263 | schedule_order = np.zeros(self.BINS_NIGHT, dtype=int) -1 | 267 | schedule_order = np.zeros(self.BINS_NIGHT, dtype=int) -1 |
264 | schedule_jd = np.zeros(self.BINS_NIGHT, dtype=float) | 268 | schedule_jd = np.zeros(self.BINS_NIGHT, dtype=float) |
265 | schedule_scientific_programm_id = np.zeros(self.BINS_NIGHT, dtype=int) -1 | 269 | schedule_scientific_programm_id = np.zeros(self.BINS_NIGHT, dtype=int) -1 |
270 | + | ||
271 | + # =========================================================================================================== | ||
266 | # --- Initialize the predictive schedule by the effective schedule from start of the current instant (=index) | 272 | # --- Initialize the predictive schedule by the effective schedule from start of the current instant (=index) |
273 | + # =========================================================================================================== | ||
267 | try: | 274 | try: |
268 | last_schedule = EffectiveSchedule.objects.last() | 275 | last_schedule = EffectiveSchedule.objects.last() |
269 | except EffectiveSchedule.DoesNotExist: | 276 | except EffectiveSchedule.DoesNotExist: |
@@ -285,7 +292,7 @@ class A_Scheduler(Agent): | @@ -285,7 +292,7 @@ class A_Scheduler(Agent): | ||
285 | schedule_jd[0:index] = schedule_eff_jd[0:index] | 292 | schedule_jd[0:index] = schedule_eff_jd[0:index] |
286 | schedule_scientific_programm_id[0:index] = schedule_eff_scientific_programm_id[0:index] | 293 | schedule_scientific_programm_id[0:index] = schedule_eff_scientific_programm_id[0:index] |
287 | else: | 294 | else: |
288 | - # --- Case when there is not ever effective schedule for this night | 295 | + # --- Case when there is no effective schedule for this night |
289 | print(f"No effective schedule for this night {night}") | 296 | print(f"No effective schedule for this night {night}") |
290 | else: | 297 | else: |
291 | # --- Case of invalid entry in the database | 298 | # --- Case of invalid entry in the database |
@@ -314,9 +321,9 @@ class A_Scheduler(Agent): | @@ -314,9 +321,9 @@ class A_Scheduler(Agent): | ||
314 | if os.path.exists(ephfile): | 321 | if os.path.exists(ephfile): |
315 | self.dprint(f"Read file {seqfile}") | 322 | self.dprint(f"Read file {seqfile}") |
316 | # --- seq_info = sequence dictionary | 323 | # --- seq_info = sequence dictionary |
317 | - # --- eph_info = ephemeris dictionary | ||
318 | seq_info = pickle.load(open(seqfile,"rb")) | 324 | seq_info = pickle.load(open(seqfile,"rb")) |
319 | #print("="*20 + "\n" + f"{seq_info=}") | 325 | #print("="*20 + "\n" + f"{seq_info=}") |
326 | + # --- eph_info = ephemeris dictionary | ||
320 | eph_info = pickle.load(open(ephfile,"rb")) | 327 | eph_info = pickle.load(open(ephfile,"rb")) |
321 | #print("="*20 + "\n" + f"{eph_info=}") | 328 | #print("="*20 + "\n" + f"{eph_info=}") |
322 | # --- | 329 | # --- |