import numpy as np from tomopal.crtomopy.crtomo import crc from tomopal.geoview.diavatly import model_map cwd = os.getcwd() # Current working directory sub_folder_name = "paper" mesh_dir = jp(cwd, "mesh", sub_folder_name) # Mesh files directory mshf = jp(mesh_dir, "Mesh.dat") results_dir = jp(cwd, "results", sub_folder_name, "FM1B") # Results files directory subs = "" result_folder = jp(results_dir, subs) ncol, nlin, nelem, blocks, centerxy, nodes = crc.mesh_geometry(mshf) # %% Load results try: m2p = crc.mtophase(ncycles=1, pulse_l=3.5, tmin=0.02, tmax=2.83) res, ip, s = crc.import_res(result_folder=result_folder) rest = np.copy(res) ipt = np.copy(ip[:] / m2p) ss = [si[-1] for si in s] # res, files = import_res(result_folder=result_folder, return_file=1) # rest = np.copy(res[0]) res_levels = 10**np.linspace(min(rest), max(rest), 8) rtp = 10**np.copy(rest)
# It requires 3 arguments: # the numpy array of electrodes position of shape (n, 4) (required) # the electrode spacing (required) # the elevation data (optional) myinv.meshmaker(abmn=dat[:, [0, 1, 2, 3]], electrode_spacing=es, elevation_data=elev) # If you already have generated a mesh, comment the line above and instead # load the previously generated Mesh.dat file as described below. # %% Read the mesh data (number of cells, blocks coordinates, x-y coordinates of the center of the blocks) from Mesh.dat mshf = jp(mesh_dir, "Mesh.dat") # Path to the generated 'Mesh.dat' file. ncol, nlin, nelem, blocks, centerxy = mesh_geometry( mshf) # Extract mesh properties # %% Build configuration file # 0 Mesh.dat file mesh_file = mshf # 1 elec.dat file elec_file = jp(mesh_dir, "elec.dat") # 2 Data file data_file = jp(data_dir, "demo_data.dat") # 3 Results folder file # Specify the path where the results will be loaded