Commit 704f72aaf0fab85eba94cb5ea3a66b5ea4aa88bb

Authored by Alexis Koralewski
2 parents ee49c1dd df7db463
Exists in dev

Merge branch 'dev' of https://gitlab.irap.omp.eu/epallier/pyros into dev

Showing 20 changed files with 232 additions and 186 deletions   Show diff stats
privatedev/config/tnc/device_FLI_KITS_sn2x1.yml renamed to privatedev/config/tnc/device_FLI_KITS_sn2J5079310.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_FLI_KITS_generic.yml
8   - inventory_label: GPS-FLI-2x1
9   - sn: SN2x1
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_FLI_KITS_generic.yml
  8 + inventory_label: GPS-FLI-2J5079310
  9 + sn: SN2J5079310
... ...
privatedev/config/tnc/device_FLI_KITS_sn2x2.yml renamed to privatedev/config/tnc/device_FLI_KITS_sn2J5080516.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_FLI_KITS_generic.yml
8   - inventory_label: GPS-FLI-2x2
9   - sn: SN2x2
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_FLI_KITS_generic.yml
  8 + inventory_label: GPS-FLI-2J5080516
  9 + sn: SN2J5080516
... ...
privatedev/config/tnc/device_FLI_KITS_sn2x3.yml renamed to privatedev/config/tnc/device_FLI_KITS_sn2J5086166.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_FLI_KITS_generic.yml
8   - inventory_label: GPS-FLI-2x3
9   - sn: SN2x3
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_FLI_KITS_generic.yml
  8 + inventory_label: GPS-FLI-2J5086166
  9 + sn: SN2J5086166
... ...
privatedev/config/tnc/device_FLI_KITS_sn2x4.yml renamed to privatedev/config/tnc/device_FLI_KITS_sn2J5086174.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_FLI_KITS_generic.yml
8   - inventory_label: GPS-FLI-2x4
9   - sn: SN2x4
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_FLI_KITS_generic.yml
  8 + inventory_label: GPS-FLI-2J5086174
  9 + sn: SN2J5086174
... ...
privatedev/config/tnc/device_FLI_Kepler4040_sn28212x1.yml renamed to privatedev/config/tnc/device_FLI_Kepler4040_sn3014521.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_FLI_Kepler4040_noshutter_generic.yml
8   - inventory_label: CAM-FLI-28212x1
9   - sn: KL28212x1
10   -
11   - ATTACHED_DEVICES:
12   - - file: device_FLI_KITS_sn2x1.yml
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_FLI_Kepler4040_noshutter_generic.yml
  8 + inventory_label: CAM-FLI-3014521
  9 + sn: KL3014521
  10 +
  11 + ATTACHED_DEVICES:
  12 + - file: device_FLI_KITS_sn2J5086174.yml
... ...
privatedev/config/tnc/device_FLI_Kepler4040_sn28212x2.yml renamed to privatedev/config/tnc/device_FLI_Kepler4040_sn3024521.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_FLI_Kepler4040_noshutter_generic.yml
8   - inventory_label: CAM-FLI-28212x2
9   - sn: KL28212x2
10   -
11   - ATTACHED_DEVICES:
12   - - file: device_FLI_KITS_sn2x2.yml
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_FLI_Kepler4040_noshutter_generic.yml
  8 + inventory_label: CAM-FLI-3024521
  9 + sn: KL3024521
  10 +
  11 + ATTACHED_DEVICES:
  12 + - file: device_FLI_KITS_sn2J5086166.yml
... ...
privatedev/config/tnc/device_FLI_Kepler4040_sn28212x3.yml renamed to privatedev/config/tnc/device_FLI_Kepler4040_sn3034521.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_FLI_Kepler4040_noshutter_generic.yml
8   - inventory_label: CAM-FLI-28212x3
9   - sn: KL28212x3
10   -
11   - ATTACHED_DEVICES:
12   - - file: device_FLI_KITS_sn2x3.yml
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_FLI_Kepler4040_noshutter_generic.yml
  8 + inventory_label: CAM-FLI-3034521
  9 + sn: KL3034521
  10 +
  11 + ATTACHED_DEVICES:
  12 + - file: device_FLI_KITS_sn2J5080516.yml
