4747 pass
4848
4949
50- def calibrate (id , directory , return_fnames = False , logpath = None , outdir = None , shellscript = None ):
50+ def calibrate (id , directory , return_fnames = False ,
51+ logpath = None , outdir = None , shellscript = None ):
5152 """
5253 radiometric calibration of SAR scenes
5354
@@ -68,7 +69,7 @@ def calibrate(id, directory, return_fnames=False, logpath=None, outdir=None, she
6869
6970 Returns
7071 -------
71-
72+ List[str] or None
7273 """
7374 cname = type (id ).__name__
7475 new = []
@@ -112,7 +113,8 @@ def calibrate(id, directory, return_fnames=False, logpath=None, outdir=None, she
112113 elif cname == 'ESA' :
113114 k_db = {'ASAR' : 55. , 'ERS1' : 58.24 , 'ERS2' : 59.75 }[id .sensor ]
114115 inc_ref = 90. if id .sensor == 'ASAR' else 23.
115- candidates = [x for x in id .getGammaImages (directory ) if re .search ('_pri$' , x )]
116+ imgs = id .getGammaImages (directory )
117+ candidates = [x for x in imgs if re .search ('_pri$' , x )]
116118 for image in candidates :
117119 out = image .replace ('pri' , 'grd' )
118120 isp .radcal_PRI (PRI = image ,
@@ -131,7 +133,8 @@ def calibrate(id, directory, return_fnames=False, logpath=None, outdir=None, she
131133 log .info ('calibration already performed during import' )
132134
133135 else :
134- raise NotImplementedError ('calibration for class {} is not implemented yet' .format (cname ))
136+ msg = f'calibration for class { cname } is not implemented yet'
137+ raise NotImplementedError (msg )
135138
136139 if return_fnames and len (new ) > 0 :
137140 return new
0 commit comments