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
64cdbfaa
Commit
64cdbfaa
authored
Jan 15, 2018
by
Martin Reinecke
Browse files
Merge branch 'fun_with_operators' into byebye_volume_factors
parents
2e77efe1
bbfb9c1b
Pipeline
#23706
failed with stage
in 4 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/nonlinear_critical_filter.py
View file @
64cdbfaa
...
...
@@ -5,12 +5,14 @@ np.random.seed(42)
def
adjust_zero_mode
(
m0
,
t0
):
mtmp
=
ift
.
dobj
.
to_global_data
(
m0
.
val
)
zero_position
=
len
(
m0
.
shape
)
*
(
0
,)
zero_mode
=
m0
.
val
[
zero_position
]
m0
.
val
[
zero_position
]
=
zero_mode
/
abs
(
zero_mode
)
t0
.
val
[
0
]
+=
2
*
np
.
log
(
abs
(
zero_mode
))
return
m0
,
t0
zero_mode
=
mtmp
[
zero_position
]
mtmp
[
zero_position
]
=
zero_mode
/
abs
(
zero_mode
)
ttmp
=
ift
.
dobj
.
to_global_data
(
t0
.
val
)
ttmp
[
0
]
+=
2
*
np
.
log
(
abs
(
zero_mode
))
return
(
ift
.
Field
(
m0
.
domain
,
ift
.
dobj
.
from_global_data
(
mtmp
)),
ift
.
Field
(
t0
.
domain
,
ift
.
dobj
.
from_global_data
(
ttmp
)))
if
__name__
==
"__main__"
:
...
...
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