diff --git a/processing/post/imageData.py b/processing/post/imageData.py index 2ca3ef6e7..51547d4eb 100755 --- a/processing/post/imageData.py +++ b/processing/post/imageData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 import os import sys @@ -102,6 +102,7 @@ parser.set_defaults(label = None, ) (options,filenames) = parser.parse_args() +if filenames == []: filenames = [None] if options.pixelsize > 1: (options.pixelsizex,options.pixelsizey) = [options.pixelsize]*2 @@ -112,9 +113,6 @@ if options.invert: theMap = theMap.invert() theColors = np.uint8(np.array(theMap.export(format = 'list',steps = 256))*255) # --- loop over input files ------------------------------------------------------------------------- - -if filenames == []: filenames = [None] - for name in filenames: try: table = damask.ASCIItable(name = name, labeled = options.label is not None, readonly = True) diff --git a/processing/post/imageDataDeformed.py b/processing/post/imageDataDeformed.py index 79f81e29e..b9219ac47 100755 --- a/processing/post/imageDataDeformed.py +++ b/processing/post/imageDataDeformed.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 import os import sys @@ -95,6 +95,7 @@ parser.set_defaults(label = None, ) (options,filenames) = parser.parse_args() +if filenames == []: filenames = [None] options.size = np.array(options.size) options.dimension = np.array(options.dimension) @@ -109,16 +110,12 @@ if options.invert: theMap = theMap.invert() theColors = np.uint8(np.array(theMap.export(format='list',steps=256))*255) # --- loop over input files ------------------------------------------------------------------------- - -if filenames == []: filenames = [None] - for name in filenames: try: - table = damask.ASCIItable(name = name, readonly = True, - labeled = options.label is not None) + table = damask.ASCIItable(name = name, labeled = options.label is not None, readonly = True) except IOError: continue - table.report_name(scriptName,name) + damask.util.report(scriptName,name) # ------------------------------------------ read header ------------------------------------------ diff --git a/processing/post/imageDataRGB.py b/processing/post/imageDataRGB.py index 4a1d521b2..a34a48f4f 100755 --- a/processing/post/imageDataRGB.py +++ b/processing/post/imageDataRGB.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 import os import sys @@ -72,18 +72,15 @@ parser.set_defaults(label = None, ) (options,filenames) = parser.parse_args() +if filenames == []: filenames = [None] if options.dimension == []: parser.error('dimension of data array missing') if options.pixelsize > 1: (options.pixelsizex,options.pixelsizey) = [options.pixelsize]*2 # --- loop over input files ------------------------------------------------------------------------- - -if filenames == []: filenames = [None] - for name in filenames: try: - table = damask.ASCIItable(name = name, readonly = True, - labeled = options.label is not None) + table = damask.ASCIItable(name = name, labeled = options.label is not None, readonly = True) except IOError: continue damask.util.report(scriptName,name) diff --git a/python/damask/colormaps.py b/python/damask/colormaps.py index 9c27da147..2117b0b57 100644 --- a/python/damask/colormaps.py +++ b/python/damask/colormaps.py @@ -218,7 +218,7 @@ class Color: if (self.color[i] > 0.04045): RGB_lin[i] = ((self.color[i]+0.0555)/1.0555)**2.4 else: RGB_lin[i] = self.color[i] /12.92 XYZ = np.dot(convert,RGB_lin) - XYZ = np.clip(XYZ,0.0) + XYZ = np.clip(XYZ,0.0,None) converted = Color('XYZ', XYZ) self.model = converted.model