... ...
privatedev/config/tnc/device_FLI_Kepler4040_sn28212x4.yml renamed to privatedev/config/tnc/device_FLI_Kepler4040_sn3044521.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_FLI_Kepler4040_noshutter_generic.yml
8   - inventory_label: CAM-FLI-28212x4
9   - sn: KL28212x4
10   -
11   - ATTACHED_DEVICES:
12   - - file: device_FLI_KITS_sn2x4.yml
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_FLI_Kepler4040_noshutter_generic.yml
  8 + inventory_label: CAM-FLI-3044521
  9 + sn: KL3044521
  10 +
  11 + ATTACHED_DEVICES:
  12 + - file: device_FLI_KITS_sn2J5079310.yml
... ...
privatedev/config/tnc/device_Optec_TFC19740_sn001.yml renamed to privatedev/config/tnc/device_Optec_TFC19740_sn1198.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_Optec_TFC19740_generic.yml
8   - inventory_label: FOC-OPT-001
9   - sn: SN001
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_Optec_TFC19740_generic.yml
  8 + inventory_label: FOC-OPT-1198
  9 + sn: SN1198
... ...
privatedev/config/tnc/device_Optec_TFC19740_sn002.yml renamed to privatedev/config/tnc/device_Optec_TFC19740_sn1199.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_Optec_TFC19740_generic.yml
8   - inventory_label: FOC-OPT-002
9   - sn: SN002
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_Optec_TFC19740_generic.yml
  8 + inventory_label: FOC-OPT-1199
  9 + sn: SN1199
... ...
privatedev/config/tnc/device_Optec_TFC19740_sn003.yml renamed to privatedev/config/tnc/device_Optec_TFC19740_sn1200.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_Optec_TFC19740_generic.yml
8   - inventory_label: FOC-OPT-003
9   - sn: SN003
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_Optec_TFC19740_generic.yml
  8 + inventory_label: FOC-OPT-1200
  9 + sn: SN1200
... ...
privatedev/config/tnc/device_Optec_TFC19740_sn004.yml renamed to privatedev/config/tnc/device_Optec_TFC19740_sn1240.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_Optec_TFC19740_generic.yml
8   - inventory_label: FOC-OPT-004
9   - sn: SN004
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_Optec_TFC19740_generic.yml
  8 + inventory_label: FOC-OPT-1240
  9 + sn: SN1240
... ...
privatedev/config/tnc/device_Takahashi_180ED_sn002.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_Takahashi_180ED_generic.yml
8   - inventory_label: OPT-TKA-002
9   - sn: SN002
10   -
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_Takahashi_180ED_generic.yml
  8 + inventory_label: OPT-TKA-2A3015
  9 + sn: SN2A3015
  10 +
... ...
privatedev/config/tnc/device_Takahashi_180ED_sn001.yml renamed to privatedev/config/tnc/device_Takahashi_180ED_sn2A3015.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_Takahashi_180ED_generic.yml
8   - inventory_label: OPT-TKA-001
9   - sn: SN001
10   -
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_Takahashi_180ED_generic.yml
  8 + inventory_label: OPT-TKA-2A3015
  9 + sn: SN2A3015
  10 +
... ...
privatedev/config/tnc/device_Takahashi_180ED_sn003.yml renamed to privatedev/config/tnc/device_Takahashi_180ED_sn2A3022.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_Takahashi_180ED_generic.yml
8   - inventory_label: OPT-TKA-003
9   - sn: SN003
10   -
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_Takahashi_180ED_generic.yml
  8 + inventory_label: OPT-TKA-2A3022
  9 + sn: SN2A3022
  10 +
... ...
privatedev/config/tnc/device_Takahashi_180ED_sn004.yml renamed to privatedev/config/tnc/device_Takahashi_180ED_sn2A3023.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - generic: device_Takahashi_180ED_generic.yml
8   - inventory_label: OPT-TKA-004
9   - sn: SN004
10   -
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + generic: device_Takahashi_180ED_generic.yml
  8 + inventory_label: OPT-TKA-2A3023
  9 + sn: SN2A3023
  10 +
