def main(): wrs_obj = wrs(default_kwargs=default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('Path to') >= 0: path = kwvalues if kwey.find('mesh') >= 0: path_to_occam_mesh = kwvalues if kwey.find('data') >= 0: path_to_occam_data = kwvalues if kwey.find('iteration') >= 0: path_to_occam_iter = kwvalues if kwey.find('model') >= 0: path_to_occam_model = kwvalues if kwey.find('save outdir') >= 0: savefigure = kwvalues if kwey.find('investigation') >= 0: doi = kwvalues if kwey.find('style') >= 0: plotStyle = kwvalues if kwey.find('report') >= 0: see_report = kwvalues if kwey.find('figure') >= 0: figsize = kwvalues plot2d_obj = Plot2d(fig_size=figsize) #,fig_dpi = 600. ) plot2d_obj.plot_occam2dModel(mesh_fn=os.path.join(path, path_to_occam_mesh), iter_fn=os.path.join(path, path_to_occam_iter), model_fn=os.path.join(path, path_to_occam_model), data_fn=os.path.join(path, path_to_occam_data), doi=doi, savefig=savefigure, plot_style=plotStyle, show_report=see_report)
def main(): """ Can give input_kwargs to test consoles scripts. :Example: >>> input_kwargs ={'Path to occam2d files': r'C:/Users\Administrator\Desktop\ThesisImp\'\ ... 'occam2D\invers+files\inver_res\K1', ... 'data':'OccamDataFile.dat', ... 'mesh' : 'Occam2DMesh', ... 'model' : 'Occam2DModel', ... 'iter':'ITER17.iter' } >>> wrs_obj = wrs(default_kwargs =default_kwargs, input_kwargs =input_kwargs) """ wrs_obj = wrs(default_kwargs =default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('Path to occam2d') >=0 : path = kwvalues if kwey.find('mesh')>=0 : path_to_occam_mesh = kwvalues if kwey.find('data') >= 0 : path_to_occam_data = kwvalues if kwey.find('iteration') >= 0 : path_to_occam_iter = kwvalues if kwey.find('model') >=0: path_to_occam_model = kwvalues if kwey.find('investigation') >=0 :DOI = kwvalues if kwey.find('Scale') >= 0 : scale_output= kwvalues if kwey.find('Output filename')>=0 : outputfilename = kwvalues occam_iter2dat_obj =i2d(mesh_fn=os.path.join(path, path_to_occam_mesh), iter_fn = os.path.join(path, path_to_occam_iter), model_fn =os.path.join(path, path_to_occam_model ), data_fn =os.path.join(path, path_to_occam_data)) occam_iter2dat_obj.write_iter2dat_file(filename =outputfilename, scale=scale_output, doi=DOI)
def main(): wrs_obj = wrs(default_kwargs=default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('to edi file') >= 0: edipath = kwvalues if kwey.find('outdir') >= 0: savepath = kwvalues if kwey.find('filename') >= 0: new_edifilename = kwvalues if kwey.find('FILTER') >= 0: FILTER = kwvalues if kwey.find('of filter point') >= 0: number_of_filter_points = kwvalues if kwey.find('of skin depth') >= 0: number_of_skin_depth = kwvalues if kwey.find('length') >= 0: dipoleLength = kwvalues if kwey.find('frequency in') >= 0: reference_frequency = kwvalues if kwey.find('type') >= 0: datatype = kwvalues if kwey.find('rho factor x') >= 0: reduce_res_factor_x = kwvalues if kwey.find('rho factor y') >= 0: reduce_res_factor_y = kwvalues if kwey.find('Distortion tensor') >= 0: distortion_tensor = kwvalues if kwey.find('Distortion error tensor') >= 0: distortion_err_tensor = kwvalues shifting().write_corrected_edi(data_fn=edipath, number_of_points=number_of_filter_points, reference_frequency=reference_frequency, number_of_skin_depth=number_of_skin_depth, dipole_length=dipoleLength, FILTER=FILTER, filename=new_edifilename, datatype=datatype, reduce_res_factor_x=reduce_res_factor_x, reduce_res_factor_y=reduce_res_factor_y, distortion_tensor=distortion_tensor, distortion_err_tensor=distortion_err_tensor, savepath=savepath)
def main(): wrs_obj = wrs(default_kwargs=default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('Path to') >= 0: path = kwvalues if kwey.find('mesh') >= 0: path_to_occam_mesh = kwvalues if kwey.find('data') >= 0: path_to_occam_data = kwvalues if kwey.find('iteration') >= 0: path_to_occam_iter = kwvalues if kwey.find('model') >= 0: path_to_occam_model = kwvalues if kwey.find('save outdir') >= 0: savefigure = kwvalues if kwey.find('investigation') >= 0: DOI = kwvalues if kwey.find('style') >= 0: plotStyle = kwvalues if kwey.find('Scale') >= 0: scale = kwvalues if kwey.find('Station id') >= 0: station_to_plot = kwvalues if kwey.find('Input resistivities') >= 0: INPUT_RESISTIVITIES = kwvalues if kwey.find('Input layers') >= 0: INPUT_LAYERS = kwvalues if kwey.find('descent') >= 0: STEP_DESCENT = kwvalues if kwey.find('to iter2dat files') >= 0: path2 = kwvalues if kwey.find('Iter2dat `x,y,z`') >= 0: iter2dat_fn = kwvalues if kwey.find('Iter2dat `.bln`') >= 0: bln_file = kwvalues # Matplotlib properties to customize plots average_curve_color = (0.5, 0.8, 0.) sequence_curve_color = 'blue' font_dict_site = { 'size': 8, 'color': 'saddlebrown', 'weight': 'bold', 'style': 'italic' } # can use other matplotlib to customize your plot Plot2d(station_label_rotation=None, show_grid=True, font_size=8., lc='r', fig_size=[5, 5], markerfacecolor='k', markeredgecolor='k').plot_Pseudolog( station_id=station_to_plot, input_resistivities=INPUT_RESISTIVITIES, input_layers=INPUT_LAYERS, step_descent=STEP_DESCENT, doi=DOI, mesh_fn=os.path.join(path, path_to_occam_mesh), iter_fn=os.path.join(path, path_to_occam_iter), model_fn=os.path.join(path, path_to_occam_model), data_fn=os.path.join(path, path_to_occam_data), plot_style=plotStyle, scale=scale, iter2dat_fn=os.path.join(path2, iter2dat_fn), bln_fn=os.path.join(path2, bln_file), savefig=savefigure, lc_AD_curves=(average_curve_color, sequence_curve_color), font_dict_site=font_dict_site, )
def main(): wrs_obj = wrs(default_kwargs=default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('to avg') >= 0: path_to_avg = kwvalues if kwey.find('outdir') >= 0: savepath = kwvalues if kwey.find('profile') >= 0: path_to_station_file = kwvalues if kwey.find('extension') >= 0: j_extension = kwvalues if kwey.find('Survey name') >= 0: surveyName = kwvalues if kwey.find('file infos') >= 0: write_avg_file_infos = kwvalues if kwey.find('UTM') >= 0: utmZone = kwvalues avg.Avg().avg_to_jfile(avg_data_fn=path_to_avg, station_fn=path_to_station_file, j_extension=j_extension, savepath=savepath, writeInfos=write_avg_file_infos, utm_zone=utmZone, survey_name=surveyName)
def main(): wrs_obj = wrs(default_kwargs=default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('avg') >= 0: avgpath = kwvalues if kwey.find('frequency') >= 0: reference_frequency = kwvalues if kwey.find('edipath') >= 0: save_edipath = kwvalues if kwey.find('profile') >= 0: profile_fn = kwvalues if kwey.find('points or dipoles') >= 0: number_of_points = kwvalues if kwey.find('skin depth') >= 0: number_of_skin_depth = kwvalues if kwey.find('Name of filter') >= 0: add_filter = kwvalues avg.Avg().avg_to_edifile(data_fn=avgpath, profile_fn=profile_fn, savepath=save_edipath, reference_frequency=reference_frequency, apply_filter=add_filter, number_of_points=number_of_points, number_of_skin_depth=number_of_skin_depth)
def main(): wrs_obj = wrs(default_kwargs=default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('Path to parser drill') >= 0: path_to_parser_files = kwvalues if kwey.find('Name of parser file ') >= 0: parser_file = kwvalues if kwey.find('Type of data to write') >= 0: kind_of_data2output = kwvalues if kwey.find('Save borehole outdir') >= 0: savepath = kwvalues borehole_obj = Drill(well_filename=os.path.join(path_to_parser_files, parser_file), auto=True) borehole_obj._collar() borehole_obj.dhGeology() borehole_obj.dhSample() borehole_obj.dhSurveyElevAz(add_azimuth=None, add_elevation=None) borehole_obj.writeDHData(data2write=kind_of_data2output, savepath=savepath)
def main(): wrs_obj = wrs(default_kwargs =default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('Path to') >=0 : path = kwvalues if kwey.find('mesh')>=0 : path_to_occam_mesh = kwvalues if kwey.find('data') >= 0 : path_to_occam_data = kwvalues if kwey.find('iteration') >= 0 : path_to_occam_iter = kwvalues if kwey.find('model') >=0: path_to_occam_model = kwvalues if kwey.find('save outdir')>=0 : savepath = kwvalues if kwey.find('investigation') >=0 :DOI = kwvalues if kwey.find('log10') >= 0 : log10rho= kwvalues if kwey.find('negative depth') >= 0 : to_negative= kwvalues if kwey.find('station profile') >=0 : profile_path = kwvalues if kwey.find('Input resistivities') >=0: INPUT_RESISTIVITIES= kwvalues if kwey.find('Input layers')>=0 : INPUT_LAYERS= kwvalues if kwey.find('descent') >=0: STEP_DESCENT= kwvalues if kwey.find('to iter2dat files')>=0 : path2 = kwvalues if kwey.find('Iter2dat `x,y,z`') >=0: iter2dat_fn= kwvalues if kwey.find('Iter2dat `.bln`')>=0 : bln_file = kwvalues #------Create geodrill object ---------------- geo_obj = Geodrill( mesh_fn = os.path.join(path , path_to_occam_mesh), iter_fn = os.path.join(path , path_to_occam_iter), model_fn =os.path.join(path, path_to_occam_model) , data_fn =os.path.join(path, path_to_occam_data ), iter2dat_fn = os.path.join(path2 , iter2dat_fn), bln_fn = os.path.join(path2 , bln_file), input_resistivities=INPUT_RESISTIVITIES, input_layers =INPUT_LAYERS , step_descent = STEP_DESCENT, doi =DOI, ) geo_obj.to_oasis_montaj (profile_fn =profile_path, to_negative_depth = to_negative, savepath =savepath , to_log10 =log10rho)
def main(): wrs_obj = wrs(default_kwargs =default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('Path to edifiles') >=0 : edipath = kwvalues if kwey.find('frequencies - bool')>=0 : interpolate_frequency = kwvalues if kwey.find('frequencies range') >= 0 : frequency_interpolate_range = kwvalues if kwey.find('of model layers') >= 0 : number_of_model_layers = kwvalues if kwey.find('depth (z target)') >=0: expected_investigation_depth_or_z_target = kwvalues if kwey.find('Z bottom in')>=0 : exaggerate_vertical_z_bottom = kwvalues if kwey.find('First layer thickness') >=0 :model_first_layer_thickness_z1 = kwvalues if kwey.find('Start model resistivity') >= 0 : starting_res_model_value= kwvalues if kwey.find('iteration to run') >= 0 : number_of_iteration_to_run= kwvalues if kwey.find('strike in degree') >= 0 : geoelectric_strike= kwvalues if kwey.find('Occam2d model mode') >=0: occam_mode= kwvalues if kwey.find('TM phase')>=0 : TM_phase_error = kwvalues if kwey.find('TM resistivity') >=0: TM_res_error= kwvalues # if kwey.find('TE phase')>=0 : path2 = kwvalues # if kwey.find('TE resistivity') >=0: iter2dat_fn= kwvalues if kwey.find('cell width in')>=0 : model_cell_width = kwvalues if kwey.find('x pad multiplier')>=0 : horizontal_node_x_pad_multiplier = kwvalues if kwey.find('Brick trigger ')>=0 : brick_trigger = kwvalues occam2d_write.buildingInputfiles(edi_fn =edipath, geoelectric_strike= geoelectric_strike, interpolate_freq= interpolate_frequency, intp_freq_logspace =frequency_interpolate_range, iteration_to_run= number_of_iteration_to_run, resistivity_start = starting_res_model_value, res_tm_err= TM_res_error, phase_tm_err= TM_phase_error , occam_mode= occam_mode, n_layers = number_of_model_layers , cell_width = model_cell_width , x_pad_multiplier = horizontal_node_x_pad_multiplier, trigger =brick_trigger, z_bottom =exaggerate_vertical_z_bottom , z1_layer =model_first_layer_thickness_z1, z_target = expected_investigation_depth_or_z_target, )
def main(): wrs_obj = wrs(default_kwargs=default_kwargs) for kwey, kwvalues in wrs_obj.sanitize_kwargs.items(): if kwey.find('Path to') >= 0: path = kwvalues if kwey.find('mesh') >= 0: path_to_occam_mesh = kwvalues if kwey.find('data') >= 0: path_to_occam_data = kwvalues if kwey.find('iteration') >= 0: path_to_occam_iter = kwvalues if kwey.find('model') >= 0: path_to_occam_model = kwvalues if kwey.find('save outdir') >= 0: savepath = kwvalues if kwey.find('investigation') >= 0: DOI = kwvalues if kwey.find('Location filename') >= 0: filename = kwvalues if kwey.find('negative depth') >= 0: to_negative = kwvalues if kwey.find('Scale') >= 0: scale = kwvalues if kwey.find('Input resistivities') >= 0: INPUT_RESISTIVITIES = kwvalues if kwey.find('Input layers') >= 0: INPUT_LAYERS = kwvalues if kwey.find('descent') >= 0: STEP_DESCENT = kwvalues if kwey.find('to iter2dat files') >= 0: path2 = kwvalues if kwey.find('Iter2dat `x,y,z`') >= 0: iter2dat_fn = kwvalues if kwey.find('Iter2dat `.bln`') >= 0: bln_file = kwvalues geo_obj = Geodrill( mesh_fn=os.path.join(path, path_to_occam_mesh), iter_fn=os.path.join(path, path_to_occam_iter), model_fn=os.path.join(path, path_to_occam_model), data_fn=os.path.join(path, path_to_occam_data), iter2dat_fn=os.path.join(path2, iter2dat_fn), bln_fn=os.path.join(path2, bln_file), input_resistivities=INPUT_RESISTIVITIES, input_layers=INPUT_LAYERS, step_descent=STEP_DESCENT, doi=DOI, ) geo_obj.to_golden_software(filename=filename, savepath=savepath, scale=scale, to_negative_depth=to_negative)