Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
top='free' ; bottom='locked' ; left='locked' ; right='locked' #'locked' or 'free'
bounds=(top,bottom,left,right)
################################################################################e=
######## Run-time modifications to the time series ############
weight=True
decimate=None #Decimate by constant (=None for NO decimation)
bandpass=None#np.array([0.5]) #Corner frequencies in Hz =None if no filter is desired
################################################################################
#Initalize project folders
if init==1:
runslip.init(home,project_name)
# Run green functions
if make_green==1 or make_synthetics==1:
runslip.inversionGFs(home,project_name,GF_list,tgf_file,fault_name,model_name,
dt,tsun_dt,NFFT,tsunNFFT,make_green,make_synthetics,dk,pmin,
pmax,kmax,beta,time_epi,hot_start)
#Run inversion
if invert==1:
runslip.run_inversion(home,project_name,run_name,fault_name,model_name,GF_list,G_from_file,
G_name,epicenter,rupture_speed,num_windows,reg_spatial,reg_temporal,
nfaults,beta,decimate,bandpass,solver,bounds,weight,Ltype)
# [0.5] is a low pass filter
# [0.02,0.5] is a bdan pass filter
# [0.02,np.inf] is a high pass filter
displacement_bandpass=np.array([0.5])
velocity_bandpass=None
tsunami_bandpass=None
bandpass=[displacement_bandpass,velocity_bandpass,tsunami_bandpass]
################################################################################
#Initalize project folders
if init==1:
runslip.init(home,project_name)
# Run green functions
if make_green==1 or make_synthetics==1:
runslip.inversionGFs(home,project_name,GF_list,tgf_file,fault_name,model_name,
dt,tsun_dt,NFFT,tsunNFFT,make_green,make_synthetics,dk,pmin,
pmax,kmax,beta,time_epi,hot_start,ncpus,custom_stf)
#Run inversion
if invert==1:
runslip.run_inversion(home,project_name,run_name,fault_name,model_name,GF_list,G_from_file,
G_name,epicenter,rupture_speed,num_windows,reg_spatial,reg_temporal,
nfaults,beta,decimate,bandpass,solver,bounds,weight,Ltype)
if init==1:
fakequakes.init(home,project_name)
#Generate rupture models
if make_ruptures==1:
fakequakes.generate_ruptures(home,project_name,run_name,fault_name,slab_name,
mesh_name,load_distances,distances_name,UTM_zone,target_Mw,model_name,
hurst,Ldip,Lstrike,num_modes,Nrealizations,rake,buffer_factor,
rise_time_depths,time_epi,max_slip,source_time_function,lognormal,
slip_standard_deviation)
print '-- Now making plots --\n'
viewFQ.plot_KLslip(home,project_name,run_name,mesh_name)
# Prepare waveforms and synthetics
if make_GFs==1 or make_synthetics==1:
runslip.inversionGFs(home,project_name,GF_list,None,fault_name,model_name,
dt,None,NFFT,None,make_GFs,make_synthetics,dk,pmin,
pmax,kmax,0,time_epi,0,ncpus,custom_stf,impulse=True)
if make_waveforms==1:
forward.waveforms_fakequakes(home,project_name,fault_name,rupture_list,GF_list,
model_name,run_name,dt,NFFT,G_from_file,G_name,source_time_function)
fakequakes.init(home,project_name)
#Generate rupture models
if make_ruptures==1:
fakequakes.generate_ruptures(home,project_name,run_name,fault_name,slab_name,
mesh_name,load_distances,distances_name,UTM_zone,target_Mw,model_name,hurst,Ldip,
Lstrike,num_modes,Nrealizations,rake,buffer_factor,rise_time_depths,time_epi,
max_slip,source_time_function,lognormal,slip_standard_deviation,scaling_law,ncpus,
force_magnitude=force_magnitude,force_area=force_area,mean_slip_name=mean_slip,
hypocenter=hypocenter,force_hypocenter=force_hypocenter,no_random=no_random,
shypo=center_subfault,use_hypo_fraction=use_hypo_fraction,shear_wave_fraction=shear_wave_fraction)
# Prepare waveforms and synthetics
if make_GFs==1 or make_synthetics==1:
runslip.inversionGFs(home,project_name,GF_list,None,fault_name,model_name,
dt,None,NFFT,None,make_GFs,make_synthetics,dk,pmin,
pmax,kmax,0,time_epi,0,ncpus,custom_stf,impulse=True)
# Synthesize the waveforms
if make_waveforms==1:
forward.waveforms_fakequakes(home,project_name,fault_name,rupture_list,GF_list,
model_name,run_name,dt,NFFT,G_from_file,G_name,source_time_function)