Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLA-1111: Updated SVM filenames for WFPC2 #1678

2 changes: 1 addition & 1 deletion drizzlepac/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def perform_align(
hdr0 = fits.getheader(imglist[0])
inst = hdr0.get("instrume")
if inst.lower() == "wfpc2" and "detector" not in hdr0:
det = "wfpc2"
det = "pc"
else:
det = hdr0.get("detector")
apars = get_default_pars(inst, det)
Expand Down
4 changes: 2 additions & 2 deletions drizzlepac/hapsequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"SVM_CATALOG_WFC": 'on',
"SVM_CATALOG_UVIS": 'on',
"SVM_CATALOG_IR": 'on',
"SVM_CATALOG_WFPC2": 'on'}
"SVM_CATALOG_PC": 'on'}
envvar_cat_str = "SVM_CATALOG_{}"

# --------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -122,7 +122,7 @@ def create_catalog_products(total_obj_list, log_level, diagnostic_mode=False, ph
Specify which, if any, catalogs should be generated at all, based on detector. This dictionary
needs to contain values for all instruments; namely:

SVM_CATALOG_HRC, SVM_CATALOG_SBC, SVM_CATALOG_WFC, SVM_CATALOG_UVIS, SVM_CATALOG_IR, SVM_CATALOG_WFPC2
SVM_CATALOG_HRC, SVM_CATALOG_SBC, SVM_CATALOG_WFC, SVM_CATALOG_UVIS, SVM_CATALOG_IR, SVM_CATALOG_PC

These variables can be defined with values of 'on'/'off'/'yes'/'no'/'true'/'false'.

