From cc504bd2a1d002b3ac3a32a23c5753e44f71494e Mon Sep 17 00:00:00 2001
From: Nicolas Vilchez <nicolas.vilchez@cnrs-orleans.fr>
Date: Mon, 24 Nov 2014 11:31:06 +0000
Subject: [PATCH] Task #5678 debug mask option

---
 CEP/Calibration/pyselfcal/src/selfcal.py | 40 ++++++++++++------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/CEP/Calibration/pyselfcal/src/selfcal.py b/CEP/Calibration/pyselfcal/src/selfcal.py
index 29127bfd896..3ce5af0c80a 100755
--- a/CEP/Calibration/pyselfcal/src/selfcal.py
+++ b/CEP/Calibration/pyselfcal/src/selfcal.py
@@ -72,12 +72,12 @@ def main(initparameterlist):
 
 	try:
 
-	      opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "obsDir=", "outputDir=", "skyModel=", "nbCycle=", "outerfovclean=", "VLSSuse=", "annulusRadius=", "startResolution=", "endResolution=", "resolutionVector=", "mask=", "UVmin=", "startingFactor=", "FOV=", "nofPixelPerBeam=", "robust=", "maskDilatation="])
+	      opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "obsDir=", "outputDir=", "skyModel=", "nbCycle=", "outerfovclean=", "VLSSuse=", "annulusRadius=", "startResolution=", "endResolution=", "resolutionVector=", "mask=", "UVmin=", "startingFactor=", "FOV=", "nofPixelPerBeam=", "robust=", "MaskDilatation="])
 
       
 	except getopt.GetoptError as err:
 	      print ""		
-	      print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --maskDilatation=]"
+	      print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --MaskDilatation=]"
 	      print ""
 	      print "For more details: type selfcal.py -h"
 	      print ""
@@ -97,7 +97,7 @@ def main(initparameterlist):
 						print ""
 						print "Usage: selfcal.py PATH/parsetFile"
 						print 'OR'
-						print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --maskDilatation=]\n"
+						print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --MaskDilatation=]\n"
 						
 						print """
 ******************************************************************************
@@ -141,7 +141,7 @@ If the user does not want to use VLSSS Skymodel (VLSSuse=no), the code will crea
 
 *  --mask(string,default:yes): yes or no =>  Use clean masks when imaging.
 
-*  --maskDilatation(integer,default:0): If mask is used (generated from pybdsm extracted skyModel), it is possible to dilate it. 0 => no dilatation, 1 => extend the no dilated mask by 1 pixel in all directions, etc ...
+*  --MaskDilatation(integer,default:0): If mask is used (generated from pybdsm extracted skyModel), it is possible to dilate it. 0 => no dilatation, 1 => extend the no dilated mask by 1 pixel in all directions, etc ...
 For more details see pybdsm export_image documentation.
 
 *  --UVmin(float, default:0 or 0.1 in klambda): Set UVmin for each imaging run. If unset, UVmin=0.1 for observations with declinations below 35 degrees, otherwise UVmin=0. It is recommended to set UVmin=0 if the user is interested in imaging extended or diffuse emission.
@@ -214,7 +214,7 @@ nofPixelPerBeam  =  3
 					initparameterlist[14]=strcompress(par2)			
 				elif par1 in ("--robust"):
 					initparameterlist[15]=strcompress(par2)		
-				elif par1 in ("--maskDilatation"):
+				elif par1 in ("--MaskDilatation"):
 					initparameterlist[16]=strcompress(par2)				
 																																																	
 				else:
@@ -230,7 +230,7 @@ nofPixelPerBeam  =  3
 				print ""
 				print "Usage: selfcal.py PATH/parsetFile"
 				print 'OR'
-				print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --maskDilatation=]\n"
+				print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --MaskDilatation=]\n"
 				print ""
 				sys.exit(2)       	
  
@@ -281,7 +281,7 @@ nofPixelPerBeam  =  3
 								print ""
 								print "Usage: selfcal.py PATH/parsetFile"
 								print 'OR'
-								print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --maskDilatation=]\n"							
+								print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --MaskDilatation=]\n"							
 								
 								print """
 ******************************************************************************
@@ -325,7 +325,7 @@ If the user does not want to use VLSSS Skymodel (VLSSuse=no), the code will crea
 
 *  mask(string,default:yes): yes or no =>  Use clean masks when imaging.
 
-*  maskDilatation(integer,default:0): If mask is used (generated from pybdsm extracted skyModel), it is possible to dilate it. 0 => no dilatation, 1 => extend the no dilated mask by 1 pixel in all directions, etc ...
+*  MaskDilatation(integer,default:0): If mask is used (generated from pybdsm extracted skyModel), it is possible to dilate it. 0 => no dilatation, 1 => extend the no dilated mask by 1 pixel in all directions, etc ...
 For more details see pybdsm export_image documentation.
 
 *  UVmin(float, default:0 or 0.1 in klambda): Set UVmin for each imaging run. If unset, UVmin=0.1 for observations with declinations below 35 degrees, otherwise UVmin=0. It is recommended to set UVmin=0 if the user is interested in imaging extended or diffuse emission.
