Apr-06-2022, 09:02 AM
This is the script up to the problem line. All the variables look good up to the error point. I'm assuming cs.collections is a function of Matplotlib, would it be that that function is missing from my environment?
from scipy import * from pylab import * from numpy import * import sys from degrees2utm import latlng2utm from copy import deepcopy from matplotlib.patches import PathPatch #close('all') # ================================================================================= # INPUT SECTION BEGIN # ================================================================================= meshfile='Caldera_Before.xyz' # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! collapse_duration = 60.0 # in seconds collapse_depth = -480 # depth of the filling cup meshfile_start='Caldera_Output.xyz' # file with output file_ls = "collapse.xyt" # file with displacement # ================================================================================= # INPUT SECTION END # ================================================================================= #utm_grid = True print('reading mesh file data; might take some time') data=genfromtxt(meshfile) nx = 88 # dimensions of the mesh file ny = 84 elevation=data[:, 2] xx=data[:, 0] yy=data[:, 1] elevation=elevation.reshape((ny, nx)) # bathymetry/topography xx=xx.reshape((ny, nx)) yy=yy.reshape((ny, nx)) cmax=500 # color scale lmin=0 # cutting from east lmax=88 # cutting from west rmin=0 # north of santorini rmax=84 # south of santorini ###### kolumbo data kxx=xx[rmin:rmax, lmin:lmax] kyy=yy[rmin:rmax, lmin:lmax] kelevation=elevation[rmin:rmax, lmin:lmax] ################################################## collapse bathymetry data collapse_steps = 2 # can be changed by USER collapse_starttime = 0.0 # in second; can be changed by USER collapse_times = linspace(0, collapse_duration, collapse_steps) cs = contour(kxx, kyy, -kelevation, [collapse_depth]) csp = cs.collections[0].get_paths()[2] # path csv = csp.vertices # vertices csv_x = csv[:, 0] csv_y = csv[:, 1] if (not plot_debugfig): close()