Commit c2697357 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

output PNGs instead of PDFs

parent 3928db97
Pipeline #22330 passed with stage
in 4 minutes and 48 seconds
......@@ -10,7 +10,7 @@ def plot_parameters(m, t, p, p_d):
t = t.val.real
p = p.val.real
p_d = p_d.val.real
ift.plotting.plot(m.real, name='map.pdf')
ift.plotting.plot(m.real, name='map.png')
class AdjointFFTResponse(ift.LinearOperator):
......@@ -88,7 +88,7 @@ if __name__ == "__main__":
data_power = ift.log(ift.power_analyze(fft(d),
binbounds=p_space.binbounds))
d_data = d.val.real
ift.plotting.plot(d.real, name="data.pdf")
ift.plotting.plot(d.real, name="data.png")
IC1 = ift.GradientNormController(verbose=True, iteration_limit=100,
tol_abs_gradnorm=0.1)
......
......@@ -66,19 +66,19 @@ if __name__ == "__main__":
# m3 = fft(me3[0].position)
# Plotting
ift.plotting.plot(mock_signal.real, name='mock_signal.pdf',
ift.plotting.plot(mock_signal.real, name='mock_signal.png',
colormap="plasma", xlabel="Pixel Index",
ylabel="Pixel Index")
logdata = np.log(ift.dobj.to_global_data(data.val.real)).reshape(signal_space.shape)
ift.plotting.plot(ift.Field(signal_space,
val=ift.dobj.from_global_data(logdata)),
name="log_of_data.pdf", colormap="plasma",
name="log_of_data.png", colormap="plasma",
xlabel="Pixel Index", ylabel="Pixel Index")
# ift.plotting.plot(m1.real,name='m_LBFGS.pdf', colormap="plasma",
# ift.plotting.plot(m1.real,name='m_LBFGS.png', colormap="plasma",
# xlabel="Pixel Index", ylabel="Pixel Index")
ift.plotting.plot(m2.real, name='m_Newton.pdf', colormap="plasma",
ift.plotting.plot(m2.real, name='m_Newton.png', colormap="plasma",
xlabel="Pixel Index", ylabel="Pixel Index")
# ift.plotting.plot(m3.real, name='m_SteepestDescent.pdf',
# ift.plotting.plot(m3.real, name='m_SteepestDescent.png',
# colormap="plasma", xlabel="Pixel Index",
# ylabel="Pixel Index")
......@@ -90,4 +90,4 @@ if __name__ == "__main__":
sm = ift.FFTSmoothingOperator(signal_space, sigma=0.02)
variance = sm(proby.diagonal.weight(-1))
ift.plotting.plot(variance, name='variance.pdf')
ift.plotting.plot(variance, name='variance.png')
......@@ -111,7 +111,7 @@ if __name__ == "__main__":
plot_space = ift.RGSpace((N_pixels_1, N_pixels_2))
sm = ift.FFTSmoothingOperator(plot_space, sigma=0.03)
ift.plotting.plot(ift.log(ift.sqrt(sm(ift.Field(plot_space, val=variance.val.real)))), name='uncertainty.pdf',zmin=0.,zmax=3.,title="Uncertainty map",colormap="Planck-like")
ift.plotting.plot(ift.Field(plot_space, val=mock_signal.val.real), name='mock_signal.pdf',colormap="Planck-like")
ift.plotting.plot(ift.Field(plot_space, val=data.val.real), name='data.pdf',colormap="Planck-like")
ift.plotting.plot(ift.Field(plot_space, val=m.val.real), name='map.pdf',colormap="Planck-like")
ift.plotting.plot(ift.log(ift.sqrt(sm(ift.Field(plot_space, val=variance.val.real)))), name='uncertainty.png',zmin=0.,zmax=3.,title="Uncertainty map",colormap="Planck-like")
ift.plotting.plot(ift.Field(plot_space, val=mock_signal.val.real), name='mock_signal.png',colormap="Planck-like")
ift.plotting.plot(ift.Field(plot_space, val=data.val.real), name='data.png',colormap="Planck-like")
ift.plotting.plot(ift.Field(plot_space, val=m.val.real), name='map.png',colormap="Planck-like")
......@@ -65,7 +65,7 @@ if __name__ == "__main__":
variance = ift.sqrt(sm(proby.diagonal.weight(-1)))
# Plotting
ift.plotting.plot(variance,name="uncertainty.pdf",xlabel='Pixel index', ylabel='Pixel index')
ift.plotting.plot(mock_signal,name="mock_signal.pdf",xlabel='Pixel index', ylabel='Pixel index')
ift.plotting.plot(ift.Field(signal_space, val=data.val),name="data.pdf",xlabel='Pixel index', ylabel='Pixel index')
ift.plotting.plot(m,name="map.pdf",xlabel='Pixel index', ylabel='Pixel index')
ift.plotting.plot(variance,name="uncertainty.png",xlabel='Pixel index', ylabel='Pixel index')
ift.plotting.plot(mock_signal,name="mock_signal.png",xlabel='Pixel index', ylabel='Pixel index')
ift.plotting.plot(ift.Field(signal_space, val=data.val),name="data.png",xlabel='Pixel index', ylabel='Pixel index')
ift.plotting.plot(m,name="map.png",xlabel='Pixel index', ylabel='Pixel index')
......@@ -80,8 +80,8 @@ if __name__ == "__main__":
sspace2 = ift.RGSpace(shape, distances=L/N_pixels/nu.m)
ift.plotting.plot(ift.Field(sspace2, mock_signal.real.val)/nu.K,
name="mock_signal.pdf")
name="mock_signal.png")
data = ift.dobj.to_global_data(data.val.real).reshape(sspace2.shape)/nu.K
data = ift.Field(sspace2, val=ift.dobj.from_global_data(data))/nu.K
ift.plotting.plot(ift.Field(sspace2, val=data), name="data.pdf")
ift.plotting.plot(ift.Field(sspace2, m_s.real.val)/nu.K, name="map.pdf")
ift.plotting.plot(ift.Field(sspace2, val=data), name="data.png")
ift.plotting.plot(ift.Field(sspace2, m_s.real.val)/nu.K, name="map.png")
......@@ -89,8 +89,8 @@ if __name__ == "__main__":
energy, convergence = minimizer(energy)
m = energy.position
D = energy.curvature
ift.plotting.plot(ss, name="signal.pdf", colormap="Planck-like")
ift.plotting.plot(fft.inverse_times(m), name="m.pdf",
ift.plotting.plot(ss, name="signal.png", colormap="Planck-like")
ift.plotting.plot(fft.inverse_times(m), name="m.png",
colormap="Planck-like")
# sampling the uncertainty map
......@@ -105,4 +105,4 @@ if __name__ == "__main__":
sample_mean /= n_samples
sample_variance /= n_samples
variance = sample_variance - sample_mean**2
ift.plotting.plot(variance, name="variance.pdf", colormap="Planck-like")
ift.plotting.plot(variance, name="variance.png", colormap="Planck-like")
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