Blame view

privatedev/plugin/agent/AgentImagesProcessor_tnc_up1.py 1.38 KB
001a62c9   Alexis Koralewski   Update tnc config...
1
2
3
4
5
#!/usr/bin/env python3
#
# To launch this agent from the root of Pyros:
# verify this agent is associated to the computer in the obs config at UNITS/UNIT/AGENTS/AGENT/computer: AKlotzPersoComputer
# cd /srv/develop/pyros
ca6f746c   Alain Klotz   add some optins -cp
6
# .\PYROS -t new-start -o tnc -fg (-cp ORION si pas PC ORION)
001a62c9   Alexis Koralewski   Update tnc config...
7
8
9
#
# ---------------------------------------------------

a5118f00   Alain Klotz   Nouvel agent.
10
import sys
ec61e384   Alexis Koralewski   change main funct...
11
import argparse
febde77e   Alain Klotz   correction des pa...
12
13
14
15
import os
pwd = os.environ['PROJECT_ROOT_PATH']
if pwd not in sys.path:
    sys.path.append(pwd)
a5118f00   Alain Klotz   Nouvel agent.
16

027eaa78   Alexis Koralewski   Fixing AgentSST i...
17
from src.core.pyros_django.observation_manager.AgentImagesProcessor import AgentImagesProcessor
ec61e384   Alexis Koralewski   change main funct...
18
from src.core.pyros_django.agent.Agent import Agent, build_agent, log, parse_args
febde77e   Alain Klotz   correction des pa...
19
20
21
22
23
24
25
26
27

# = Specials
import glob
import shutil
import guitastro
path = os.path.join(pwd, "vendor/guitastro")
if path not in sys.path:
    sys.path.append(path)

a5118f00   Alain Klotz   Nouvel agent.
28
29
30
31
32
33
34
35
36
37
38
39
40
class AgentImagesProcessor_tnc_up1(AgentImagesProcessor):

    def bias_correction(self):

        # - Search the bias
        log.info("TOTO")
        path_bias = os.path.join( self._paths['ima_bias'], self._date_night )
        fitsbiasfiles = glob.glob(f"{path_bias}/*.fit")
        log.info(f"fitsbiasfiles = {fitsbiasfiles}")
        if len(fitsbiasfiles) > 0:
        
            # - Select the bias
            pass
027eaa78   Alexis Koralewski   Fixing AgentSST i...
41
42

if __name__ == "__main__":
ec61e384   Alexis Koralewski   change main funct...
43
44
    args =  parse_args(sys.argv[1:])
    agent = build_agent(AgentImagesProcessor_tnc_up1,param_constr=args)
027eaa78   Alexis Koralewski   Fixing AgentSST i...
45
    agent.run()