Skip to content

Commit

Permalink
Merge pull request #100 from lsst-camera-dh/LSSTTD-1553_use_PCA_bias_…
Browse files Browse the repository at this point in the history
…correction_in_persistence_test

Lssttd 1553 use pca bias correction in persistence test
  • Loading branch information
jchiang87 authored Feb 4, 2021
2 parents 4934ade + 13c2b5c commit 44dbdcb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
16 changes: 11 additions & 5 deletions harnessed_jobs/persistence_BOT/v0/persistence_jh_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"""
def persistence_jh_task(det_name):
"""JH version of the persistence_task."""
import os
import siteUtils
from bot_eo_analyses import make_file_prefix, glob_pattern, \
bias_frame_task, get_mask_files, get_bot_eo_config, persistence_task
bias_frame_task, get_mask_files, get_bot_eo_config, persistence_task, \
bias_filename

run = siteUtils.getRunNumber()
file_prefix = make_file_prefix(run, det_name)
Expand All @@ -29,10 +31,14 @@ def persistence_jh_task(det_name):
bias_files = sorted(bias_files)
dark_files = sorted(dark_files)

# Make a superbias frame using the pre-exposure persistence bias
# files, skipping the first exposure.
superbias_frame = f'{file_prefix}_persistence_superbias.fits'
bias_frame_task(run, det_name, bias_files, bias_frame=superbias_frame)
use_pca_bias = os.environ.get('LCATR_USE_PCA_BIAS_FIT', "True") == 'True'
if use_pca_bias:
superbias_frame = bias_filename(run, det_name)
else:
# Make a superbias frame using the pre-exposure persistence bias
# files, skipping the first exposure.
superbias_frame = f'{file_prefix}_persistence_superbias.fits'
bias_frame_task(run, det_name, bias_files, bias_frame=superbias_frame)

return persistence_task(run, det_name, dark_files, superbias_frame,
get_mask_files(det_name))
Expand Down
6 changes: 4 additions & 2 deletions python/bot_eo_analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,12 @@ def bias_filename(run, det_name):
if use_pca_bias:
pca_bias_model \
= hj_fp_server.get_files('bias_frame_BOT',
f'*{det_name}*_pca_bias.pickle')[0]
f'*{det_name}*_pca_bias.pickle',
run=bias_run)[0]
pca_bias_file \
= hj_fp_server.get_files('bias_frame_BOT',
f'*{det_name}*_pca_bias.fits')[0]
f'*{det_name}*_pca_bias.fits',
run=bias_run)[0]
pca_bias_model = siteUtils.get_scratch_files([pca_bias_model])[0]
pca_bias_file = siteUtils.get_scratch_files([pca_bias_file])[0]
filename = pca_bias_model, pca_bias_file
Expand Down

0 comments on commit 44dbdcb

Please sign in to comment.