Commit 212dae42 authored by Martin Reinecke's avatar Martin Reinecke

cosmetics

parent 9aa1461b
Pipeline #24954 canceled with stages
in 7 minutes and 58 seconds
...@@ -8,7 +8,7 @@ np.random.seed(42) ...@@ -8,7 +8,7 @@ np.random.seed(42)
if __name__ == "__main__": if __name__ == "__main__":
# Set up position space # Set up position space
s_space = ift.RGSpace([128, 128]) s_space = ift.RGSpace([128, 128])
#s_space = ift.HPSpace(32) # s_space = ift.HPSpace(32)
# Define harmonic transformation and associated harmonic space # Define harmonic transformation and associated harmonic space
h_space = s_space.get_default_codomain() h_space = s_space.get_default_codomain()
...@@ -63,7 +63,8 @@ if __name__ == "__main__": ...@@ -63,7 +63,8 @@ if __name__ == "__main__":
tol_abs_gradnorm=1e-15) tol_abs_gradnorm=1e-15)
minimizer = ift.RelaxedNewton(IC1) minimizer = ift.RelaxedNewton(IC1)
ICI = ift.GradientNormController(iteration_limit=500, tol_abs_gradnorm=1e-10) ICI = ift.GradientNormController(iteration_limit=500,
tol_abs_gradnorm=1e-10)
map_inverter = ift.ConjugateGradient(controller=ICI) map_inverter = ift.ConjugateGradient(controller=ICI)
ICI2 = ift.GradientNormController(iteration_limit=200, ICI2 = ift.GradientNormController(iteration_limit=200,
......
...@@ -53,8 +53,9 @@ if __name__ == "__main__": ...@@ -53,8 +53,9 @@ if __name__ == "__main__":
MaskOperator = ift.DiagonalOperator(mask) MaskOperator = ift.DiagonalOperator(mask)
R = ift.GeometryRemover(s_space) R = ift.GeometryRemover(s_space)
R = R*MaskOperator R = R*MaskOperator
#R = R*HT # R = R*HT
#R = R * ift.create_harmonic_smoothing_operator((harmonic_space,),0,response_sigma) # R = R * ift.create_harmonic_smoothing_operator((harmonic_space,), 0,
# response_sigma)
MeasurementOperator = R MeasurementOperator = R
d_space = MeasurementOperator.target d_space = MeasurementOperator.target
......
...@@ -71,8 +71,8 @@ if __name__ == "__main__": ...@@ -71,8 +71,8 @@ if __name__ == "__main__":
mask_2 = ift.Field(signal_space_2, ift.dobj.from_global_data(mask_2)) mask_2 = ift.Field(signal_space_2, ift.dobj.from_global_data(mask_2))
R = ift.GeometryRemover(signal_domain) R = ift.GeometryRemover(signal_domain)
R = R*ift.DiagonalOperator(mask_1, signal_domain,spaces=0) R = R*ift.DiagonalOperator(mask_1, signal_domain, spaces=0)
R = R*ift.DiagonalOperator(mask_2, signal_domain,spaces=1) R = R*ift.DiagonalOperator(mask_2, signal_domain, spaces=1)
R = R*ht R = R*ht
R = R * ift.create_harmonic_smoothing_operator(harmonic_domain, 0, R = R * ift.create_harmonic_smoothing_operator(harmonic_domain, 0,
response_sigma_1) response_sigma_1)
...@@ -101,11 +101,13 @@ if __name__ == "__main__": ...@@ -101,11 +101,13 @@ if __name__ == "__main__":
plotdict = {"colormap": "Planck-like"} plotdict = {"colormap": "Planck-like"}
plot_space = ift.RGSpace((N_pixels_1, N_pixels_2)) plot_space = ift.RGSpace((N_pixels_1, N_pixels_2))
ift.plot(ift.Field(plot_space,val=ht(mock_signal).val), name='mock_signal.png', ift.plot(ift.Field(plot_space, val=ht(mock_signal).val),
**plotdict) name='mock_signal.png', **plotdict)
ift.plot(ift.Field(plot_space,val=data.val), name='data.png', **plotdict) ift.plot(ift.Field(plot_space, val=data.val), name='data.png', **plotdict)
ift.plot(ift.Field(plot_space,val=m.val), name='map.png', **plotdict) ift.plot(ift.Field(plot_space, val=m.val), name='map.png', **plotdict)
# sampling the uncertainty map # sampling the uncertainty map
mean, variance = ift.probe_with_posterior_samples(wiener_curvature, ht, 10) mean, variance = ift.probe_with_posterior_samples(wiener_curvature, ht, 10)
ift.plot(ift.Field(plot_space, val=ift.sqrt(variance).val), name="uncertainty.png", **plotdict) ift.plot(ift.Field(plot_space, val=ift.sqrt(variance).val),
ift.plot(ift.Field(plot_space, val=(mean+m).val), name="posterior_mean.png", **plotdict) name="uncertainty.png", **plotdict)
ift.plot(ift.Field(plot_space, val=(mean+m).val),
name="posterior_mean.png", **plotdict)
...@@ -38,7 +38,8 @@ if __name__ == "__main__": ...@@ -38,7 +38,8 @@ if __name__ == "__main__":
R = ift.GeometryRemover(signal_space) R = ift.GeometryRemover(signal_space)
R = R*ift.DiagonalOperator(mask) R = R*ift.DiagonalOperator(mask)
R = R*ht R = R*ht
R = R * ift.create_harmonic_smoothing_operator((harmonic_space,),0,response_sigma) R = R * ift.create_harmonic_smoothing_operator((harmonic_space,), 0,
response_sigma)
data_domain = R.target[0] data_domain = R.target[0]
noiseless_data = R(mock_signal) noiseless_data = R(mock_signal)
......
...@@ -84,5 +84,5 @@ if __name__ == "__main__": ...@@ -84,5 +84,5 @@ if __name__ == "__main__":
# try to do the same with diagonal probing # try to do the same with diagonal probing
variance = ift.probe_diagonal(ht*curv.inverse*ht.adjoint, 100) variance = ift.probe_diagonal(ht*curv.inverse*ht.adjoint, 100)
#sm = ift.FFTSmoothingOperator(s_space, sigma=0.015) # sm = ift.FFTSmoothingOperator(s_space, sigma=0.015)
ift.plot(variance, name="posterior_variance2.png", **plotdict) ift.plot(variance, name="posterior_variance2.png", **plotdict)
...@@ -73,4 +73,4 @@ ...@@ -73,4 +73,4 @@
Reference Reference
--------- ---------
{%- endif %} {%- endif %}
\ No newline at end of file
...@@ -100,4 +100,4 @@ ...@@ -100,4 +100,4 @@
Reference Reference
--------- ---------
{%- endif %} {%- endif %}
\ No newline at end of file
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