... ...
privatedev/config/tnc/observatory_tnc.yml
... ... @@ -35,7 +35,7 @@ OBSERVATORY:
35 35  
36 36 - DEVICE:
37 37 name: Takahashi_Epsilon_180ED_001
38   - file: device_Takahashi_180ED_sn001.yml
  38 + file: device_Takahashi_180ED_sn2A3015.yml
39 39  
40 40 - DEVICE:
41 41 name: Takahashi_Epsilon_180ED_002
... ... @@ -43,59 +43,59 @@ OBSERVATORY:
43 43  
44 44 - DEVICE:
45 45 name: Takahashi_Epsilon_180ED_003
46   - file: device_Takahashi_180ED_sn003.yml
  46 + file: device_Takahashi_180ED_sn2A3022.yml
47 47  
48 48 - DEVICE:
49 49 name: Takahashi_Epsilon_180ED_004
50   - file: device_Takahashi_180ED_sn004.yml
  50 + file: device_Takahashi_180ED_sn2A3023.yml
51 51  
52 52 - DEVICE:
53 53 name: FLI_Kepler4040_001
54   - file: device_FLI_Kepler4040_sn28212x1.yml
  54 + file: device_FLI_Kepler4040_sn3014521.yml
55 55  
56 56 - DEVICE:
57 57 name: FLI_Kepler4040_002
58   - file: device_FLI_Kepler4040_sn28212x2.yml
  58 + file: device_FLI_Kepler4040_sn3024521.yml
59 59  
60 60 - DEVICE:
61 61 name: FLI_Kepler4040_003
62   - file: device_FLI_Kepler4040_sn28212x3.yml
  62 + file: device_FLI_Kepler4040_sn3034521.yml
63 63  
64 64 - DEVICE:
65 65 name: FLI_Kepler4040_004
66   - file: device_FLI_Kepler4040_sn28212x4.yml
  66 + file: device_FLI_Kepler4040_sn3044521.yml
67 67  
68 68 - DEVICE:
69 69 name: FLI_KeplerGPS_001
70   - file: device_FLI_KITS_sn2x1.yml
  70 + file: device_FLI_KITS_sn2J5086174.yml
71 71  
72 72 - DEVICE:
73 73 name: FLI_KeplerGPS_002
74   - file: device_FLI_KITS_sn2x2.yml
  74 + file: device_FLI_KITS_sn2J5086166.yml
75 75  
76 76 - DEVICE:
77 77 name: FLI_KeplerGPS_003
78   - file: device_FLI_KITS_sn2x3.yml
  78 + file: device_FLI_KITS_sn2J5080516.yml
79 79  
80 80 - DEVICE:
81 81 name: FLI_KeplerGPS_004
82   - file: device_FLI_KITS_sn2x4.yml
  82 + file: device_FLI_KITS_sn2J5079310.yml
83 83  
84 84 - DEVICE:
85 85 name: Optec_TFC19740_001
86   - file: device_Optec_TFC19740_sn001.yml
  86 + file: device_Optec_TFC19740_sn1198.yml
87 87  
88 88 - DEVICE:
89 89 name: Optec_TFC19740_002
90   - file: device_Optec_TFC19740_sn002.yml
  90 + file: device_Optec_TFC19740_sn1199.yml
91 91  
92 92 - DEVICE:
93 93 name: Optec_TFC19740_003
94   - file: device_Optec_TFC19740_sn003.yml
  94 + file: device_Optec_TFC19740_sn1200.yml
95 95  
96 96 - DEVICE:
97 97 name: Optec_TFC19740_004
98   - file: device_Optec_TFC19740_sn004.yml
  98 + file: device_Optec_TFC19740_sn1240.yml
99 99  
100 100  
101 101 # === Inventory of available computers
... ...
privatedev/plugin/agent/AgentImagesCalibrator.py
... ... @@ -23,7 +23,7 @@ for short_path in short_paths:
23 23 if path not in sys.path:
24 24 sys.path.insert(0, path)
25 25  
26   -from src.core.pyros_django.agent.Agent import Agent, build_agent, log, parse_args
  26 +from src.core.pyros_django.agent.Agent import Agent, build_agent, log
