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 messagesLT1AB
parent
7fb9142f1d
commit
64768d4f36
|
@ -24,6 +24,8 @@ def runESD(self, debugPlot=True):
|
||||||
|
|
||||||
extraOffset = self.extraESDCycles * np.pi * 2
|
extraOffset = self.extraESDCycles * np.pi * 2
|
||||||
|
|
||||||
|
val = np.array([])
|
||||||
|
|
||||||
for swath in swathList:
|
for swath in swathList:
|
||||||
|
|
||||||
if self._insar.numberOfCommonBursts[swath-1] < 2:
|
if self._insar.numberOfCommonBursts[swath-1] < 2:
|
||||||
|
@ -53,7 +55,6 @@ def runESD(self, debugPlot=True):
|
||||||
os.remove(ff)
|
os.remove(ff)
|
||||||
|
|
||||||
|
|
||||||
val = []
|
|
||||||
lineCount = 0
|
lineCount = 0
|
||||||
for ii in range(minBurst, maxBurst):
|
for ii in range(minBurst, maxBurst):
|
||||||
intname = os.path.join(esddir, 'overlap_IW%d_%02d.%dalks_%drlks.int'%(swath,ii+1, alks,rlks))
|
intname = os.path.join(esddir, 'overlap_IW%d_%02d.%dalks_%drlks.int'%(swath,ii+1, alks,rlks))
|
||||||
|
|
|
@ -470,7 +470,7 @@ def mmapFromISCE(fname, logger=None):
|
||||||
isceFile=False
|
isceFile=False
|
||||||
dataName = fname
|
dataName = fname
|
||||||
except:
|
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:
|
if logger is not None:
|
||||||
logger.debug('Creating readonly ISCE mmap with \n' +
|
logger.debug('Creating readonly ISCE mmap with \n' +
|
||||||
|
|
|
@ -297,7 +297,7 @@ class Application(Component, StepHelper):
|
||||||
(self._pickleObj, os.path.join(self.pickleLoadDir, name))
|
(self._pickleObj, os.path.join(self.pickleLoadDir, name))
|
||||||
)
|
)
|
||||||
except IOError:
|
except IOError:
|
||||||
print("Cannot open %s", os.path.join(self.pickleLoadDir, name))
|
print("Cannot open %s" % (os.path.join(self.pickleLoadDir, name)))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue