def process_station( station, rr_station, birrp_path, local_path, copy_edi_path, coil_calibration_path, fn_copy=True, ): """ process station """ station_path = os.path.join(local_path, station) if rr_station is not None: rr_station_path = os.path.join(local_path, rr_station) else: rr_station_path = None # ============================================================================== # Process data # ============================================================================== b_param_dict = { "c2threshb": 0.45, "c2threshe": 0.45, "c2thresh1": 0.45, "ainuin": 0.9995, "ainlin": 0.0001, "nar": 5, } zp_obj = zp.Z3D_to_edi(station_dir=station_path, rr_station_dir=rr_station_path) zp_obj.birrp_exe = birrp_path zp_obj.coil_cal_path = coil_calibration_path plot_obj, comb_edi_fn = zp_obj.process_data( df_list=[4096, 256, 16], notch_dict={ 4096: {}, 256: None, 16: None }, max_blocks=3, sr_dict={ 4096: (1000.0, 25), 256: (24.999, 0.126), 16: (0.125, 0.0001) }, birrp_param_dict=b_param_dict, ) cp_edi_fn = os.path.join(copy_edi_path, station + ".edi") shutil.copy(comb_edi_fn, cp_edi_fn) print "--> Copied {0} to {1}".format(comb_edi_fn, cp_edi_fn) return plot_obj, comb_edi_fn
def process_station(station, rr_station, birrp_path, local_path, copy_edi_path, coil_calibration_path, fn_copy=True): """ process station """ station_path = os.path.join(local_path, station) if rr_station is not None: rr_station_path = os.path.join(local_path, rr_station) else: rr_station_path = None #============================================================================== # Process data #============================================================================== b_param_dict = { 'c2threshb': .45, 'c2threshe': .45, 'c2thresh1': .45, 'ainuin': .9995, 'ainlin': .0001, 'nar': 5 } zp_obj = zp.Z3D_to_edi(station_dir=station_path, rr_station_dir=rr_station_path) zp_obj.birrp_exe = birrp_path zp_obj.coil_cal_path = coil_calibration_path plot_obj, comb_edi_fn = zp_obj.process_data(df_list=[4096, 256, 16], notch_dict={ 4096: {}, 256: None, 16: None }, max_blocks=3, sr_dict={ 4096: (1000., 25), 256: (24.999, .126), 16: (.125, .0001) }, birrp_param_dict=b_param_dict) cp_edi_fn = os.path.join(copy_edi_path, station + '.edi') shutil.copy(comb_edi_fn, cp_edi_fn) print '--> Copied {0} to {1}'.format(comb_edi_fn, cp_edi_fn) return plot_obj, comb_edi_fn
survey_path = r"c:\MT\SCEC" station = "mvx031" # rr_station = 'mvx008' rr_station = None bp = { "ilev": 0, "nar": 7, "ainuin": 0.9999, "ainlin": 0.0001, "c2threshb": 0.45, "thetab": [180, 90, 0], "thetae": [0, 90, 0], } zp_obj = zp.Z3D_to_edi() zp_obj.station_dir = os.path.join(survey_path, station) if rr_station is not None: zp_obj.rr_station_dir = os.path.join(survey_path, rr_station) else: zp_obj.rr_station_dir = None zp_obj.coil_cal_path = r"c:\MT\Ant_calibrations" # with zp.Capturing() as output: n_dict_4096 = { "notches": [float(ii) for ii in range(60, 1860, 120)], "notch_radius": 0.5, "freq_rad": 0.5, "rp": 0.1, } plot_obj, comb_edi = zp_obj.process_data(
def process_station(station, rr_station, birrp_path, local_path, hd_path, copy_edi_path, coil_calibration_path, fn_copy=True): """ process station """ #============================================================================== # Copy Z3D files to local folder #============================================================================== local_station_path = os.path.join(local_path, station) if not os.path.exists(local_station_path): os.mkdir(local_station_path) if rr_station is not None: rr_local_station_path = os.path.join(local_path, rr_station) if not os.path.exists(rr_local_station_path): os.mkdir(rr_local_station_path) if fn_copy is True: # copy all .z3d files to a local station folder fn_count = 0 station_hd_path = os.path.join(hd_path, station) for z3d_fn in os.listdir(station_hd_path): if z3d_fn.lower().endswith('.z3d'): fn_copy_path = os.path.join(local_station_path, z3d_fn) if os.path.exists(fn_copy_path) is True: continue fn_hd_path = os.path.join(hd_path, station, z3d_fn) shutil.copy(fn_hd_path, fn_copy_path) fn_count += 1 print 'Copied {0} .z3d files to {1}'.format(fn_count, local_station_path) if rr_station is not None: # copy all .z3d files to a local station folder fn_count = 0 rr_station_hd_path = os.path.join(hd_path, rr_station) for z3d_fn in os.listdir(rr_station_hd_path): if z3d_fn.lower().endswith( 'hx.z3d') or z3d_fn.lower().endswith('hy.z3d'): fn_copy_path = os.path.join(rr_local_station_path, z3d_fn) if os.path.exists(fn_copy_path) is True: continue fn_hd_path = os.path.join(hd_path, rr_station, z3d_fn) shutil.copy(fn_hd_path, fn_copy_path) fn_count += 1 print 'Copied {0} .z3d files to {1}'.format( fn_count, local_station_path) else: rr_local_station_path = None #============================================================================== # Process data #============================================================================== b_param_dict = { 'c2threshb': .45, 'c2threshe': .45, 'c2thresh1': .45, 'ainuin': .9995, 'ainlin': .0001, 'nar': 5 } zp_obj = zp.Z3D_to_edi(station_dir=local_station_path, rr_station_dir=rr_local_station_path) zp_obj.birrp_exe = birrp_path zp_obj.coil_cal_path = coil_calibration_path plot_obj, comb_edi_fn = zp_obj.process_data(df_list=[4096, 256, 16], num_comp=5, notch_dict={ 4096: {}, 256: None, 16: None }, max_blocks=3, sr_dict={ 4096: (1000., 25), 256: (24.999, .126), 16: (.125, .0001) }, birrp_param_dict=b_param_dict) cp_edi_fn = os.path.join(copy_edi_path, station + '.edi') shutil.copy(comb_edi_fn, cp_edi_fn) print '--> Copied {0} to {1}'.format(comb_edi_fn, cp_edi_fn) return plot_obj, comb_edi_fn
else: rr_local_station_path = None #============================================================================== # Process data #============================================================================== b_param_dict = { 'c2threshb': .45, 'c2threshe': .45, 'c2thresh1': .45, 'ainuin': .9995, 'ainlin': .0001, 'nar': 5 } zp_obj = zp.Z3D_to_edi(station_dir=local_station_path, rr_station_dir=rr_local_station_path) zp_obj.birrp_exe = birrp_path zp_obj.coil_cal_path = coil_calibration_path plot_obj, comb_edi_fn = zp_obj.process_data(df_list=[4096, 16], num_comp=5, notch_dict={ 4096: {}, 256: None, 16: None }, max_blocks=2, sr_dict={ 4096: (1000., 25), 256: (24.999, .126), 16: (.125, .0001)