Beispiel #1
0
#=================================================
if opts.verbose:
	print "\n----------------------------------\n"
	print "building hPrior"
	if opts.time:
		to = time.time()

pareto_a=config.getfloat("hPrior","pareto_a")
n_gaus_per_dec=config.getfloat("hPrior","n_gaus_per_dec")
log10_min=np.log10(config.getfloat("hPrior","min"))
log10_max=np.log10(config.getfloat("hPrior","max"))
n_gaus = max(1, int(round((log10_max-log10_min)*n_gaus_per_dec,0)))

variances=np.logspace(log10_min, log10_max, n_gaus)**2

pareto_means, pareto_covariance, pareto_amps = priors.pareto(pareto_a, analysis_n_freqs, n_pol, variances)

hprior = priors.hPrior(analysis_freqs, pareto_means, pareto_covariance, amplitudes=pareto_amps, n_gaus=n_gaus, n_pol=n_pol)

if opts.time:
	print "\t", time.time()-to

#=================================================
### build posterior_obj
#=================================================
if opts.verbose: 
	print "\n----------------------------------\n"
	print "building posterior"

posterior = posteriors.Posterior(network=network, hPrior=hprior, angPrior=angprior, seglen=seglen)
	pickle.dump(waveform_args, file_obj)
	pickle.dump(theta_inj, file_obj)
	pickle.dump(phi_inj, file_obj)
	pickle.dump(psi_inj, file_obj)
	pickle.dump(hrss_inj, file_obj)
	pickle.dump(snrs_inj, file_obj)
	file_obj.close()

#=================================================
# PRIORS
#=================================================
import priors

print "hPrior"
to=time.time()
pareto_means, pareto_covariance, pareto_amps = priors.pareto(a, n_freqs, n_pol, variances)
hprior_obj = priors.hPrior(freqs, pareto_means, pareto_covariance, amplitudes=pareto_amps, n_gaus=n_gaus, n_pol=n_pol, byhand=True)
print "\t", time.time()-to

print "angPrior"
to=time.time()
angprior_obj = priors.angPrior(nside_exp, prior_type=prior_type)
print "\t", time.time()-to

#=================================================
# POSTERIORS
#=================================================
import posteriors

print "posterior.__init__()"
to=time.time()