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 mask

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Benjamin Root
On Fri, Jan 27, 2012 at 4:37 PM, Howard 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 > bi-chromatic (the hi

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 times

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Eric Firing
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 > timestep at a time. If the data is

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Howard
Oh, one other thing I should mention: I did the install of numpy yesterday and I also have 1.6.1 Howard On 1/27/12 4:54 PM, Howard wrote: Hi Olivier I added this to the code: print "modelData:", type(modelData), modelData.shape, modelData.size print "dataMin:", type(dataMin) and got modelD

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Howard
Hi Olivier I added this to the code: print "modelData:", type(modelData), modelData.shape, modelData.size print "dataMin:", type(dataMin) and got modelData: (1767734,) 1767734 dataMin: What's funny is I tried the example from http://docs.scipy.org/doc/numpy-1.6.0/numpy-user.pdf and it wor

Re: [Numpy-discussion] NetCDF4/numpy question

2012-01-27 Thread Olivier Delalleau
What are the types and shapes of modelData and dataMin? (it works for me with modelData a (3, 4) numpy array and dataMin a Python float, with numpy 1.6.1) -=- Olivier 2012/1/27 Howard > Hi all > > I am a fairly recent convert to python and I have got a question that's > got me stumped. I hope

[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 t