Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
c2697357
Commit
c2697357
authored
Nov 29, 2017
by
Martin Reinecke
Browse files
output PNGs instead of PDFs
parent
3928db97
Pipeline
#22330
passed with stage
in 4 minutes and 48 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/critical_filtering.py
View file @
c2697357
...
...
@@ -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.p
df
'
)
ift
.
plotting
.
plot
(
m
.
real
,
name
=
'map.p
ng
'
)
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.p
df
"
)
ift
.
plotting
.
plot
(
d
.
real
,
name
=
"data.p
ng
"
)
IC1
=
ift
.
GradientNormController
(
verbose
=
True
,
iteration_limit
=
100
,
tol_abs_gradnorm
=
0.1
)
...
...
demos/log_normal_wiener_filter.py
View file @
c2697357
...
...
@@ -66,19 +66,19 @@ if __name__ == "__main__":
# m3 = fft(me3[0].position)
# Plotting
ift
.
plotting
.
plot
(
mock_signal
.
real
,
name
=
'mock_signal.p
df
'
,
ift
.
plotting
.
plot
(
mock_signal
.
real
,
name
=
'mock_signal.p
ng
'
,
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.p
df
"
,
colormap
=
"plasma"
,
name
=
"log_of_data.p
ng
"
,
colormap
=
"plasma"
,
xlabel
=
"Pixel Index"
,
ylabel
=
"Pixel Index"
)
# ift.plotting.plot(m1.real,name='m_LBFGS.p
df
', colormap="plasma",
# ift.plotting.plot(m1.real,name='m_LBFGS.p
ng
', colormap="plasma",
# xlabel="Pixel Index", ylabel="Pixel Index")
ift
.
plotting
.
plot
(
m2
.
real
,
name
=
'm_Newton.p
df
'
,
colormap
=
"plasma"
,
ift
.
plotting
.
plot
(
m2
.
real
,
name
=
'm_Newton.p
ng
'
,
colormap
=
"plasma"
,
xlabel
=
"Pixel Index"
,
ylabel
=
"Pixel Index"
)
# ift.plotting.plot(m3.real, name='m_SteepestDescent.p
df
',
# ift.plotting.plot(m3.real, name='m_SteepestDescent.p
ng
',
# 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.p
df
'
)
ift
.
plotting
.
plot
(
variance
,
name
=
'variance.p
ng
'
)
demos/paper_demos/cartesian_wiener_filter.py
View file @
c2697357
...
...
@@ -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.p
df
'
,
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.p
df
'
,
colormap
=
"Planck-like"
)
ift
.
plotting
.
plot
(
ift
.
Field
(
plot_space
,
val
=
data
.
val
.
real
),
name
=
'data.p
df
'
,
colormap
=
"Planck-like"
)
ift
.
plotting
.
plot
(
ift
.
Field
(
plot_space
,
val
=
m
.
val
.
real
),
name
=
'map.p
df
'
,
colormap
=
"Planck-like"
)
ift
.
plotting
.
plot
(
ift
.
log
(
ift
.
sqrt
(
sm
(
ift
.
Field
(
plot_space
,
val
=
variance
.
val
.
real
)))),
name
=
'uncertainty.p
ng
'
,
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.p
ng
'
,
colormap
=
"Planck-like"
)
ift
.
plotting
.
plot
(
ift
.
Field
(
plot_space
,
val
=
data
.
val
.
real
),
name
=
'data.p
ng
'
,
colormap
=
"Planck-like"
)
ift
.
plotting
.
plot
(
ift
.
Field
(
plot_space
,
val
=
m
.
val
.
real
),
name
=
'map.p
ng
'
,
colormap
=
"Planck-like"
)
demos/paper_demos/wiener_filter.py
View file @
c2697357
...
...
@@ -65,7 +65,7 @@ if __name__ == "__main__":
variance
=
ift
.
sqrt
(
sm
(
proby
.
diagonal
.
weight
(
-
1
)))
# Plotting
ift
.
plotting
.
plot
(
variance
,
name
=
"uncertainty.p
df
"
,
xlabel
=
'Pixel index'
,
ylabel
=
'Pixel index'
)
ift
.
plotting
.
plot
(
mock_signal
,
name
=
"mock_signal.p
df
"
,
xlabel
=
'Pixel index'
,
ylabel
=
'Pixel index'
)
ift
.
plotting
.
plot
(
ift
.
Field
(
signal_space
,
val
=
data
.
val
),
name
=
"data.p
df
"
,
xlabel
=
'Pixel index'
,
ylabel
=
'Pixel index'
)
ift
.
plotting
.
plot
(
m
,
name
=
"map.p
df
"
,
xlabel
=
'Pixel index'
,
ylabel
=
'Pixel index'
)
ift
.
plotting
.
plot
(
variance
,
name
=
"uncertainty.p
ng
"
,
xlabel
=
'Pixel index'
,
ylabel
=
'Pixel index'
)
ift
.
plotting
.
plot
(
mock_signal
,
name
=
"mock_signal.p
ng
"
,
xlabel
=
'Pixel index'
,
ylabel
=
'Pixel index'
)
ift
.
plotting
.
plot
(
ift
.
Field
(
signal_space
,
val
=
data
.
val
),
name
=
"data.p
ng
"
,
xlabel
=
'Pixel index'
,
ylabel
=
'Pixel index'
)
ift
.
plotting
.
plot
(
m
,
name
=
"map.p
ng
"
,
xlabel
=
'Pixel index'
,
ylabel
=
'Pixel index'
)
demos/wiener_filter_via_curvature.py
View file @
c2697357
...
...
@@ -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.p
df
"
)
name
=
"mock_signal.p
ng
"
)
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.p
df
"
)
ift
.
plotting
.
plot
(
ift
.
Field
(
sspace2
,
m_s
.
real
.
val
)
/
nu
.
K
,
name
=
"map.p
df
"
)
ift
.
plotting
.
plot
(
ift
.
Field
(
sspace2
,
val
=
data
),
name
=
"data.p
ng
"
)
ift
.
plotting
.
plot
(
ift
.
Field
(
sspace2
,
m_s
.
real
.
val
)
/
nu
.
K
,
name
=
"map.p
ng
"
)
demos/wiener_filter_via_hamiltonian.py
View file @
c2697357
...
...
@@ -89,8 +89,8 @@ if __name__ == "__main__":
energy
,
convergence
=
minimizer
(
energy
)
m
=
energy
.
position
D
=
energy
.
curvature
ift
.
plotting
.
plot
(
ss
,
name
=
"signal.p
df
"
,
colormap
=
"Planck-like"
)
ift
.
plotting
.
plot
(
fft
.
inverse_times
(
m
),
name
=
"m.p
df
"
,
ift
.
plotting
.
plot
(
ss
,
name
=
"signal.p
ng
"
,
colormap
=
"Planck-like"
)
ift
.
plotting
.
plot
(
fft
.
inverse_times
(
m
),
name
=
"m.p
ng
"
,
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.p
df
"
,
colormap
=
"Planck-like"
)
ift
.
plotting
.
plot
(
variance
,
name
=
"variance.p
ng
"
,
colormap
=
"Planck-like"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment