Computer freezes plotting

Hello all,
i have made a python script to plot some netcdf files that go from 4mb to
80mb, and the main purpose is to plot one after another. This seems to work
fine, no problems there, but sometimes the computer crashes and i belive its
beacause the files are too big. Is there any way to accelerate the plot time
or reduce memory consumption?

If your asking whats the error, well, actually i get no error, it just never
finishes plotting. I tried to wait for like 10 hours, and nothing happened
so i assume it crashed.

Thx in advance

···

--
View this message in context: http://old.nabble.com/Computer-freezes-plotting-tp31331581p31331581.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Muffles, on 2011-04-06 02:26, wrote:

i have made a python script to plot some netcdf files that go from 4mb to
80mb, and the main purpose is to plot one after another. This seems to work
fine, no problems there, but sometimes the computer crashes and i belive its
beacause the files are too big. Is there any way to accelerate the plot time
or reduce memory consumption?

If your asking whats the error, well, actually i get no error, it just never
finishes plotting. I tried to wait for like 10 hours, and nothing happened
so i assume it crashed.

How many such files would you say you're plotting?

If you are creating multiple figures as you go - are you closing
the ones you no longer need?

If you are using IPython, did you disable the output caching?

I realize this'll be difficult, but if you can reduce the
problematic code to a standalone script that reproduces the
problem, we'd be able to much more definitively track down the
problem and find a solution.

best,

···

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

In addition to what Paul wrote, check the following (assuming you are using netCDF4 to read the files; the same may apply when using other netcdf interfaces):

Use slicing to extract the variables you are plotting as ndarrays rather than trying to call mpl routines with the netCDF4 variable objects themselves. I haven't tracked down exactly what is happening, but I have noticed that extracting and plotting can be orders of magnitude faster than feeding the netCDF4 variable directly to the mpl plot command.

Eric

···

On 04/05/2011 11:26 PM, Muffles wrote:

Hello all,
i have made a python script to plot some netcdf files that go from 4mb to
80mb, and the main purpose is to plot one after another. This seems to work
fine, no problems there, but sometimes the computer crashes and i belive its
beacause the files are too big. Is there any way to accelerate the plot time
or reduce memory consumption?

If your asking whats the error, well, actually i get no error, it just never
finishes plotting. I tried to wait for like 10 hours, and nothing happened
so i assume it crashed.

Thx in advance