Skip to content

Commit

Permalink
Merge pull request #17 from lsst-camera-dh/u/jchiang/add_find_flat2_bot
Browse files Browse the repository at this point in the history
add BOT-level function to find flat2 files from flat1 files for PTC and linearity jobs
  • Loading branch information
jchiang87 authored Jan 16, 2019
2 parents 8d16094 + 5eb7209 commit 276b3e3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions harnessed_jobs/BOT_EO_analysis/v0/producer_BOT_EO_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,14 @@ def cte_task(det_name):
output.write('{}\n'.format(item))


def find_flat2_bot(file1):
basename_pattern = '*_' + file1[-len('R22_S11.fits'):]
pattern = os.path.join(file1.split('flat1')[0] + 'flat2',
basename_pattern)
flat2 = glob.glob(pattern)[0]
return flat2


def flat_pairs_task(det_name):
"""Single sensor execution of the flat pairs task."""
run = siteUtils.getRunNumber()
Expand All @@ -350,7 +358,8 @@ def flat_pairs_task(det_name):

task = sensorTest.FlatPairTask()
task.run(file_prefix, flat_files, mask_files, gains,
linearity_spec_range=(1e4, 9e4), use_exptime=use_exptime)
linearity_spec_range=(1e4, 9e4), use_exptime=use_exptime,
flat2_finder=find_flat2_bot)

results_file = '%s_eotest_results.fits' % file_prefix
plots = sensorTest.EOTestPlots(file_prefix, results_file=results_file)
Expand Down Expand Up @@ -383,7 +392,8 @@ def ptc_task(det_name):
gains = get_amplifier_gains(eotest_results_file)

task = sensorTest.PtcTask()
task.run(file_prefix, flat_files, mask_files, gains)
task.run(file_prefix, flat_files, mask_files, gains,
flat2_finder=find_flat2_bot)

results_file = '%s_eotest_results.fits' % file_prefix
plots = sensorTest.EOTestPlots(file_prefix, results_file=results_file)
Expand Down

0 comments on commit 276b3e3

Please sign in to comment.