@@ -398,7 +398,7 @@ nofPixelPerBeam  =  3
 							initparameterlist[14]=strcompress(par2)			
 						elif strcompress(par1)	 in ("robust"):
 							initparameterlist[15]=strcompress(par2)		
-						elif strcompress(par1)	 in ("maskDilatation"):
+						elif strcompress(par1)	 in ("MaskDilatation"):
 							initparameterlist[16]=strcompress(par2)				
 																																																			
 						else:
@@ -414,7 +414,7 @@ nofPixelPerBeam  =  3
 					print ""
 					print "Usage: selfcal.py PATH/parsetFile"
 					print 'OR'
-					print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --maskDilatation=]\n"				
+					print "Usage: selfcal.py --obsDir= --outputDir= [Options: --skyModel= --nbCycle= --outerfovclean= --VLSSuse= --annulusRadius= --startResolution= --endResolution= --resolutionVector= --mask= --UVmin= --startingFactor= --FOV= --nofPixelPerBeam= --robust= --MaskDilatation=]\n"				
 					print ""
 					sys.exit(2)       	
 						
@@ -499,7 +499,7 @@ if __name__=='__main__':
     skyModel		= initparameterlist[13]
     nofPixelPerBeam	= initparameterlist[14]
     robust			= initparameterlist[15]
-    maskDilatation	= initparameterlist[16]
+    MaskDilatation	= initparameterlist[16]
 
 
     
@@ -663,8 +663,8 @@ if __name__=='__main__':
 
     if mask == 'none':
 		mask='yes'
-		if maskDilatation == 'none':
-			maskDilatation = 0
+		if MaskDilatation == 'none':
+			MaskDilatation = 0
 		
     if startingFactor == 'none':
 		startingFactor=15.0
@@ -710,9 +710,9 @@ if __name__=='__main__':
  		print ""
 		sys.exit(2)
 		
-    if  maskDilatation < 0: 
+    if  MaskDilatation < 0: 
 		print ''
-		print 'maskDilatation parameter must be equal or greater to 0 !' 
+		print 'MaskDilatation parameter must be equal or greater to 0 !' 
  		print ""
 		sys.exit(2)
 	
@@ -768,10 +768,10 @@ if __name__=='__main__':
 	      sys.exit(2)
 
     try:
-	      maskDilatation = int(maskDilatation)     
+	      MaskDilatation = int(MaskDilatation)     
     except:
 	      print ""
-	      print "maskDilatation parameter must be an integer or not provided !"
+	      print "MaskDilatation parameter must be an integer or not provided !"
 	      print ""
 	      sys.exit(2)
 
@@ -965,7 +965,7 @@ if __name__=='__main__':
     print ''
     print 'robust = %s'%(robust)
     print ''
-    print 'maskDilatation = %s'%(maskDilatation)    
+    print 'MaskDilatation = %s'%(MaskDilatation)    
     print ''        
     print '############################################################'
 
@@ -1183,7 +1183,7 @@ if __name__=='__main__':
 			 
 			
 			# Selfcal Initialization
-			selfCalRun_Obj	= class_selfcalrun.selfCalRun(i,obsDir,outputDir,nbCycle,listFiles,Files,NbFiles,BBSParset,SkymodelPath,GSMSkymodel,ImagePathDir,UVmin,UVmax,wmax,pixsize,nbpixel,robust,nIteration,RMS_BOX,RMS_BOX_Bright,thresh_isl,thresh_pix,outerfovclean,VLSSuse,preprocessIndex,mask,maskDilatation)
+			selfCalRun_Obj	= class_selfcalrun.selfCalRun(i,obsDir,outputDir,nbCycle,listFiles,Files,NbFiles,BBSParset,SkymodelPath,GSMSkymodel,ImagePathDir,UVmin,UVmax,wmax,pixsize,nbpixel,robust,nIteration,RMS_BOX,RMS_BOX_Bright,thresh_isl,thresh_pix,outerfovclean,VLSSuse,preprocessIndex,mask,MaskDilatation)
 			
 			
 			# Run the BBS-cal on each Time chunks
@@ -1306,7 +1306,7 @@ if __name__=='__main__':
       
     # Iniatialization (Object creation)
     i=nbCycle	
-    selfCalRun_Obj	= class_selfcalrun.selfCalRun(i,obsDir,outputDir,nbCycle,listFiles,Files,NbFiles,BBSParset,SkymodelPath,GSMSkymodel,ImagePathDir,UVmin,UVmax,wmax,pixsize,nbpixel,robust,nIteration,RMS_BOX,RMS_BOX_Bright,thresh_isl,thresh_pix,outerfovclean,VLSSuse,preprocessIndex,mask,maskDilatation)
+    selfCalRun_Obj	= class_selfcalrun.selfCalRun(i,obsDir,outputDir,nbCycle,listFiles,Files,NbFiles,BBSParset,SkymodelPath,GSMSkymodel,ImagePathDir,UVmin,UVmax,wmax,pixsize,nbpixel,robust,nIteration,RMS_BOX,RMS_BOX_Bright,thresh_isl,thresh_pix,outerfovclean,VLSSuse,preprocessIndex,mask,MaskDilatation)
 	
     
     # Run the BBS-cal on each Time chunks
-- 
GitLab