MTgeophysics / mtpy

Python toolbox for standard Magnetotelluric (MT) data analysis
GNU General Public License v3.0
147 stars 66 forks source link

Memory issue with penetration depth plotting #144

Open agrayver opened 3 years ago

agrayver commented 3 years ago

I'm getting this error:

~/Documents/Progs/mtpy/mtpy/imaging/penetration.py in plot(self, fontsize, **kwargs) 386 387 # grid_z0 = griddata(points, values, (grid_x, grid_y), method='nearest') --> 388 grid_z = griddata(points, values, (grid_x, grid_y), method='linear') 389 # grid_z = griddata(points, values, (grid_x, grid_y), method='cubic') 390 MemoryError: Unable to allocate 5.01 GiB for an array with shape (11779, 28542, 2) and data type float64

I chaned pixelsize manually in penetration.py and it works.

I wonder if 'pixelsize' could be part of "**kwargs" when calling the function?

Additionally, there is a ton of output for each stations like

print("***** The period-index=%s coressponding to the selected_period %s"%(per_index, selected_period))

I wonder if one could suppress it, maybe (by introducing a verbosity flag?

alkirkby commented 3 years ago

I've added pixelsize so it is now a keyword argument and is passed through to the function; see example in examples/scripts for more details. Hope this resolves the issue? @zhang01GA would it be possible to add a verbosity option to suppress output to the screen?

agrayver commented 3 years ago

Thanks @alkirkby , this fixed the memory issue.