[Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Howard
Hi all I am a fairly recent convert to python and I have got a question that's got me stumped. I hope this is the right mailing list: here goes :) I am reading some time series data out of a netcdf file a single timestep at a time. If the data is NaN, I want to reset it to the minimum of

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Howard
On 1/27/12 5:21 PM, Eric Firing wrote: On 01/27/2012 11:18 AM, Howard wrote: Hi all I am a fairly recent convert to python and I have got a question that's got me stumped. I hope this is the right mailing list: here goes :) I am reading some time series data out of a netcdf file a single

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Benjamin Root
On Fri, Jan 27, 2012 at 4:37 PM, Howard how...@renci.org wrote: I have found, in using tricontourf, that in the mapping from data values to color values, the range of the data seems to include even the data from the masked triangles. This causes the data to be either monochromatic or

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Olivier Delalleau
Eric's probably right and it's indexing with a masked array that's causing you trouble. Since you seem to say your NaN values correspond to your mask, you should be able to simply do: modelData[modeData.mask] = dataMin Note that in further processing it may then make more sense to remove the