Commit 6b12bf06 authored by David E. DeMarle's avatar David E. DeMarle

Merge branch 'changes-for-paraview-export-now' into 'master'

bah, I had the scaling and biasing wrong before

See merge request !128
parents 9a670e41 00fd0394
Pipeline #134426 failed with stage
in 0 seconds
......@@ -53,10 +53,10 @@ elif ext == ".Z":
flatarr = np.fromstring(zlib.decompress(compresseddata),
np.float32)
flatarr = ma.masked_invalid(flatarr)
mxval = flatarr.max()
mnval = flatarr.min();
mxval = flatarr.max()
print "MIN AND MAX ARE ", mnval, mxval
flatarr = flatarr.filled(0)*255/(mxval-mnval)+mnval #scale and bias into 0..255 for display
flatarr = ((flatarr.filled(mnval))-mnval)*(255.0/(mxval-mnval)) #scale and bias into 0..255 for display
im = PIL.Image.fromarray(flatarr.reshape((zlib_width, zlib_height)))
else:
im = PIL.Image.open(fname)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment