From 05a8124d82b3308b5ee05f486a892c0060a9b9f6 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 19 Aug 2015 18:30:50 +0000 Subject: [PATCH] simplified rescaling interpretation --- processing/pre/geom_canvas.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/processing/pre/geom_canvas.py b/processing/pre/geom_canvas.py index 1dfe02374..8ed1f5ab2 100755 --- a/processing/pre/geom_canvas.py +++ b/processing/pre/geom_canvas.py @@ -81,9 +81,8 @@ for name in filenames: 'microstructures': 0, } - newInfo['grid'] = np.array([{True: int(o*float(n.translate(None,'xX'))), - False: int(n.translate(None,'xX'))}[n[-1].lower() == 'x'] for o,n in zip(info['grid'],options.grid)],'i') - newInfo['grid'] = np.where(newInfo['grid'] <= 0, info['grid'],newInfo['grid']) + newInfo['grid'] = np.array([int(o*float(n.translate(None,'xX'))) if n[-1].lower() == 'x' else int(n) for o,n in zip(info['grid'],options.grid)],'i') + newInfo['grid'] = np.where(newInfo['grid'] > 0, newInfo['grid'],info['grid']) microstructure_cropped = np.zeros(newInfo['grid'],'i') microstructure_cropped.fill(options.fill if options.fill > 0 else microstructure.max()+1)