From 74fdcbf6579090f79f5d62d43b66a7371cab5de5 Mon Sep 17 00:00:00 2001 From: Microwave Remote Sensing Laboratory <50493465+MIRSL@users.noreply.github.com> Date: Mon, 30 Sep 2019 15:25:51 -0400 Subject: [PATCH] Add files via upload --- applications/imageMath.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/applications/imageMath.py b/applications/imageMath.py index 3977a89..63795d7 100755 --- a/applications/imageMath.py +++ b/applications/imageMath.py @@ -293,6 +293,7 @@ def main(args, files): #######Determine number of input and output bands bandList = [] + iMath['equations'] = [] for ii,expr in enumerate(args.equation.split(';')): #####Now parse the equation to get the file names used @@ -314,12 +315,16 @@ def main(args, files): #####Determine unique images from the bandList - fileList = IML.bandsToFiles(bandList, logger) + fileList = IML.bandsToFiles(bandList, logger) #[a,b,c] ######Create input memmaps for ii,infile in enumerate(fileList): - fstr, files = parseInputFile(infile, files) + if type(files) == list: + fstr, files = parseInputFile(infile, files) + else: + fstr = getattr(files, infile) + logger.debug('Input string for File %d: %s: %s'%(ii, infile, fstr)) if len(fstr.split(';')) > 1: @@ -341,8 +346,9 @@ def main(args, files): if bbox is not None: iMath['bboxes'].append(bbox) - if len(files): - raise IOError('Unused input variables set:\n'+ ' '.join(files)) + if type(files) == list: + if len(files): + raise IOError('Unused input variables set:\n'+ ' '.join(files)) #######Some debugging logger.debug('List of available bands: ' + str(iMath['inBands'].keys()))