diff --git a/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py index 6a9ca3014ba844ea428ef28c66c968fa474065d4..be1327c0fedd2d47b0104381fedd3650b406788c 100755 --- a/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py +++ b/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py @@ -208,19 +208,27 @@ class msss_calibrator_pipeline(control): suffix='.dppp.parmdb')['mapfile'] # Create a sourcedb to be used by the demixing phase of DPPP - # The path to the A-team sky model is currently hard-coded. - # Run makesourcedb on skymodel files for calibrator source(s) and the - # Ateam, which are to be stored in a standard place ($LOFARROOT/share) + # The user-supplied sky model can either be a name, in which case the + # pipeline will search for a file <name>.skymodel in the default search + # path $LOFARROOT/share/pipeline/skymodels; or a full path. + # It is an error if the file does not exist. + skymodel = py_parset.getString('PreProcessing.SkyModel') + if not os.path.isabs(skymodel): + skymodel = os.path.join( + # This should really become os.environ['LOFARROOT'] + self.config.get('DEFAULT', 'lofarroot'), + 'share', 'pipeline', 'skymodels', skymodel + '.skymodel' + ) + if not os.path.isfile(skymodel): + raise PipelineException("Skymodel %s does not exist" % skymodel) with duration(self, "setupsourcedb"): sourcedb_mapfile = self.run_task( "setupsourcedb", data_mapfile, - skymodel=os.path.join( - self.config.get('DEFAULT', 'lofarroot'), - 'share', 'pipeline', 'skymodels', 'Ateam_LBA_CC.skymodel'), - # TODO: LBA skymodel!! mapfile=os.path.join(mapfile_dir, 'dppp.sourcedb.mapfile'), + skymodel=skymodel, suffix='.dppp.sourcedb', - type='blob')['mapfile'] + type='blob' + )['mapfile'] # ********************************************************************* # 3. Run NDPPP to demix the A-Team sources diff --git a/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py index a3c8b49da1e9810d63fda8d97127dc92f4b3a4d2..50773647167c0843450d8f25d53ae20ae5fe31d6 100755 --- a/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py +++ b/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py @@ -313,14 +313,25 @@ class msss_target_pipeline(control): parmdb_mapfile = self.run_task("setupparmdb", data_mapfile)['mapfile'] # Create a sourcedb to be used by the demixing phase of DPPP - # The path to the A-team sky model is currently hard-coded. + # The user-supplied sky model can either be a name, in which case the + # pipeline will search for a file <name>.skymodel in the default search + # path $LOFARROOT/share/pipeline/skymodels; or a full path. + # It is an error if the file does not exist. + skymodel = py_parset.getString('PreProcessing.SkyModel') + if not os.path.isabs(skymodel): + skymodel = os.path.join( + # This should really become os.environ['LOFARROOT'] + self.config.get('DEFAULT', 'lofarroot'), + 'share', 'pipeline', 'skymodels', skymodel + '.skymodel' + ) + if not os.path.isfile(skymodel): + raise PipelineException("Skymodel %s does not exist" % skymodel) with duration(self, "setupsourcedb"): sourcedb_mapfile = self.run_task( "setupsourcedb", data_mapfile, - skymodel=os.path.join( - self.config.get('DEFAULT', 'lofarroot'), - 'share', 'pipeline', 'skymodels', 'Ateam_LBA_CC.skymodel' - ) + skymodel=skymodel, + suffix='.dppp.sourcedb', + type='blob' )['mapfile'] # *********************************************************************