def return_swddata(h, vs, vpvs=1.73, pars=dict(), x=None): """Return dictionary of forward modeled data based on Surf96.""" if x is None: x = np.linspace(1, 40, 20) h = np.array(h) vs = np.array(vs) mode = pars.get('mode', 1) # fundamental mode target1 = Targets.RayleighDispersionPhase(x=x, y=None) target1.moddata.plugin.set_modelparams(mode=mode) target2 = Targets.RayleighDispersionGroup(x=x, y=None) target2.moddata.plugin.set_modelparams(mode=mode) target3 = Targets.LoveDispersionPhase(x=x, y=None) target3.moddata.plugin.set_modelparams(mode=mode) target4 = Targets.LoveDispersionGroup(x=x, y=None) target4.moddata.plugin.set_modelparams(mode=mode) vp = vs * vpvs rho = vp * 0.32 + 0.77 targets = [target1, target2, target3, target4] data = {} for i, target in enumerate(targets): xmod, ymod = target.moddata.plugin.run_model( h=h, vp=vp, vs=vs, rho=rho) data[target.ref] = np.array([xmod, ymod]) logger.info('Compute SWD for %d periods, with model vp/vs %.2f.' % (x.size, vpvs)) return data
'nlays': 3, 'noise': truenoise, 'explike': explike, } print truenoise, explike # # ----------------------------------------------------------- DEFINE TARGETS # # Only pass x and y observed data to the Targets object which is matching # the data type. You can chose for SWD any combination of Rayleigh, Love, group # and phase velocity. Default is the fundamendal mode, but this can be updated. # For RF chose P or S. You can also use user defined targets or replace the # forward modeling plugin wih your own module. target1 = Targets.RayleighDispersionPhase(xsw, ysw) target2 = Targets.PReceiverFunction(xrf, yrf) target2.moddata.plugin.set_modelparams(gauss=1., water=0.01, p=6.4) # Join the targets. targets must be a list instance with all targets # you want to use for MCMC Bayesian inversion. targets = Targets.JointTarget(targets=[target1, target2]) # # --------------------------------------------------- Quick parameter update # # "priors" and "initparams" from config.ini are python dictionaries. You could # also simply define the dictionaries directly in the script, if you don't want # to use a config.ini file. Or update the dictionaries as follows, e.g. if you # have station specific values, etc. # See docs/bayhunter.pdf for explanation of parameters
'nlays': 3, 'noise': truenoise, 'explike': explike, } print truenoise, explike # # ----------------------------------------------------------- DEFINE TARGETS # # Only pass x and y observed data to the Targets object which is matching # the data type. You can chose for SWD any combination of Rayleigh, Love, group # and phase velocity. Default is the fundamendal mode, but this can be updated. # For RF chose P or S. You can also use user defined targets or replace the # forward modeling plugin wih your own module. target1 = Targets.RayleighDispersionPhase(xsw, ysw, yerr=ysw_err) target2 = Targets.PReceiverFunction(xrf, yrf) target2.moddata.plugin.set_modelparams(gauss=1., water=0.01, p=6.4) # Join the targets. targets must be a list instance with all targets # you want to use for MCMC Bayesian inversion. targets = Targets.JointTarget(targets=[target1, target2]) # # --------------------------------------------------- Quick parameter update # # "priors" and "initparams" from config.ini are python dictionaries. You could # also simply define the dictionaries directly in the script, if you don't want # to use a config.ini file. Or update the dictionaries as follows, e.g. if you # have station specific values, etc. # See docs/bayhunter.pdf for explanation of parameters