Skip to content

Commit

Permalink
use more appropriate local variable names to describe bias model used
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiang87 committed Jun 12, 2022
1 parent f29c11e commit 9b89c3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
22 changes: 12 additions & 10 deletions harnessed_jobs/bias_frame_BOT/v0/bias_frame_jh_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def bias_frame_jh_task(det_name):
import siteUtils
import json
from bot_eo_analyses import glob_pattern, bias_frame_task, \
make_bias_filename, bias_stability_task, pca_corrected_superbias
bias_stability_task, pca_corrected_superbias

run = siteUtils.getRunNumber()
acq_jobname = siteUtils.getProcessName('BOT_acq')
Expand All @@ -33,22 +33,24 @@ def bias_frame_jh_task(det_name):
det_name)
return None

bias_frame, pca_files = bias_frame_task(run, det_name, bias_files)
superbias_file, bias_model_components \
= bias_frame_task(run, det_name, bias_files)
bias_stability_files = sorted(bias_stability_files)

if not os.environ.get('LCATR_USE_PCA_BIAS_FIT', "True") == 'True':
pca_files = None
bias_model_components = None
if siteUtils.get_analysis_run('bias') == 'rowcol':
bias_frame = make_bias_filename(run, det_name)
pca_files = 'rowcol', bias_frame
print("pca_files:", pca_files)
bias_model_components = 'rowcol', superbias_file
print("bias_model_components:", bias_model_components)
bias_stability_task(run, det_name, bias_stability_files,
pca_files=pca_files)
bias_model_components=bias_model_components)

if pca_files is not None and pca_files[0] != 'rowcol':
pca_corrected_superbias(run, det_name, bias_files, pca_files)
if (bias_model_components is not None and
bias_model_components[0] != 'rowcol'):
pca_corrected_superbias(run, det_name, bias_files,
bias_model_components)

return bias_frame
return superbias_file


if __name__ == '__main__':
Expand Down
5 changes: 2 additions & 3 deletions python/bot_eo_analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

__all__ = ['make_file_prefix',
'make_rolloff_mask',
'make_bias_filename',
'append_acq_run',
'make_title',
'glob_pattern',
Expand Down Expand Up @@ -696,7 +695,7 @@ def image_stats(image, nsigma=10):


def bias_stability_task(run, det_name, bias_files, nsigma=10,
pca_files=None, llc_size=200):
bias_model_components=None, llc_size=200):
"""Compute amp-wise bias stability time histories and serial profiles."""
raft, slot = det_name.split('_')
file_prefix = make_file_prefix(run, det_name)
Expand All @@ -714,7 +713,7 @@ def bias_stability_task(run, det_name, bias_files, nsigma=10,
key = f'TEMP{i}'
if key in hdus['REB_COND'].header:
temps[key] = hdus['REB_COND'].header[key]
ccd = sensorTest.MaskedCCD(bias_file, bias_frame=pca_files)
ccd = sensorTest.MaskedCCD(bias_file, bias_frame=bias_model_components)
for amp in ccd:
# Retrieve the per row overscan subtracted imaging section.
amp_image = ccd.unbiased_and_trimmed_image(amp)
Expand Down

0 comments on commit 9b89c3c

Please sign in to comment.