Esempio n. 1
0
    def makeEotestReport(self, butler):
        """After running eotest, generate pdf(s) of the results.

        Generate a sensor test report from the output data in config.eotestOutputPath, one for each CCD.
        The pdf file(s), along with the .tex file(s) and the individual plots are written
        to the eotestOutputPath.
        .pdf generation requires a TeX distro including pdflatex to be installed.
        """
        ccds = butler.queryMetadata('raw', self.config.ccdKey)
        for ccd in ccds:
            self.log.info("Starting test report generation for %s" % ccd)
            try:
                plotPath = os.path.join(self.config.eotestOutputPath, 'plots')
                if not os.path.exists(plotPath):
                    os.makedirs(plotPath)
                plots = sensorTest.EOTestPlots(ccd,
                                               self.config.eotestOutputPath,
                                               plotPath)
                eoTestReport = sensorTest.EOTestReport(plots, wl_dir='')
                eoTestReport.make_figures()
                eoTestReport.make_pdf()
            except Exception as e:
                self.log.warn("Failed to make eotest report for %s: %s" %
                              (ccd, e))
        self.log.info("Finished test report generation.")
# Software versions
summary_lims_file = processName_dependencyGlob('summary.lims',
                                               jobname='fe55_analysis')[0]
software_versions = siteUtils.parse_package_versions_summary(summary_lims_file)

# Test Stand configuration (extracted from one of the pixel data FITS headers)
teststand_config = OrderedDict()
fits_header = fits.open(wl_files[0])[0].header
for key in 'CCDBSS TEMP_SET CTLRCFG PIXRATE TSTAND'.split():
    try:
        teststand_config[key] = fits_header[key]
    except KeyError:
        print "missing", key, " in FITS header of", os.path.basename(
            wl_files[0])

# eTraveler activityIds
job_ids = siteUtils.aggregate_job_ids()
print "Job ids:"
for key, value in job_ids.items():
    print key, value
print

# Create the test report pdf.
report = sensorTest.EOTestReport(plots,
                                 wl_file_path,
                                 qa_plot_files=qa_plot_files,
                                 software_versions=software_versions,
                                 teststand_config=teststand_config,
                                 job_ids=job_ids)
report.make_pdf()
Esempio n. 3
0
pylab.savefig('%s_qe.png' % sensor_id)

# Crosstalk matrix
if xtalk_file is not None:
    plots.crosstalk_matrix(xtalk_file=xtalk_file)
    pylab.savefig('%s_crosstalk_matrix.png' % sensor_id)

# Flat fields at wavelengths nearest the centers of the standard bands
wl_file_path = os.path.split(wl_files[0])[0]
plots.flat_fields(wl_file_path)
pylab.savefig('%s_flat_fields.png' % sensor_id)

# Software versions
software_versions = OrderedDict()
summary_lims_file = processName_dependencyGlob('summary.lims',
                                               jobname='fe55_offline')[0]
foo = json.loads(open(summary_lims_file).read())
for result in foo:
    if result['schema_name'] == 'package_versions':
        for key, value in result.items():
            if key == 'schema_version':
                continue
            if key.endswith('_version'):
                software_versions[key] = value

# Create the test report pdf.
report = sensorTest.EOTestReport(plots,
                                 wl_file_path,
                                 software_versions=software_versions)
report.make_pdf()