|
From: Park H. <par...@gm...> - 2007-03-29 16:11:30
|
I have bogus values I don't want to display in a gridded data set (regions of non-convergence, for example). pcolor does exactly what I want with a masked array, except the X and Y arguments must be integer arrays (as far as I can tell) and my data X and Y points are not integer arrays. An approximation of what is happening goes like: x = linspace( 0, pi, 100) y = linspace( -pi/2, pi/2, 30) ev = custom_func( x, y) print sum( isnan( ev)) 12 (or whatever) ev_m = ma.mask_where( isnan( ev), ev) pcolor( x, y, ev_m) <-- this will fail, with an error like "need more than one value to unpack" which I think is caused by the non-integer nature of x, y. Any suggestions for how can I can address this? My preference is to use pcolor, because of the transparency. I am not a fan of the scipy discussion regarding user-driven normalization "sentinels" to catch the bogus values. Masked arrays seem so much more flexible. -Park |