[SciPy-User] memory error - numpy mean - netcdf4
Mon Aug 29 17:55:50 CDT 2011
Thanks for all of the responses. I have tried adding in the code you
mentioned (see below). I am not sure if I am putting it in the correct
place? and I am now receiving another error:
"UserWarning: Warning: converting a masked element to nan."
Not sure if that is bringing me any closer? Any feedback will be greatly
from netCDF4 import Dataset
import matplotlib.pyplot as plt
import numpy as N
from mpl_toolkits.basemap import Basemap
for (path, dirs, files) in os.walk(MainFolder):
for dir in dirs:
for ncfile in files:
ncfile=Dataset(ncfile, 'r+', 'NETCDF4')
for i in xrange(1, len(TSFC)-1,1):
#plot output summary stats
map = Basemap(projection='merc',llcrnrlat=-40,urcrnrlat=-33,
plt.title('TSFC Mean at 3pm')
CS = map.contourf(x,y,array, cmap=plt.cm.jet)
cax = plt.axes([l+w+0.025, b, 0.025, h])
On Sat, Aug 27, 2011 at 10:54 AM, srean <firstname.lastname@example.org> wrote:
> On Fri, Aug 26, 2011 at 2:33 PM, Phil Morefield <email@example.com>wrote:
>> The formula you have written looks like you're collapsing everything into
>> a single value. I think he's trying to average a bunch of 2D arrays into a
>> single 2D array.
> You are correct, the form that I posted can be read as if it is for
> updating single mean vector \mu, but you can use the same for an nd-array
> trivially. Just have \mu and t as nd-arrays. m can be one too. Numpy
> broadcasting will take care of the rest.
> One advantage is that it requires only a constant amount of memory for the
> computation, you can even read the data in from an infinite pipe or
> generator that yields a single vector or a matrix at a time (or bundles them
> up m at a time). It will always be uptodate with the current estimate of the
> means. In fact will work for any moment too.
> SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User