27 27  
28 28 # = Specials
29 29 import glob
... ... @@ -64,10 +64,10 @@ class AgentImagesCalibrator(Agent):
64 64 =================================================================
65 65 """
66 66  
67   - def __init__(self, name:str=None, simulated_computer=None):
  67 + def __init__(self, name:str=None):
68 68 if name is None:
69 69 name = self.__class__.__name__
70   - super().__init__(simulated_computer=simulated_computer)
  70 + super().__init__()
71 71  
72 72 def _init(self):
73 73 super()._init()
... ... @@ -332,7 +332,7 @@ class AgentImagesCalibrator(Agent):
332 332 return s
333 333  
334 334 if __name__ == "__main__":
335   - args = parse_args(sys.argv[1:])
336   - agent = build_agent(AgentImagesCalibrator,param_constr=args)
  335 +
  336 + agent = build_agent(AgentImagesCalibrator)
337 337 print(agent)
338 338 agent.run()
... ...
privatedev/plugin/agent/AgentImagesProcessor.py
... ... @@ -10,6 +10,7 @@ import sys
10 10 import time
11 11 import argparse
12 12 import os
  13 +import pickle
13 14 pwd = os.environ['PROJECT_ROOT_PATH']
14 15 if pwd not in sys.path:
15 16 sys.path.append(pwd)
... ... @@ -21,7 +22,7 @@ for short_path in short_paths:
21 22 sys.path.insert(0, path)
22 23  
23 24 from src.core.pyros_django.agent.Agent import Agent, build_agent, log, parse_args
24   -
  25 +from routine_manager.models import Sequence
25 26 # = Specials
26 27 import glob
27 28 import shutil
... ... @@ -37,7 +38,8 @@ class AgentImagesProcessor(Agent):
37 38 # TODO: Redefine valid timeout
38 39 _AGENT_SPECIFIC_COMMANDS = {
39 40 # Format : โ€œcmd_nameโ€ : (timeout, exec_mode)
40   -
  41 +
  42 + "do_create_loadseq_1" : (60, Agent.EXEC_MODE.SEQUENTIAL, ''),
41 43 "do_create_test_images_1" : (60, Agent.EXEC_MODE.SEQUENTIAL, ''),
42 44 "do_create_test_images_2" : (60, Agent.EXEC_MODE.SEQUENTIAL, ''),
43 45 "do_stop_current_processing" : (60, Agent.EXEC_MODE.SEQUENTIAL, ''),
... ... @@ -48,7 +50,7 @@ class AgentImagesProcessor(Agent):
48 50 # AgentCmd.CMD_STATUS_CODE.CMD_EXECUTED
49 51 _TEST_COMMANDS_LIST = [
50 52 # Format : ("self cmd_name cmd_args", timeout, "expected_result", expected_status),
51   - (True, "self do_create_test_images_1", 200, '', Agent.CMD_STATUS.CMD_EXECUTED),
  53 + (True, "self do_create_loadseq_1", 200, '', Agent.CMD_STATUS.CMD_EXECUTED),
52 54 (True, "self do_stop asap", 500, "STOPPING", Agent.CMD_STATUS.CMD_EXECUTED),
53 55 ]
54 56  
... ... @@ -98,7 +100,7 @@ class AgentImagesProcessor(Agent):
98 100 self._routine_running = self.RUNNING_NOTHING
99 101 log.debug("end init()")
100 102  
101   - # Note : called by _routine_process() in Agent
  103 + # Note : calle d by _routine_process() in Agent
102 104 # @override
103 105 def _routine_process_iter_start_body(self):
104 106 log.debug("in routine_process_before_body()")
... ... @@ -129,6 +131,9 @@ class AgentImagesProcessor(Agent):
129 131 def do_stop_current_processing(self):
130 132 pass
131 133  
  134 + def do_create_loadseq_1(self):
  135 + self._create_loadseq_1()
  136 +
132 137 def do_create_test_images_1(self):
133 138 self._create_test_images_1()
134 139  
... ... @@ -140,6 +145,21 @@ class AgentImagesProcessor(Agent):
140 145 Methods called by commands or routine. Overload these methods
141 146 =================================================================
142 147 """
  148 + def _create_loadseq_1(self):
  149 + main_folder_path = os.environ['PROJECT_ROOT_PATH'] + "data/sequences_pickle"
  150 + nigth_id = ""
  151 + sequences = Sequence.objects.filter(night_id=nigth_id)
  152 + for sequence in sequences:
  153 + folder_path = main_folder_path + f"/P{sequence.period.id}/"+ f"{night_id}/"
  154 + file_name = folder_path + f"{sequence.id}.p"
  155 + if os.path.exists(file_name):
  156 + # if file exists, read it
  157 + seq_info = pickle.load(file_name)
  158 + target = seq_info["sequence"]["target_coords"]
  159 + ephem = seq_info.get("ephem")
  160 + # Sub folder per period PX (x is id of period)
  161 + # Sub folder per night
  162 + # File name is <sequence_name>.p
