Skip to content

Commit

Permalink
Merge pull request #21 from lsst-camera-dh/u/jchiang/add_bf_task
Browse files Browse the repository at this point in the history
add bf task
  • Loading branch information
jchiang87 authored Feb 18, 2019
2 parents 8d3ac70 + 39c3813 commit 0d09742
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
2 changes: 2 additions & 0 deletions data/BOT_jh_glob_patterns.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[BOT_acq]
fe55 = fe55_fe55_*
fe55_bias = fe55_bias_*
bias_frame = bias_bias_*
read_noise = bias_bias_*
raft_noise_correlations = bias_bias_*
bright_defects = dark_dark_*
Expand All @@ -11,5 +12,6 @@ cte_high = sflat_*_flat_*H*
cte_low = sflat_*_flat_*L*
flat_pairs = flat_*_flat?
ptc = flat_*_flat?
brighter_fatter = flat_*_flat?
qe = lambda_flat_*
tearing = sflat_flat_*[LH]*
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from bot_eo_analyses import fe55_jh_task, bias_frame_jh_task, \
read_noise_jh_task, \
dark_current_jh_task, bright_defects_jh_task, dark_defects_jh_task, \
ptc_jh_task, flat_pairs_jh_task, cte_jh_task, tearing_jh_task, \
ptc_jh_task, flat_pairs_jh_task, bf_jh_task, \
cte_jh_task, tearing_jh_task, \
get_analysis_types, raft_jh_noise_correlations, raft_results_task

# Use the all of the available cores for processing.
Expand All @@ -20,6 +21,7 @@
'dark': (dark_current_jh_task,),
'badpixel': (bright_defects_jh_task, dark_defects_jh_task),
'ptc': (ptc_jh_task,),
'brighterfatter': (bf_jh_task,),
'linearity': (flat_pairs_jh_task,),
'cti': (cte_jh_task,),
'tearing': (tearing_jh_task,)}
Expand Down
39 changes: 39 additions & 0 deletions python/bot_eo_analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
'find_flat2_bot',
'flat_pairs_task', 'flat_pairs_jh_task',
'ptc_task', 'ptc_jh_task',
'bf_task', 'bf_jh_task',
'qe_task', 'qe_jh_task',
'tearing_task', 'tearing_jh_task',
'raft_results_task',
Expand Down Expand Up @@ -595,6 +596,44 @@ def ptc_task(run, det_name, flat_files, gains, mask_files=(),
'%s_ptcs.png' % file_prefix,
ptc_file='%s_ptc.fits' % file_prefix)


def bf_jh_task(det_name):
"""JH version of single sensor execution of the brighter-fatter task."""
run = siteUtils.getRunNumber()
file_prefix = make_file_prefix(run, det_name)

flat_files \
= siteUtils.dependency_glob(glob_pattern('brighter_fatter', det_name))

if not flat_files:
print("bf_jh_task: Flat pairs files not found for detector", det_name)
return None

flat_files = [_ for _ in flat_files if 'flat1' in _]

mask_files = sorted(glob.glob('{}_*mask.fits'.format(file_prefix)))
eotest_results_file = '{}_eotest_results.fits'.format(file_prefix)
bias_frame = bias_filename(file_prefix)

return bf_task(run, det_name, flat_files, mask_files=mask_files,
flat2_finder=find_flat2_bot, bias_frame=bias_frame)


def bf_task(run, det_name, flat_files, mask_files=(),
flat2_finder=None, bias_frame=None):
"""Single sensor execution of the brighter-fatter task."""
file_prefix = make_file_prefix(run, det_name)

task = sensorTest.BFTask()
task.run(file_prefix, flat_files, mask_files=mask_files,
flat2_finder=flat2_finder, bias_frame=bias_frame)

results_file = '%s_eotest_results.fits' % file_prefix
plots = sensorTest.EOTestPlots(file_prefix, results_file=results_file)
siteUtils.make_png_file(plots.bf_curves,
'%s_brighter-fatter.png' % file_prefix,
bf_file='%s_bf.fits' % file_prefix)

def qe_jh_task(det_name):
"""JH version of single sensor execution of the QE task."""
run = siteUtils.getRunNumber()
Expand Down

0 comments on commit 0d09742

Please sign in to comment.