diff --git a/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py index 23f9e6ac53db5fdf43deaeebfc2f7680e21bed35..68a4dffe087b19f6cffcf71446f364a818e2ba59 100755 --- a/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py +++ b/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py @@ -177,16 +177,28 @@ class msss_imager_pipeline(control): self.logger.debug( "Wrote output sky-image mapfile: {0}".format(output_image_mapfile)) + # TODO: This is a backdoor option to manually add beamtables when these + # missing on the provided ms. There is NO use case for users of the + # pipeline + try: + add_beam_tables = number_of_major_cycles = self.parset.getbool( + "Imaging.addBeamTables") + except: + add_beam_tables = false + + # ****************************************************************** # (1) prepare phase: copy and collect the ms concat_ms_map_path, timeslice_map_path, raw_ms_per_image_map_path, \ processed_ms_dir = self._prepare_phase(input_mapfile, - target_mapfile) + target_mapfile, add_beam_tables) #We start with an empty source_list source_list = "" # path to local sky model (list of 'found' sources) number_of_major_cycles = self.parset.getInt( "Imaging.number_of_major_cycles") + + for idx_loop in range(number_of_major_cycles): # ***************************************************************** # (2) Create dbs and sky model @@ -457,7 +469,8 @@ class msss_imager_pipeline(control): return output_mapfile, max_baseline @xml_node - def _prepare_phase(self, input_ms_map_path, target_mapfile): + def _prepare_phase(self, input_ms_map_path, target_mapfile, + add_beam_tables): """ Copy ms to correct location, combine the ms in slices and combine the time slices into a large virtual measurement set @@ -493,7 +506,8 @@ class msss_imager_pipeline(control): slices_mapfile=time_slices_mapfile, raw_ms_per_image_mapfile=raw_ms_per_image_mapfile, working_directory=self.scratch_directory, - processed_ms_dir=processed_ms_dir) + processed_ms_dir=processed_ms_dir, + add_beam_tables=add_beam_tables) #validate that the prepare phase produced the correct data output_keys = outputs.keys() diff --git a/CEP/Pipeline/recipes/sip/master/imager_prepare.py b/CEP/Pipeline/recipes/sip/master/imager_prepare.py index 28dc7f68f0859aaa54f95641e2a08fd29964c16d..3c971760466e1b3b026a2082c011e3d2c95be497 100644 --- a/CEP/Pipeline/recipes/sip/master/imager_prepare.py +++ b/CEP/Pipeline/recipes/sip/master/imager_prepare.py @@ -103,6 +103,11 @@ class imager_prepare(BaseRecipe, RemoteCommandRecipeMixIn): 'processed_ms_dir': ingredient.StringField( '--processed-ms-dir', help="Path to directory for processed measurment sets" + ), + 'add_beam_tables': ingredient.BoolField( + '--add_beam_tables', + default=false, + help="Developer option, adds beamtables to ms" ) } @@ -182,7 +187,8 @@ class imager_prepare(BaseRecipe, RemoteCommandRecipeMixIn): self.inputs['asciistat_executable'], self.inputs['statplot_executable'], self.inputs['msselect_executable'], - self.inputs['rficonsole_executable']] + self.inputs['rficonsole_executable'], + self.inputs['add_beam_tables']] jobs.append(ComputeJob(item.host, node_command, arguments)) diff --git a/CEP/Pipeline/recipes/sip/nodes/imager_prepare.py b/CEP/Pipeline/recipes/sip/nodes/imager_prepare.py index 5c2d842711e7c444837b3789a00f61bbb9c5c86d..40aea1789643b1ec7600aa8f4df5f8607cdce408 100644 --- a/CEP/Pipeline/recipes/sip/nodes/imager_prepare.py +++ b/CEP/Pipeline/recipes/sip/nodes/imager_prepare.py @@ -44,7 +44,7 @@ class imager_prepare(LOFARnodeTCP): ndppp_executable, output_measurement_set, time_slices_per_image, subbands_per_group, raw_ms_mapfile, asciistat_executable, statplot_executable, msselect_executable, - rficonsole_executable): + rficonsole_executable, add_beam_tables): """ Entry point for the node recipe """ @@ -110,7 +110,8 @@ class imager_prepare(LOFARnodeTCP): #***************************************************************** # Add measurmenttables - self.add_beam_tables(time_slices_path_list) + if add_beam_tables: + self.add_beam_tables(time_slices_path_list) #****************************************************************** # 6. Perform the (virtual) concatenation of the timeslices