143 163  
144 164 def glob_images_to_process(self):
145 165  
... ... @@ -276,6 +296,16 @@ class AgentImagesProcessor(Agent):
276 296 Internal methods
277 297 =================================================================
278 298 """
  299 + def _create_test_loadseq_1(self):
  300 + try:
  301 + # === Define an image to test the processing and copy it in incoming directory
  302 + self._file_ima_test = os.path.join(self._path_data_root,"vendor/guitastro/tests/data/m57.fit")
  303 + file_in = self._file_ima_test
  304 + file_out = f"{self._paths['ima_incoming']}/m57.fit"
  305 + shutil.copyfile(file_in, file_out)
  306 + self._filename_manager.naming("")
  307 + except:
  308 + raise
279 309  
280 310 def _create_test_images_1(self):
281 311 try:
... ...
src/core/pyros_django/observation_manager/AgentImagesProcessor.py
... ... @@ -10,6 +10,7 @@ import sys
10 10 import time
11 11 import argparse
12 12 import os
  13 +import pickle
13 14 pwd = os.environ['PROJECT_ROOT_PATH']
14 15 if pwd not in sys.path:
15 16 sys.path.append(pwd)
... ... @@ -21,7 +22,7 @@ for short_path in short_paths:
21 22 sys.path.insert(0, path)
22 23  
23 24 from src.core.pyros_django.agent.Agent import Agent, build_agent, log, parse_args
24   -
  25 +from routine_manager.models import Sequence
25 26 # = Specials
26 27 import glob
27 28 import shutil
... ... @@ -99,7 +100,7 @@ class AgentImagesProcessor(Agent):
99 100 self._routine_running = self.RUNNING_NOTHING
100 101 log.debug("end init()")
101 102  
102   - # Note : called by _routine_process() in Agent
  103 + # Note : calle d by _routine_process() in Agent
103 104 # @override
104 105 def _routine_process_iter_start_body(self):
105 106 log.debug("in routine_process_before_body()")
... ... @@ -144,6 +145,21 @@ class AgentImagesProcessor(Agent):
144 145 Methods called by commands or routine. Overload these methods
145 146 =================================================================
146 147 """
  148 + def _create_loadseq_1(self):
  149 + main_folder_path = os.environ['PROJECT_ROOT_PATH'] + "data/sequences_pickle"
  150 + nigth_id = ""
  151 + sequences = Sequence.objects.filter(night_id=nigth_id)
  152 + for sequence in sequences:
  153 + folder_path = main_folder_path + f"/P{sequence.period.id}/"+ f"{night_id}/"
  154 + file_name = folder_path + f"{sequence.id}.p"
  155 + if os.path.exists(file_name):
  156 + # if file exists, read it
  157 + seq_info = pickle.load(file_name)
  158 + target = seq_info["sequence"]["target_coords"]
  159 + ephem = seq_info.get("ephem")
  160 + # Sub folder per period PX (x is id of period)
  161 + # Sub folder per night
  162 + # File name is <sequence_name>.p
147 163  
148 164 def glob_images_to_process(self):
149 165  
... ...