Commit 125a568b authored by Lukas Platz's avatar Lukas Platz

cosmetics

parent 4d3fddef
Pipeline #53349 passed with stages
in 6 minutes and 52 seconds
......@@ -35,17 +35,17 @@ for N1, N2 in [(i, j) for i in Ns for j in Ns]:
# Shared configuration parameters of Amplitude Models
conf_dict = {
'n_pix': 64, # 64 spectral bins
'n_pix': 64, # 64 spectral bins
# Spectral smoothness (affects Gaussian process part)
'a': 3, # relatively high variance of spectral curvature
'k0': 0.4, # quefrency mode below which cepstrum flattens
# Spectral smoothness (affects Gaussian process part)
'a': 3, # relatively high variance of spectral curvature
'k0': 0.4, # quefrency mode below which cepstrum flattens
# Power-law part of spectrum
'sv': 1., # Prior standard deviation of -||-
'im': 0., # Expected y-intercept of power law
'iv': 0. # Prior standard deviation of -||-
}
# Power-law part of spectrum
'sv': 1., # Prior standard deviation of -||-
'im': 0., # Expected y-intercept of power law
'iv': 0. # Prior standard deviation of -||-
}
amp_p = ift.SLAmplitude(**conf_dict,
target=ift.PowerSpace(harmonic_space_p),
......@@ -59,7 +59,8 @@ for N1, N2 in [(i, j) for i in Ns for j in Ns]:
# Define sky operator
# za=4, zq=5 leads to an amplitude median of one
log_diffuse = ift.MultiCorrelatedField(sky_target, [amp_p, amp_e], va=5.,
log_diffuse = ift.MultiCorrelatedField(sky_target, [amp_p, amp_e],
va=5.,
vq=1.)
N_stds = 10**3 * max(10, int(Ns.max() / np.sqrt(N1 * N2)))
......
......@@ -115,7 +115,10 @@ if __name__ == '__main__':
elif mode == 0:
amplitudes = [None, amp_e]
log_diffuse = ift.MultiCorrelatedField(sky_target, amplitudes, va=5., vq=1.)
log_diffuse = ift.MultiCorrelatedField(sky_target,
amplitudes,
va=5.,
vq=1.)
sky = log_diffuse.exp()
M = ift.DiagonalOperator(exposure)
......@@ -171,8 +174,10 @@ if __name__ == '__main__':
for p, n in amplitude_specs:
plot = ift.Plot()
plot.add([ift.power_analyze(p.force(H.position)),
ift.power_analyze(p.force(mock_position))],
plot.add([
ift.power_analyze(p.force(H.position)),
ift.power_analyze(p.force(mock_position))
],
linewidth=[1., 3.],
label=['Reconstruction', 'Ground Truth'],
title=f"Posterior {n} spectrum")
......
......@@ -42,8 +42,7 @@ plt.close()
for cname, xname in [('N1', 'N2'), ('N2', 'N1')]:
for n in N:
idx = df[cname] == n
plt.plot(df[xname][idx], df['std'][idx],
label=f"{cname} = {n}")
plt.plot(df[xname][idx], df['std'][idx], label=f"{cname} = {n}")
plt.xscale('log')
plt.xlabel(xname)
plt.ylabel('std')
......
......@@ -78,7 +78,7 @@ def CorrelatedField(target, amplitude_operator, name='xi', codomain=None):
# will scale with a square root. `vol` cancels this effect such that the
# same power spectrum can be used for the spaces with the same volume,
# different resolutions and the same object in them.
return ht(vol*A*ducktape(h_space, None, name))
return ht(vol * A * ducktape(h_space, None, name))
def MultiCorrelatedField(target, amplitudes, va, vq, name='xi'):
......
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