Error messages (#105)

* move `val` definition to avoid undefined

Currently, with only one swath, or not enough points,
val doesnt get defined, so this error gets thrown:

File ".../isce/components/isceobj/TopsProc/runESD.py", line 115, in runESD
    if val.size == 0 :
UnboundLocalError: local variable 'val' referenced before assignment

the `np.array` is added so that the `val.size` check makes sense,
as opposed to doing `.size` on a list

* fix string formats in error messages
LT1AB
Scott Staniewicz 2020-03-27 23:59:13 -05:00 committed by GitHub
parent 7fb9142f1d
commit 64768d4f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -24,6 +24,8 @@ def runESD(self, debugPlot=True):
extraOffset = self.extraESDCycles * np.pi * 2
val = np.array([])
for swath in swathList:
if self._insar.numberOfCommonBursts[swath-1] < 2:
@ -53,7 +55,6 @@ def runESD(self, debugPlot=True):
os.remove(ff)
val = []
lineCount = 0
for ii in range(minBurst, maxBurst):
intname = os.path.join(esddir, 'overlap_IW%d_%02d.%dalks_%drlks.int'%(swath,ii+1, alks,rlks))

View File

@ -470,7 +470,7 @@ def mmapFromISCE(fname, logger=None):
isceFile=False
dataName = fname
except:
raise Exception('Input file: {0} should either be an ISCE image / GDAL image. Appears to be neither')
raise Exception('Input file: {0} should either be an ISCE image / GDAL image. Appears to be neither'.format(fname))
if logger is not None:
logger.debug('Creating readonly ISCE mmap with \n' +

View File

@ -297,7 +297,7 @@ class Application(Component, StepHelper):
(self._pickleObj, os.path.join(self.pickleLoadDir, name))
)
except IOError:
print("Cannot open %s", os.path.join(self.pickleLoadDir, name))
print("Cannot open %s" % (os.path.join(self.pickleLoadDir, name)))
return None