示例#1
0
    def __init__(self):

        ChimeraObject.__init__(self)

        # debug log
        # self._debugLog = None
        self._debuglog = logging.getLogger("_tpldebug_")
        logfile = os.path.join(SYSTEM_CONFIG_DIRECTORY, "tpl.log")
        if os.path.exists(logfile):
            shutil.move(logfile, os.path.join(SYSTEM_CONFIG_DIRECTORY, "tpl.log_%s" % time.strftime("%Y%m%d-%H%M%S")))

        _log_handler = logging.FileHandler(logfile)
        _log_handler.setFormatter(
            logging.Formatter(
                fmt="%(asctime)s[%(levelname)s:%(threadName)s]-%(name)s-(%(filename)s:%(lineno)d):: %(message)s"
            )
        )
        # _log_handler.setLevel(logging.DEBUG)
        self._debuglog.setLevel(logging.DEBUG)
        self._debuglog.addHandler(_log_handler)
        self.log.setLevel(logging.INFO)

        # Command counter
        self.next_command_id = 1
        self.last_cmd_deleted = 0

        # Store received objects
        self.commands_sent = {}

        self._expect = [
            "(?P<CMDID>\d+) DATA INLINE (?P<OBJECT>\S+)=(?P<VALUE>.+)",
            "(?P<CMDID>\d+) DATA OK (?P<OBJECT>\S+)",
            "(?P<CMDID>\d+) COMMAND (?P<STATUS>\S+)",
            "(?P<CMDID>\d+) EVENT ERROR (?P<OBJECT>\S+):(?P<ENCM>(.*?)\s*)",
        ]
示例#2
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self._srv = None
        self._dispatcher = None
        self._srvThread = None
        self.host = None
    def __init__(self):
        ChimeraObject.__init__(self)

        self.telescope = None
        self.server = None

        self.error = False
示例#4
0
文件: camera.py 项目: agati/chimera
    def __init__(self):
        ChimeraObject.__init__(self)

        self.abort = threading.Event()
        self.abort.clear()

        self.__isExposing = threading.Event()
示例#5
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self.abort = threading.Event()
        self.abort.clear()

        self.__isExposing = threading.Event()

        self.extra_header_info = dict()
示例#6
0
文件: mkqueue.py 项目: tribeiro/SMAPS
	def __init__(self):
		'''
		Constructor.
		'''
        
		ChimeraObject.__init__(self)
		self.sunMaxAlt = -18.
		self.isJD = False
		self.tbin = 1./60./24. # Default time bin is 1 minute.
		self.tolairmass = 0.01
示例#7
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self.imageRequest = None
        self.filter = None

        self.currentRun = None

        self.best_fit = None

        self._debugging = False
        self._debug_images = []
        self._debug_image = 0

        self._log_handler = None
示例#8
0
    def __init__(self):

        ChimeraObject.__init__(self)

        # Command counter
        self.next_command_id = 1
        self.last_cmd_deleted = 0

        # Store received objects
        self.commands_sent = {}

        self._expect = [ '(?P<CMDID>\d+) DATA INLINE (?P<OBJECT>\S+)=(?P<VALUE>.+)',
                         '(?P<CMDID>\d+) DATA OK (?P<OBJECT>\S+)',
                         '(?P<CMDID>\d+) COMMAND (?P<STATUS>\S+)',
                         '(?P<CMDID>\d+) EVENT ERROR (?P<OBJECT>\S+):(?P<ENCM>(.*?)\s*)']
示例#9
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self.queue = Queue.Queue()
        self._mode = None

        # to reuse telescope proxy on control method
        self._tel = None
        self._telChanged = False

        # to cache for az_resolution of the dome
        self.controlAzRes = None

        self._waitAfterSlew = threading.Event()
        self._waitAfterSlew.clear()
