def dms_product_name(self): """Define product name. Returns ------- product_name: str The product name """ instrument = self._get_instrument() opt_elem = self._get_opt_element() subarray = self._get_subarray() if len(subarray): subarray = '-' + subarray product_name_format = ('jw{program}-{acid}' '_{source_id}' '_{instrument}' '_{opt_elem}{subarray}') product_name = format_product( product_name_format, program=self.data['program'], acid=self.acid.id, instrument=instrument, opt_elem=opt_elem, subarray=subarray, ) return product_name.lower()
def dms_product_name(self): """Define product name Modification is to append the `expspcin` value after the calibration suffix. """ product_name_format = '{existing}-{detector}_{suffix}-{expspcin}' existing = super().dms_product_name product_name = format_product( product_name_format, existing=existing, detector=self.constraints['detector'].value, expspcin=self.constraints['act_id'].value) return product_name.lower()
def dms_product_name(self): """Define product name Modification is to append the `expspcin` value after the calibration suffix. """ product_name_format = '{existing}-{detector}_{suffix}-{expspcin}' existing = super().dms_product_name product_name = format_product( product_name_format, existing=existing, detector=self.constraints['detector'].value, expspcin=self.constraints['act_id'].value ) return product_name.lower()
def test_asn_naming(self): """Test a full run""" # Get the data collect_pipeline_cfgs('cfgs') asn_path = self.get_data( self.test_dir, 'wfs_3sets_asn.json' ) with open(asn_path) as fh: asn = load_asn(fh) for product in asn['products']: for member in product['members']: self.get_data( self.test_dir, member['expname'] ) input_files = glob('*') # Run the step. args = [ op.join('cfgs', 'calwebb_wfs-image3.cfg'), asn_path ] Step.from_cmdline(args) # Test. output_files = glob('*') for input_file in input_files: output_files.remove(input_file) print('output_files = {}'.format(output_files)) for product in asn['products']: prod_name = product['name'] prod_name = format_product(prod_name, suffix='wfscmb') prod_name += '.fits' assert prod_name in output_files output_files.remove(prod_name) # There should be no more files assert len(output_files) == 0