def __init__(self, configFile, sys_paths=()):
        """
        configFile contains the names of the site-specific
        configuration files.  File basenames are provided in
        configFile, and the full paths are constructed in the
        _read(...) method.
        """
        super(CcsSetup, self).__init__()
        self.commands = []
        self['tsCWD'] = os.getcwd()
        self['labname'] = siteUtils.getSiteName()
        self['jobname'] = siteUtils.getJobName()
        self['CCDID'] = siteUtils.getUnitId()
        self['UNITID'] = siteUtils.getUnitId()
        self['LSSTID'] = siteUtils.getLSSTId()
        try:
            self['RUNNUM'] = siteUtils.getRunNumber()
        except Exception:
            self['RUNNUM'] = "no_lcatr_run_number"

        self['ts'] = os.getenv('CCS_TS', default='ts')
        self['archon'] = os.getenv('CCS_ARCHON', default='archon')

        # The following are only available for certain contexts.
        if 'CCS_VAC_OUTLET' in os.environ:
            self['vac_outlet'] = os.getenv('CCS_VAC_OUTLET')
        if 'CCS_CRYO_OUTLET' in os.environ:
            self['cryo_outlet'] = os.getenv('CCS_CRYO_OUTLET')
        if 'CCS_PUMP_OUTLET' in os.environ:
            self['pump_outlet'] = os.getenv('CCS_PUMP_OUTLET')

        self._read(os.path.join(siteUtils.getJobDir(), configFile))

        self.sys_paths = sys_paths
Beispiel #2
0
import shutil
import os
import matplotlib.pyplot as plt
import ccs_trending
import siteUtils
import time

jobDir = siteUtils.getJobDir()

shutil.copy("%s/ts_quantities.cfg" % jobDir, os.getcwd())
shutil.copy("%s/ts8_quantities.cfg" % jobDir, os.getcwd())

ccsProducer('RTM_thermo', 'ccsthermal.py')
#ccsProducer('RTM_thermo', 'ts7_stats.py')

raft_id = siteUtils.getLSSTId()
run_number = siteUtils.getRunNumber()
host = 'localhost'
ccs_subsystem = 'ts'

tm = time.time()
start = time.strftime('%Y-%m-%dT%H:%M:%S', time.localtime(tm - 300))
end = time.strftime('%Y-%m-%dT%H:%M:%S', time.localtime(tm))

milestones = ('2017-10-06T00:00:00', '2017-10-06T23:59:59')

config_file = 'ts_quantities.cfg'

time_axis = ccs_trending.TimeAxis(start=start, end=end, nbins=1000)
config = ccs_trending.ccs_trending_config(config_file)
for section in config.sections():
Beispiel #3
0
    def __init__(self, configFile):
        """
        configFile contains the names of the site-specific
        configuration files.  File basenames are provided in
        configFile, and the full paths are constructed in the
        _read(...) method.
        """
        super(CcsSetup, self).__init__()
        if os.environ.has_key('CCS_TS8'):
            self['ts8']=_quote(os.getenv('CCS_TS8'))
        else:
            self['ts8'] = _quote('ts8')
        if os.environ.has_key('CCS_JYTH'):
            self['jyth']=_quote(os.getenv('CCS_JYTH'))
        else:
            self['jyth'] = _quote('JythonInterpreterConsole')
        if os.environ.has_key('CCS_JSON_PORT'):
            self['jsonport']=os.getenv('CCS_JSON_PORT')
        else:
            self['jsonport'] = 4444
        if os.environ.has_key('CCS_PS'):
            self['ps']=_quote(os.getenv('CCS_PS'))
        else:
            self['ps'] = _quote('ccs-rebps')
        if os.environ.has_key('CCS_TS'):
            self['ts']=_quote(os.getenv('CCS_TS'))
        else:
            self['ts'] = _quote('ts')
        if os.environ.has_key('CCS_ARCHON'):
            self['archon']=_quote(os.getenv('CCS_ARCHON'))
        else:
            self['archon'] = _quote('archon')
        if os.environ.has_key('CCS_VAC_OUTLET'):
            self['vac_outlet']=os.getenv('CCS_VAC_OUTLET')
# there is no default for vac_outlet - if there is a script that needs
# it and it has not been defined then I want it to crash
        if os.environ.has_key('CCS_CRYO_OUTLET'):
            self['cryo_outlet']=os.getenv('CCS_CRYO_OUTLET')
# there is no default for cryo_outlet - if there is a script that needs
# it and it has not been defined then I want it to crash
        if os.environ.has_key('CCS_PUMP_OUTLET'):
            self['pump_outlet']=os.getenv('CCS_PUMP_OUTLET')
# there is no default for pump_outlet - if there is a script that needs
# it and it has not been defined then I want it to crash
        self['tsCWD'] = _quote(os.getcwd())
        self['labname'] = _quote(siteUtils.getSiteName())
        self['jobname'] = _quote(siteUtils.getJobName())
        self['CCDID'] = _quote(siteUtils.getUnitId())
        self['UNITID'] = _quote(siteUtils.getUnitId())
        self['LSSTID'] = _quote(siteUtils.getLSSTId())

        unitid = siteUtils.getUnitId()
        CCDTYPE = _quote(siteUtils.getUnitType())
        ccdnames = {}
        ccdmanunames = {}
        ccdnames,ccdmanunames = siteUtils.getCCDNames()

        print "retrieved the following LSST CCD names list"
        print ccdnames
        print "retrieved the following Manufacturers CCD names list"
        print ccdmanunames
        for slot in ccdnames :
            print "CCD %s is in slot %s" % (ccdnames[slot],slot)
            self['CCD%s'%slot] = _quote(ccdnames[slot])
            if 'itl' in ccdnames[slot].lower() :
                CCDTYPE = 'itl'
            if 'e2v' in ccdnames[slot].lower() :
                CCDTYPE = 'e2v'
        for slot in ccdmanunames :
            print "CCD %s is in slot %s" % (ccdmanunames[slot],slot)
            self['CCDMANU%s'%slot] = _quote(ccdmanunames[slot])
        try:
            self['RUNNUM'] = _quote(siteUtils.getRunNumber())
        except:
            self['RUNNUM'] = "no_lcatr_run_number"
            pass
        self._read(os.path.join(siteUtils.getJobDir(), configFile))

        print "CCDTYPE = %s" % CCDTYPE
        self['sequence_file'] = _quote("NA")
        self['acffile'] = self['itl_acffile']
# set default type
        self['CCSCCDTYPE'] = _quote("ITL")
        if ("RTM" in unitid.upper() or "ETU" in unitid.upper() or "RSA" in unitid.upper()) :
            if ("e2v" in CCDTYPE) :
                self['CCSCCDTYPE'] = _quote("E2V")
                self['acffile'] = self['e2v_acffile']
                self['sequence_file'] = self['e2v_seqfile']
            else :
                self['CCSCCDTYPE'] = _quote("ITL")
                self['acffile'] = self['itl_acffile']
                self['sequence_file'] = self['itl_seqfile']
            os.system("export | grep -i seq")
            seqdir = ""
            if os.environ.has_key('SEQUENCERFILESDIR') :
                seqdir = os.getenv('SEQUENCERFILESDIR')
                print "seqdir=",seqdir
                self['sequence_file'] = self['sequence_file'].replace('${SEQUENCERFILESDIR}',seqdir)
            os.system("cp -vp %s %s" % (self['sequence_file'],self['tsCWD']))

            # now use the local copy
#            bb = self['sequence_file'].split("/")
#            self['sequence_file'] = _quote("%s/%s" % (os.getcwd(),bb[len(bb)-1].split("'")[0]))
            print "The sequence file to be used is %s" % self['sequence_file']
        else :
            if ("ITL" in CCDTYPE) :
                self['CCSCCDTYPE'] = _quote("ITL")
                self['acffile'] = self['itl_acffile']
            if ("e2v" in CCDTYPE) :
                self['CCSCCDTYPE'] = _quote("E2V")
                self['acffile'] = self['e2v_acffile']
            print "The acffile to be used is %s" % self['acffile']
#!/usr/bin/env python
import Tkinter
import glob
import shutil
import os
import matplotlib.pyplot as plt
import ccs_trending
import siteUtils
import time
import subprocess

raft_id = siteUtils.getLSSTId()
run_number = siteUtils.getRunNumber()

host = 'localhost'

jobDir = siteUtils.getJobDir()

shutil.copy("%s/ts_quantities.cfg" % jobDir ,os.getcwd())
shutil.copy("%s/ts8_quantities.cfg" % jobDir ,os.getcwd())

ccsProducer('RTM_thermo', 'ccsthermal.py')

cdir = os.getcwd()

#rtmstatelist = [
#"RTM_off_5min_stable__502",
#"REB_quiescient_record__505",
#"RTM_quies_5min_record__508",
#"RTM_biases_5min_record__510",
#"RTM_clears_5min_record__512",