示例#10
0
	def __init__(self):
		'''
		Constructor.
		'''
        
		ChimeraObject.__init__(self)
		
		#
		# Reading in configuration parameters
		#
		config = ConfigParser.RawConfigParser()
		
		if os.path.exists(os.path.join(os.path.expanduser('~/.chimera'),'tao.cfg')):
			config.read(os.path.join(os.path.expanduser('~/.chimera'),'tao.cfg'))
		else:
			log.warning('No user defined configuration found at %s. Using default values.'%(os.path.join(os.path.expanduser('~/.chimera'),'tao.cfg')))
			config.read(os.path.join(os.path.join(cfgpath,'../../tao.cfg')))

		#
		# Setting configuration parameters
		#
		self.stdFlag = config.get('TargetsInfo', 'Standard')
		self.sciFlag = config.get('TargetsInfo', 'Science')
		self.stdUser = config.get('TargetsInfo', 'stdUser')
		self.sciUser = config.get('TargetsInfo', 'sciUser')
		self.stdFile = config.get('TargetsInfo', 'stdFile')
		self.sciFile = config.get('TargetsInfo', 'sciFile')
		self.PATH = os.path.expanduser(config.get('Local', 'PATH'))
		
		self.sitelat = float(config.get('Site','sitelat'))
		self.sitelong = float(config.get('Site','sitelong'))
		self.sunMaxAlt = float(config.get('Site','sunMaxAlt'))
		
		self.filters = [i.replace(' ', '') for i in config.get('Instrument', 'Filters').split(',')]
		self.nfilters = len(self.filters)
		self.stdExpTime = [float(i) for i in config.get('TargetsInfo', 'stdExpTime').split(',')]
		self.sciExpTime = [float(i) for i in config.get('TargetsInfo', 'sciExpTime').split(',')]

		self.stdMaxAirmass = float(config.get('TargetsInfo','stdMaxAirmass'))

		#
		# These are time bins, which breaks the night in timely intervals. Bins is the time at the begining of the bin
		# and Mask is percent full. 
		self.obsTimeBins = []
		self.obsTimeMask = []

		self.isJD = False
示例#11
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self.imageRequest = None
        self.filter = None

        self.currentRun = None

        self._debugging = False
        self._debug_images = []
        self._debug_image = 0

        self._log_handler = None

        self._state = GuiderStatus.OFF

        self.abort = threading.Event()
        self.abort.clear()
示例#12
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self._operationStatus = {
                                 "site":            InstrumentOperationFlag.UNSET,
                                 "telescope":       InstrumentOperationFlag.UNSET,
                                 "camera":          InstrumentOperationFlag.UNSET,
                                 "dome":            InstrumentOperationFlag.UNSET,
                                 "scheduler":       InstrumentOperationFlag.UNSET,
                                 "domefan":         InstrumentOperationFlag.UNSET,
                                 "weatherstation":  InstrumentOperationFlag.UNSET,
                                 }

        self._telegramBroadcast = False
        self._telegramSocket = None
        self._testIP = '8.8.8.8' # Use google's dns IP as beacon to network connectivity

        self._log_handler = None

        self.checklist = None
        self.machine = None
        self.bot = None
示例#13
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self._sun = ephem.Sun()
        self._moon = ephem.Moon()
示例#14
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self._supports = {}
示例#15
0
 def __init__(self):
     ChimeraObject.__init__ (self)
     self.answer = 42
示例#16
0
 def __init__ (self):
     ChimeraObject.__init__ (self)
     self.ntrials = 0             # number times we try to center on a field
     self.nfields = 0             # number of fields we try to center on 
     self.checkedpointing = False # True = Standard field is verified
     self.currentField = 0        # counts fields tried to verify
示例#17
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self.imagesByID = OrderedDict()
        self.imagesByPath = OrderedDict()
示例#18
0
 def __init__(self):
     ChimeraObject.__init__(self)
     
     self.imagesByID   = {}
     self.imagesByPath = {}
示例#19
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self._in_fifo = None
        self._out_fifo = None
示例#20
0
 def __init__(self):
     ChimeraObject.__init__(self)
     
     self.executor = None
     self.scheduler = None
     self.machine = None
示例#21
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self.imageRequest = None
        self.filter = None
        self.currentRun = None
示例#22
0
文件: site.py 项目: agati/chimera
    def __init__(self):
        ChimeraObject.__init__(self)

        self._sun = ephem.Sun()
        self._moon = ephem.Moon()
示例#23
0
 def __init__ (self):
     ChimeraObject.__init__(self)
     self.counter = 0
示例#24
0
            def __init__(self):
                ChimeraObject.__init__(self)

                self.counter = 0
示例#25
0
 def __init__(self):
     ChimeraObject.__init__(self)
     self.answer = 42
示例#26
0
            def __init__(self):
                ChimeraObject.__init__(self)

                self.t0 = time.time()
    def __init__ (self):
        ChimeraObject.__init__(self)

        raise Exception("oops in __init__")
示例#28
0
 def __init__ (self):
     ChimeraObject.__init__(self)
     self.counter = 0
     self.results = []
示例#29
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self.imageRequest = None
        self.filter = None
        self.currentRun = None
示例#30
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self._park_position = None
 def __init__(self):
     ChimeraObject.__init__(self)
示例#32
0
 def __init__ (self):
     ChimeraObject.__init__(self)
示例#33
0
    def __init__(self):
        ChimeraObject.__init__(self)

        self._supports = {}