Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if make_synthetics==1:
if ncpus<2:
runslip.make_synthetics(home,project_name,station_file,fault_name,model_name,integrate,
static,tsunami,beta,hot_start,time_epi)
else:
runslip.make_parallel_synthetics(home,project_name,station_file,fault_name,model_name,integrate,
static,tsunami,beta,hot_start,time_epi,ncpus,custom_stf=None)
#Run forward comptuation or solve for inverse problem
if solve==1:
if static==0: #Forward problem (full waveforms)
forward.waveforms_fakequakes(home,project_name,fault_name,None,GF_list,
model_name,run_name,dt,NFFT,G_from_file,G_name,source_time_function=stf_type,
stf_falloff_rate=4.0,rupture_name=rupture_name,epicenter=epicenter,time_epi=time_epi)
if static==1: #Forward problem (coseismics)
forward.coseismics_matrix(home,project_name,rupture_name,station_file,G_from_file,G_name)
tsunami,hot_start,dk,pmin,pmax,kmax)
#Now make synthetics for source/station pairs
if make_synthetics==1:
#runslip.rupt2fault(home,project_name,rupture_name)
runslip.make_synthetics(home,project_name,station_file,fault_name,model_name,integrate,
static,tsunami,beta,hot_start,time_epi)
#Run forward comptuation or solve for inverse problem
if solve==1:
if static==0: #Forward problem (full waveforms)
forward.waveforms_matrix(home,project_name,fault_name,rupture_name,station_file,GF_list,model_name,
run_name,epicenter,time_epi,integrate,tsunami,hot_start,resample,beta,rupture_speed,
num_windows,dt,NFFT)
if static==1: #Forward problem (coseismics)
forward.coseismics(home,project_name,rupture_name,station_file)
dipfactor=4
# build subfaults parameters using strikefactor and dipfactor
nstrike=int(round((length)/strikefactor))
if (nstrike % 2 == 0):
nstrike=nstrike+1
dx_strike=(length)/nstrike # in km
num_updip=0
num_downdip=int(round(width/dipfactor))
dx_dip=width/num_downdip
print(dx_dip)
hypo=np.array([midlon,midlat,dx_dip/2.])
risetime=math.sqrt(dx_strike*dx_strike+dx_dip*dx_dip)/VR
outfile=home+'data/model_info/'+fault+'.fault'
forward.makefault(outfile,strike,dip,nstrike,dx_dip,dx_strike,hypo,num_updip,num_downdip,risetime)
# Run green functions
if make_green==1:
runslip.make_green(home,project_name,station_file,fault_name,model_name,dt,NFFT,static,
tsunami,hot_start,dk,pmin,pmax,kmax)
#Now make synthetics for source/station pairs
if make_synthetics==1:
#runslip.rupt2fault(home,project_name,rupture_name)
runslip.make_synthetics(home,project_name,station_file,fault_name,model_name,integrate,
static,tsunami,beta,hot_start,time_epi)
#Run forward comptuation or solve for inverse problem
if solve==1:
if static==0: #Forward problem (full waveforms)
forward.waveforms_matrix(home,project_name,fault_name,rupture_name,station_file,GF_list,model_name,
run_name,epicenter,time_epi,integrate,tsunami,hot_start,resample,beta,rupture_speed,
num_windows,dt,NFFT)
if static==1: #Forward problem (coseismics)
forward.coseismics(home,project_name,rupture_name,station_file)