#!/usr/bin/env python """ Characterize CTE using Fe55 cluster asymmetries """ import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser( 'Characterize CTE using Fe55 cluster asymmetries') parser.add_argument('-f', '--fe55_file_pattern', type=str, help='Fe55 file pattern') parser.add_argument('-F', '--fe55_file_list', type=str, help='list of Fe55 files') parser.add_argument('--readout_direction', type=str, default='serial', help='readout direction to use: serial or parallel') args = parser.parse_args() task = sensorTest.Fe55CteTask() task.config.output_dir = args.output_dir task.config.direction = args.readout_direction task.config.verbose = args.verbose fe55_files = args.files(args.fe55_file_pattern, args.fe55_file_list) task.run(args.sensor_id, fe55_files, args.mask_files(fe55_files[0]))
#!/usr/bin/env python """ @brief Compute photon transfer curve for flat pair dataset. @author J. Chiang <*****@*****.**> """ import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Compute photon transfer curve') parser.add_argument('-f', '--flats', type=str, help='flat pairs file pattern') parser.add_argument('-F', '--flats_file_list', type=str, help='list of flat pair files') parser.add_argument('-R', '--rebinning_factor', type=int, help='rebinning factor', default=1) args = parser.parse_args() task = sensorTest.PtcTask() task.config.output_dir = args.output_dir task.config.verbose = args.verbose flat_files = args.files(args.flats, args.flats_file_list) bias_frame = args.bias_frame('%s_flat_bias_frame.fits' % args.sensor_id) task.run(args.sensor_id, flat_files, args.mask_files(flat_files[0]),
#!/usr/bin/env python """ @brief Persistence test. @author J. Chiang <*****@*****.**> """ from __future__ import print_function import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Compute image persistence.') parser.add_argument('--pre_flat_darks', type=str, help='file pattern for pre-flat dark files') parser.add_argument('--post_flat_darks', type=str, help='file pattern for post-flat dark files') parser.add_argument('--flat', type=str, help='filename of saturated flat') args = parser.parse_args() task = sensorTest.PersistenceTask() task.config.output_dir = args.output_dir task.config.verbose = args.verbose pre_flat_darks = args.files(args.pre_flat_darks, None) post_flat_darks = args.files(args.post_flat_darks, None) if args.verbose: print('processing pre-flat files:') for item in pre_flat_darks: print(' ', item) print('processing post-flat files:')
#!/usr/bin/env python import os import lsst.eotest.sensor as sensorTest import lsst.eotest.image_utils as imutils parser = sensorTest.TaskParser( 'PSF and system gain characterization from Fe55 data') parser.add_argument('-f', '--file_pattern', type=str, help='file pattern for Fe55 input files') parser.add_argument('-F', '--Fe55_file_list', type=str, help='file name of list of Fe55 files') parser.add_argument( '-C', '--fe55_catalog', type=str, default=None, help='Catalog of Fe55 charge cluster fits (supersedes input Fe55 frames') parser.add_argument('-c', '--chiprob_min', type=float, default=0.1, help='Mininum chi-square probability for cluster fit') parser.add_argument('-n', '--nsig', type=float, default=4, help='Footprint threshold in bias noise stdevs')
#!/usr/bin/env python from __future__ import print_function import os import sys import numpy as np import astropy.io.fits as fits import lsst.eotest.image_utils as imutils import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser( 'System gain characterization from Fe55 catalog') parser.add_argument('fe55_catalog', type=str, help='catalog of Fe55 charge clusters') parser.add_argument('-c', '--chiprob_min', type=float, default=0.1, help='Mininum chi-square probability for cluster fit') parser.add_argument('-p', '--plot', action='store_true', default=False, help='Plot distribution and fit') args = parser.parse_args() catalog = fits.open(args.fe55_catalog) gains = {} for amp in imutils.allAmps:
#!/usr/bin/env python """ @brief Dark pixels task: Find pixels and columns in a median image constructed from an ensemble of superflats. The dark pixel threshold is specified via the --thresh option and is in units of fraction of the segment mean. The threshold for the number of dark pixels that define a dark column is specified via the --colthresh option. @author J. Chiang <*****@*****.**> """ import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Find dark pixels and columns') parser.add_argument('-f', '--sflat_files', type=str, help='file pattern for superflats') parser.add_argument('-F', '--sflat_file_list', type=str, help='file containing list of superflat files') parser.add_argument( '-t', '--thresh', default=0.8, type=float, help='fractional dark pixel threshold in units of median pixel value') parser.add_argument('-c', '--colthresh', default=20, type=int,
#!/usr/bin/env python """ @brief Compute read noise distributions for a sample of images. Bias and system readout noise exposures, the latter for determining the noise contribution from the electronics, must be provided. @author J. Chiang <*****@*****.**> """ import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Compute Read Noise') parser.add_argument('-n', '--noise', type=str, help='system noise file pattern', default=None) parser.add_argument('-N', '--noise_file_list', type=str, help='list of system noise files', default=None) parser.add_argument('-x', '--dx', default=100, type=int, help='subregion size in pixels along x-direction') parser.add_argument('-y', '--dy', default=100, type=int, help='subregion size in pixels along y-direction') parser.add_argument('-S', '--nsamp', default=1000, type=int, help='number of subregions to sample') parser.add_argument('--use_overscan', default=False, action='store_true', help='Use serial overscan region for noise estimates.') args = parser.parse_args() task = sensorTest.ReadNoiseTask() task.config.dx = args.dx task.config.dy = args.dy task.config.nsamp = args.nsamp task.config.output_dir = args.output_dir task.config.eotest_results_file = args.results_file
#!/usr/bin/env python """ @brief Compute detector response vs incident flux for pairs of flats from which linearity and full-well are computed. @author J. Chiang <*****@*****.**> """ import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Compute detector response vs incident flux') parser.add_argument('-f', '--flats', type=str, help='flat pairs file pattern') parser.add_argument('-F', '--flats_file_list', type=str, help='list of flat pair files') parser.add_argument('-D', '--detector_response_file', type=str, help='file containing detector response vs incident flux', default=None) args = parser.parse_args() task = sensorTest.FlatPairTask() task.config.output_dir = args.output_dir task.config.verbose = args.verbose flat_files = args.files(args.flats, args.flats_file_list) bias_frame = args.bias_frame('%s_flat_bias_frame.fits' % args.sensor_id) task.run(args.sensor_id, flat_files,
#!/usr/bin/env python """ @brief Task to produce crosstalk matrix from a set of spot image files. @author J. Chiang <*****@*****.**> """ import os import pylab import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Compute crosstalk from a set of spot images') parser.add_argument('-f', '--xtalk_files', type=str, help='file pattern for crosstalk files') parser.add_argument('-F', '--xtalk_file_list', type=str, help='list of crosstalk files') args = parser.parse_args() task = sensorTest.CrosstalkTask() task.config.output_dir = args.output_dir task.config.verbose = args.verbose xtalk_files = args.files(args.xtalk_files, args.xtalk_file_list) task.run(args.sensor_id, xtalk_files, args.mask_files(xtalk_files[0]))
#!/usr/bin/env python """ @brief Pixel response non-uniformity. @author J. Chiang <*****@*****.**> """ import os import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Compute pixel response non-uniformity') parser.add_argument('-f', '--file_pattern', type=str, help='file pattern for PRNU input files') parser.add_argument('-F', '--prnu_file_list', type=str, help='list of files to be used in PRNU calculations') parser.add_argument('-c', '--correction_image', type=str, help='correction image for illumination non-uniformity', default=None) args = parser.parse_args() task = sensorTest.PrnuTask() task.config.output_dir = args.output_dir task.config.verbose = args.verbose infiles = args.files(args.file_pattern, args.prnu_file_list) task.run(args.sensor_id, infiles, args.mask_files(infiles[0]), args.system_gains(), args.correction_image)
#!/usr/bin/env python """ @brief Task to find traps from pocket-pumped exposure. @author J. Chiang <*****@*****.**> """ import glob import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Find Charge Traps') parser.add_argument('-f', '--pocket_pumped_file', type=str, help='Pocket pumped file') parser.add_argument('-O', '--output_file', type=str, help='Output text file to contain trap locations and magnitudes') parser.add_argument('--cycles', type=int, default=100, help='Number of pocket pumping cycles') parser.add_argument('--threshold', type=int, default=200, help='Trap size threshold (electrons)') parser.add_argument('--C2_thresh', type=int, default=10, help='C2 correlator detection threshold for trap candidates') parser.add_argument('--C3_thresh', type=int, default=1, help='C3 detection threshold for trap candidates') args = parser.parse_args() task = sensorTest.TrapTask() task.config.output_dir = args.output_dir task.config.verbose = args.verbose task.config.C2_thresh = args.C2_thresh task.config.C3_thresh = args.C3_thresh pocket_pumped_file = glob.glob(args.pocket_pumped_file)[0]
#!/usr/bin/env python """ @brief Compute QE curves from the wavelength scan dataset. @author J. Chiang <*****@*****.**> """ import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Compute QE curves') parser.add_argument('-f', '--qe_files', type=str, help='wavelength scan file pattern') parser.add_argument('-F', '--qe_file_list', type=str, help='list of wavelength scan files') parser.add_argument('-p', '--pd_ratio_file', type=str, help='photodiode ratio file') parser.add_argument( '-M', '--medians_file', type=str, help='file of median pixel values from wavelength scan dataset', default=None) parser.add_argument('-c', '--correction_image', type=str, help='correction image for illumination non-uniformity',
#!/usr/bin/env python """ @brief Bright pixels task: Find pixels and columns in a median image constructed from an ensemble of darks. The bright pixel threshold is specified via the --ethresh option and is in units of -e per pixel per second. The threshold for the number of bright pixels that define a bright column is specified via the --colthresh option. @author J. Chiang <*****@*****.**> """ import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Find bright pixels and columns') parser.add_argument('-f', '--dark_files', type=str, help='file pattern for darks') parser.add_argument('-F', '--dark_file_list', type=str, help='file containing list of dark files') parser.add_argument('-e', '--ethresh', default=5, type=int, help='bright pixel threshold in e- per pixel per second') parser.add_argument('-c', '--colthresh', default=20, type=int, help='bright column threshold in # of bright pixels')
#!/usr/bin/env python """ @brief Compute charge transfer (in)efficiency. @author J. Chiang <*****@*****.**> """ import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser( 'Compute charge transfer efficiency in parallel and serial directions using extended pixel edge response technique' ) parser.add_argument('-f', '--superflat_pattern', type=str, help='superflat dataset file pattern') parser.add_argument('-F', '--superflat_file_list', type=str, help='list of superflat files') parser.add_argument('-n', '--overscans', type=int, default=2, help='number of overscan rows/columns to use') args = parser.parse_args() task = sensorTest.CteTask() task.config.overscans = args.overscans task.config.output_dir = args.output_dir task.config.verbose = args.verbose
#!/usr/bin/env python """ @brief Dark current task: compute 95th percentile dark current in units of e-/sec/pixel. @author J. Chiang <*****@*****.**> """ from __future__ import print_function import lsst.eotest.sensor as sensorTest parser = sensorTest.TaskParser('Compute 95th percentile dark current.') parser.add_argument('-f', '--dark_files', type=str, help='file pattern for darks') parser.add_argument('-F', '--dark_file_list', type=str, help='file contain list of dark files') args = parser.parse_args() task = sensorTest.DarkCurrentTask() task.config.output_dir = args.output_dir task.config.verbose = args.verbose dark_files = args.files(args.dark_files, args.dark_file_list) if args.verbose: print('processing files:') for item in dark_files: print(' ', item) bias_frame = args.bias_frame('%s_dark_bias_frame.fits' % args.sensor_id) task.run(args.sensor_id, dark_files, args.mask_files(dark_files[0]), args.system_gains(), bias_frame=bias_frame)