Esempio n. 1
0
 def load_data(self,data_fmt='AGI',data_fpath=None,
               inf_electrode_xy = [None,None],
               string_nums=1):
     '''Load resistivity data file.'''
     
     # File to read is specified either in R3 initiation or as a variable
     # to load_data. The input to this function is given priority.
     if data_fpath is None:
         data_fpath = self.data_fpath
     else:
         self.data_fpath = data_fpath # Save data_fpath to R3 class variable.
     
     load_dict = {'fname':data_fpath,'data_fmt':data_fmt,
                  'inf_electrode_xy':inf_electrode_xy,
                  'string_nums':string_nums}
     self.meas_data,self.electrode_data = pyres_utils.load_er_data(**load_dict)
Esempio n. 2
0
from pyres import r2_tools
from pyres import pyres_utils, plot_utils

#%% ########## Load ER data ################
# Define directory where example scripts are located
ex_dir = r'C:\ER'
work_dir = os.path.join(ex_dir, r'R2_examples\ExFieldData')
stg_file = 'PER3A.stg'
stg_fname = os.path.join(work_dir, stg_file)

# Define directory with R2
exe_dir = os.path.join(ex_dir, r'R2\Distribition_3.1\Progs')

load_dict = {'fname': stg_fname, 'data_fmt': 'AGI'}

meas_data, electrode_data = pyres_utils.load_er_data(**load_dict)

electrode_data[:, 3] = electrode_data[:, 4]  # force y to be elevation
nlines = np.unique(
    electrode_data[:, 0]).shape[0]  # assumes each line is a new string
nelectrodes_per_line = electrode_data.shape[0] / nlines
line_strexyz = electrode_data.reshape((nlines, nelectrodes_per_line, -1))
#%% ############## Create triangular mesh ######################
# Initialize meshR2 object with basic line information
mr2 = mesh_tools.meshR2(nlines=1,
                        name=stg_file,
                        nelectrodes_per_line=nelectrodes_per_line)

# Setup near and far field domains
dx = np.diff(electrode_data[:, 2])[0]  # x-spacing of electrodes
clen = dx / 6.  # Foreground mesh characteristic length scale