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
2b5d58fd
Commit
2b5d58fd
authored
Jun 28, 2018
by
Philipp Arras
Browse files
Python3 compatibility
parent
bf1d9f6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
demos/getting_started_1.py
View file @
2b5d58fd
...
...
@@ -7,14 +7,16 @@ def make_chess_mask():
for
i
in
range
(
4
):
for
j
in
range
(
4
):
if
(
i
+
j
)
%
2
==
0
:
mask
[
i
*
128
/
4
:(
i
+
1
)
*
128
/
4
,
j
*
128
/
4
:(
j
+
1
)
*
128
/
4
]
=
0
mask
[
i
*
128
/
/
4
:(
i
+
1
)
*
128
/
/
4
,
j
*
128
/
/
4
:(
j
+
1
)
*
128
/
/
4
]
=
0
return
mask
def
make_random_mask
():
mask
=
ift
.
from_random
(
'pm1'
,
position_space
)
mask
=
(
mask
+
1
)
/
2
return
mask
.
val
if
__name__
==
'__main__'
:
## describtion of the tutorial ###
...
...
@@ -24,13 +26,13 @@ if __name__ == '__main__':
# position_space = ift.RGSpace([1024])
# mask = np.ones(position_space.shape)
#
#
Two dimensional regular grid with chess mask
#
position_space = ift.RGSpace([128,128])
#
mask = make_chess_mask()
# Two dimensional regular grid with chess mask
position_space
=
ift
.
RGSpace
([
128
,
128
])
mask
=
make_chess_mask
()
# # Sphere with half of its locations randomly masked
position_space
=
ift
.
HPSpace
(
128
)
mask
=
make_random_mask
()
#
position_space = ift.HPSpace(128)
#
mask = make_random_mask()
# set up corresponding harmonic transform and space
harmonic_space
=
position_space
.
get_default_codomain
()
...
...
@@ -57,7 +59,6 @@ if __name__ == '__main__':
noise
=
5.
N
=
ift
.
ScalingOperator
(
noise
,
data_space
)
# creating mock data
MOCK_SIGNAL
=
S
.
draw_sample
()
MOCK_NOISE
=
N
.
draw_sample
()
...
...
@@ -75,7 +76,3 @@ if __name__ == '__main__':
##PLOTTING
#Truth, data, reconstruction, residuals
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