Skip to content
GitLab
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
b95de987
Commit
b95de987
authored
Jul 11, 2018
by
Philipp Arras
Browse files
Prettier plotting for demo1
parent
ed9ffd3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
demos/getting_started_1.py
View file @
b95de987
...
...
@@ -17,6 +17,12 @@ def make_random_mask():
return
mask
.
to_global_data
()
def
mask_to_nan
(
mask
,
field
):
masked_data
=
field
.
local_data
.
copy
()
masked_data
[
mask
.
local_data
==
0
]
=
np
.
nan
return
ift
.
from_local_data
(
field
.
domain
,
masked_data
)
if
__name__
==
'__main__'
:
np
.
random
.
seed
(
42
)
# FIXME description of the tutorial
...
...
@@ -86,6 +92,8 @@ if __name__ == '__main__':
name
=
'getting_started_1.png'
)
else
:
ift
.
plot
(
HT
(
MOCK_SIGNAL
),
title
=
'Mock Signal'
,
name
=
'mock_signal.png'
)
ift
.
plot
((
GR
*
Mask
).
adjoint
(
data
),
title
=
'Data'
,
name
=
'data.png'
)
ift
.
plot
(
mask_to_nan
(
mask
,
(
GR
*
Mask
).
adjoint
(
data
)),
title
=
'Data'
,
name
=
'data.png'
)
ift
.
plot
(
HT
(
m
),
title
=
'Reconstruction'
,
name
=
'reconstruction.png'
)
ift
.
plot
(
HT
(
m
-
MOCK_SIGNAL
),
name
=
'residuals.png'
)
ift
.
plot
(
mask_to_nan
(
mask
,
HT
(
m
-
MOCK_SIGNAL
)),
name
=
'residuals.png'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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