From 888d533b45ccdb2a24cdd891730e5572f7a0717f Mon Sep 17 00:00:00 2001 From: Wouter Klijn <klijn@astron.nl> Date: Thu, 8 Aug 2013 14:20:52 +0000 Subject: [PATCH] Task #4518: Add parset option to add beamtables --- .../recipes/sip/bin/msss_imager_pipeline.py | 20 ++++++++++++++++--- .../recipes/sip/master/imager_prepare.py | 8 +++++++- .../recipes/sip/nodes/imager_prepare.py | 5 +++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_imager_pipeline.py index 23f9e6ac53d..68a4dffe087 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 28dc7f68f08..3c971760466 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 5c2d842711e..40aea178964 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 -- GitLab