Expand Down
2 changes: 1 addition & 1 deletion drizzlepac/haputils/align_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __init__(self, input_list, clobber=False, dqname='DQ', process_type='',
hdr0 = fits.getheader(img)
instrume = hdr0.get('instrume')
if instrume.lower() == 'wfpc2' and 'detector' not in hdr0:
detector = 'WFPC2'
detector = 'PC'
else:
detector = hdr0.get('detector')

Expand Down
10 changes: 5 additions & 5 deletions drizzlepac/haputils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ def _determine_conditions(self, prod_obj):
elif self.instrument == "wfpc2":
if self.hap_pipeline_name == 'mvm':
if n_exp > 1:
self.conditions.append("wfpc2_wfpc2_any_n2")
self.conditions.append("wfpc2_pc_any_n2")
if self.hap_pipeline_name == 'svm':
if n_exp == 2:
self.conditions.append("wfpc2_wfpc2_any_n2")
self.conditions.append("wfpc2_pc_any_n2")
if n_exp == 3:
self.conditions.append("wfpc2_wfpc2_any_n3")
self.conditions.append("wfpc2_pc_any_n3")
if n_exp >= 4:
self.conditions.append("wfpc2_wfpc2_any_n4")
self.conditions.append("wfpc2_pc_any_n4")
else:
log.error("{} is an invalid HST instrument!".format(self.instrument))
sys.exit(1)
Expand Down Expand Up @@ -672,7 +672,7 @@ def read_index(instrument, detector, hap_pipeline_name='svm'):
def get_wfpc2_pars(infiles):

pars = {}
full_cfg_index, pars_dir = read_index('wfpc2', 'wfpc2', hap_pipeline_name='svm')
full_cfg_index, pars_dir = read_index('wfpc2', 'pc', hap_pipeline_name='svm')

hap_pipeline_name = 'svm'
conditions = ["single_basic"]
Expand Down
2 changes: 1 addition & 1 deletion drizzlepac/haputils/poller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def parse_mvm_tree(det_tree, all_mvm_exposures, log_level):
# mvm prod_info = 'skycell_p1234_x01y01 wfc3 uvis f200lp all 2009 1 drz'
#
prod_list = prod_info.split(" ")
multi_scale = prod_list[2].upper() in ['IR']
multi_scale = prod_list[2].upper() in ['IR', 'PC']
pscale = 'fine' if not multi_scale else 'coarse'
prod_info += " {:s}".format(pscale)

Expand Down
5 changes: 4 additions & 1 deletion drizzlepac/haputils/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@ def __init__(
log.setLevel(log_level)
self.log_level = log_level

# Special logic to specify the WFPC2 detector name always to PC (as opposed to WFPC2) for filenaming.
if instrument =='wfpc2':
detector = 'pc'

# Make sure the proposal ID is a 5-character string
self.prop_id = prop_id.zfill(5)
self.obset_id = obset_id
self.instrument = instrument
self.detector = detector
self.filetype = filetype
self.rules_file = None

self.basename = (
"hst_" + "_".join(map(str, [prop_id, obset_id, instrument, detector])) + "_"
)
Expand Down
19 changes: 19 additions & 0 deletions drizzlepac/pars/hap_pars/mvm_parameters/wfpc2_pc_index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
s-goldman marked this conversation as resolved.
Show resolved Hide resolved
"alignment": {
"all": "wfpc2/wfpc2/wfpc2_pc_alignment_all.json"
},
"astrodrizzle": {
"any_n1": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n1.json",
"filter_basic": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_total.json",
"single_basic": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n1.json",
"wfpc2_pc_any_n2": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n2.json",
"wfpc2_pc_any_n4": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n4.json",
"wfpc2_pc_any_total": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_total.json"
},
"catalog generation": {
"all": "wfpc2/wfpc2/wfpc2_pc_catalog_generation_all.json"
},
"quality control": {
"all": "wfpc2/wfpc2/wfpc2_pc_quality_control_all.json"
}
}
19 changes: 0 additions & 19 deletions drizzlepac/pars/hap_pars/mvm_parameters/wfpc2_wfpc2_index.json

This file was deleted.

20 changes: 20 additions & 0 deletions drizzlepac/pars/hap_pars/svm_parameters/wfpc2_pc_index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
s-goldman marked this conversation as resolved.
Show resolved Hide resolved
"alignment": {
"all": "wfpc2/wfpc2/wfpc2_pc_alignment_all.json"
},
"astrodrizzle": {
"any_n1": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n1.json",
"filter_basic": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_total.json",
"single_basic": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n1.json",
"total_basic": "wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_total.json",
"wfpc2_pc_any_n2":"wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n2.json",
"wfpc2_pc_any_n3":"wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n3.json",
"wfpc2_pc_any_n4":"wfpc2/wfpc2/wfpc2_pc_astrodrizzle_any_n4.json"
},
"catalog generation": {
"all": "wfpc2/wfpc2/wfpc2_pc_catalog_generation_all.json"
},
"quality control": {
"all": "wfpc2/wfpc2/wfpc2_pc_quality_control_all.json"
}
}
20 changes: 0 additions & 20 deletions drizzlepac/pars/hap_pars/svm_parameters/wfpc2_wfpc2_index.json

This file was deleted.

2 changes: 1 addition & 1 deletion drizzlepac/runastrodriz.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"ACS/WFC": {'sigma': 1.5, 'good_bits': 1360},
"ACS/SBC": {'sigma': 2.0, 'good_bits': 0},
"ACS/HRC": {'sigma': 1.5, 'good_bits': 1360},
"WFPC2/WFPC2": {'sigma': 1.5, 'good_bits': 1360}}
"WFPC2/PC": {'sigma': 1.5, 'good_bits': 1360}}

sub_dirs = ['OrIg_files', 'pipeline-default']
valid_alignment_modes = ['apriori', 'aposteriori', 'default-pipeline']
Expand Down
2 changes: 1 addition & 1 deletion drizzlepac/wfpc2Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def wfpc2_to_flt(imgname):

# Add keywords to be more compatible with ACS and WFC3 data
num_sci = fileutil.countExtn(imgname)
det_name = 'WFPC2'
det_name = 'PC'
in_sci[0].header['DETECTOR'] = det_name
in_sci[0].header['PRIMESI'] = det_name

Expand Down