[Yt-svn] commit/yt: MatthewTurk: Changed min/max to mi/ma for variable names.
Bitbucket
commits-noreply at bitbucket.org
Fri Jun 10 09:28:40 PDT 2011
1 new changeset in yt:
http://bitbucket.org/yt_analysis/yt/changeset/f50161debd81/
changeset: f50161debd81
branch: yt
user: MatthewTurk
date: 2011-06-10 18:28:21
summary: Changed min/max to mi/ma for variable names.
affected #: 1 file (11 bytes)
--- a/yt/visualization/image_writer.py Fri Jun 10 11:26:54 2011 -0400
+++ b/yt/visualization/image_writer.py Fri Jun 10 09:28:21 2011 -0700
@@ -29,7 +29,7 @@
import _colormap_data as cmd
import yt.utilities.amr_utils as au
-def scale_image(image, min=None, max=None):
+def scale_image(image, mi=None, ma=None):
r"""Scale an image ([NxNxM] where M = 1-4) to be uint8 and values scaled
from [0,255].
@@ -47,12 +47,12 @@
if isinstance(image, na.ndarray) and image.dtype == na.uint8:
return image
if isinstance(image, (types.TupleType, types.ListType)):
- image, min, max = image
- if min is None:
- min = image.min()
- if max is None:
- max = image.max()
- image = (na.clip((image-min)/(max-min) * 255, 0, 255)).astype('uint8')
+ image, mi, ma = image
+ if mi is None:
+ mi = image.min()
+ if ma is None:
+ ma = image.max()
+ image = (na.clip((image-mi)/(ma-mi) * 255, 0, 255)).astype('uint8')
return image
def multi_image_composite(fn, red_channel, blue_channel,
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list