Example #1
0
 def _read(self, configFile):
     if configFile is None:
         return
     configDir = siteUtils.configDir()
     for line in open(configFile):
         key, value = line.strip().split("=")
         self[key.strip()] = _quote(os.path.realpath(os.path.join(configDir, value.strip())))
Example #2
0
 def _read(self, configFile):
     if configFile is None:
         return
     configDir = siteUtils.configDir()
     for line in open(configFile):
         key, value = line.strip().split("=")
         self[key.strip()] = os.path.realpath(os.path.join(configDir, value.strip()))
Example #3
0
def ccsProducer(jobName, ccsScript, makeBiasDir=False, verbose=True):
    """
    Run the CCS data acquistion script under the CCS jython interpreter.
    """
    if makeBiasDir:
        os.mkdir("bias")

    ccs = CcsJythonInterpreter("ts")
#    setup = CcsSetup('%s.cfg' % jobName)
# change to using a single config from the main config directory
    configDir = siteUtils.configDir()
#    setup = CcsSetup('%s/acq.cfg' % configDir )
    setup = CcsSetup(None)

    result = ccs.syncScriptExecution(siteUtils.jobDirPath(ccsScript), setup(),
                                     verbose=verbose)
    output = open("%s.log" % jobName, "w")
    output.write(result.getOutput())
    output.close()
Example #4
0
def ccsProducer(jobName, ccsScript, ccs_setup_class=None, sys_paths=(),
                verbose=True):
    """
    Run the CCS data acquistion script under the CCS jython interpreter.
    """
    if ccs_setup_class is None:
        ccs_setup_class = CcsSetup

    ccs = CcsJythonInterpreter("ts")
    configDir = siteUtils.configDir()
    setup = ccs_setup_class('%s/acq.cfg' % configDir, sys_paths=sys_paths)

    full_script_path = siteUtils.jobDirPath(ccsScript, jobName=jobName)
    result = ccs.syncScriptExecution(full_script_path, setup(), verbose=verbose)

    output = open("%s.log" % jobName, "w")
    output.write(result.getOutput())
    output.close()
    if result.thread.java_exceptions:
        raise RuntimeError("java.lang.Exceptions raised:\n%s"
                           % '\n'.join(result.thread.java_exceptions))
Example #5
0
def ccsProducer(jobName, ccsScript, makeBiasDir=False, verbose=True):
    """
    Run the CCS data acquistion script under the CCS jython interpreter.
    """
    if makeBiasDir:
        os.mkdir("bias")

    jport = 4444
    if os.environ.has_key('CCS_JSON_PORT'):
        jport=os.getenv('CCS_JSON_PORT')

    ccs = CcsJythonInterpreter("ts",None,int(jport))
#    ccs = CcsJythonInterpreter("ts")
#    setup = CcsSetup('%s.cfg' % jobName)
# change to using a single config from the main config directory
    configDir = siteUtils.configDir()
    setup = CcsSetup('%s/acq.cfg' % configDir )

    result = ccs.syncScriptExecution(siteUtils.jobDirPath(ccsScript), setup(),
                                     verbose=verbose)
    output = open("%s.log" % jobName, "w")
    output.write(result.getOutput())
    output.close()
Example #6
0
def getEotestCalibsFile():
    """
    Return the full path to the eotest calibrations file.
    """
    return os.path.join(siteUtils.configDir(), 'eotest_calibrations.cfg')
def getEotestCalibsFile():
    """
    Return the full path to the eotest calibrations file.
    """
    return os.path.join(siteUtils.configDir(), 'eotest_calibrations.cfg')
Example #8
0
#!/usr/bin/env python
"""
Validator script for ts8_generic_acq harnessed job.
"""
import os
import shutil
import lcatr.schema
import siteUtils
from ccsTools import ccsValidator

# Copy the rtmacqcfgfile to the working directory, and persist it.
acq_cfg = os.path.join(siteUtils.configDir(), 'acq.cfg')
with open(acq_cfg) as fobj:
    for line in fobj:
        if line.startswith('rtmacqcfgfile'):
            image_sequence_file = line.strip().split('=')[1].strip()
shutil.copy(image_sequence_file, '.')

results = [lcatr.schema.fileref.make(os.path.basename(image_sequence_file))]

ccsValidator(results)
Example #9
0
png_files = glob.glob('*.png')
results.extend([lcatr.schema.fileref.make(item,
                                          metadata=md(DATA_PRODUCT=eotestUtils.png_data_product(item, sensor_id)))
                for item in png_files])

test_report = '%s_eotest_report.pdf' % sensor_id
results.append(lcatr.schema.fileref.make(test_report,
                                         metadata=md(DATA_PRODUCT='EOTEST_REPORT')))

results.extend(siteUtils.jobInfo())

#
# CCS configuration files
#
config_dir = siteUtils.configDir()
ccs_configs = os.path.join(config_dir, 'acq.cfg')
shutil.copy(ccs_configs, '.')
results.append(lcatr.schema.fileref.make(os.path.basename(ccs_configs)))
for line in open(ccs_configs):
    if line.find('=') == -1:
        continue
    tokens = line.strip().split('=')
    filename = os.path.join(config_dir, tokens[1].strip())
    try:
        shutil.copy(filename, '.')
        results.append(lcatr.schema.fileref.make(os.path.basename(filename)))
    except:
        pass

lcatr.schema.write_file(results)