From 9b89c3c7627d2a843274103202961f816364c0fe Mon Sep 17 00:00:00 2001 From: James Chiang Date: Sun, 12 Jun 2022 16:18:15 -0700 Subject: [PATCH] use more appropriate local variable names to describe bias model used --- .../bias_frame_BOT/v0/bias_frame_jh_task.py | 22 ++++++++++--------- python/bot_eo_analyses.py | 5 ++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/harnessed_jobs/bias_frame_BOT/v0/bias_frame_jh_task.py b/harnessed_jobs/bias_frame_BOT/v0/bias_frame_jh_task.py index 913b34c..e211919 100755 --- a/harnessed_jobs/bias_frame_BOT/v0/bias_frame_jh_task.py +++ b/harnessed_jobs/bias_frame_BOT/v0/bias_frame_jh_task.py @@ -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') @@ -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__': diff --git a/python/bot_eo_analyses.py b/python/bot_eo_analyses.py index a194162..e27b379 100644 --- a/python/bot_eo_analyses.py +++ b/python/bot_eo_analyses.py @@ -37,7 +37,6 @@ __all__ = ['make_file_prefix', 'make_rolloff_mask', - 'make_bias_filename', 'append_acq_run', 'make_title', 'glob_pattern', @@ -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) @@ -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)