Commit 9ee541a0 authored by Theo Steininger's avatar Theo Steininger

Fixed wiener_filter_via_hamiltonian.py

parent e0f1f873
......@@ -117,13 +117,13 @@ if __name__ == "__main__":
# Solving the problem analytically
m0 = D0.inverse_times(j)
sample_variance = Field(sh.domain, val=0. + 0j)
sample_mean = Field(sh.domain, val=0. + 0j)
sample_variance = Field(sh.domain, val=0.)
sample_mean = Field(sh.domain, val=0.)
# sampling the uncertainty map
n_samples = 1
n_samples = 10
for i in range(n_samples):
sample = sugar.generate_posterior_sample(m0, D0)
sample = fft(sugar.generate_posterior_sample(0., D0))
Please register or sign in to reply
sample_variance += sample**2
sample_mean += sample
variance = sample_variance/n_samples - (sample_mean/n_samples)
variance = (sample_variance - sample_mean**2)/n_samples
......@@ -108,7 +108,7 @@ def generate_posterior_sample(mean, covariance):
R = covariance.R
N = covariance.N
power = S.diagonal().power_analyze()**.5
power = sqrt(S.diagonal().power_analyze())
mock_signal = power.power_synthesize(real_signal=True)
noise = N.diagonal(bare=True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment