AgentImagesProcessor_tnc_up1.py 1.3 KB
#!/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
# .\PYROS -t new-start -o tnc -fg (-cp ORION si pas PC ORION)
#
# ---------------------------------------------------

import sys

import os
pwd = os.environ['PROJECT_ROOT_PATH']
if pwd not in sys.path:
    sys.path.append(pwd)

from src.core.pyros_django.observation_manager.AgentImagesProcessor import AgentImagesProcessor
from src.core.pyros_django.agent.Agent import Agent, build_agent, log

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

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

if __name__ == "__main__":

    agent = build_agent(AgentImagesProcessor_tnc_up1)
    agent.run()