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
70501984
Commit
70501984
authored
Nov 12, 2019
by
Philipp Arras
Browse files
Renaming
parent
28e9d567
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/library/correlated_fields.py
View file @
70501984
...
...
@@ -73,7 +73,7 @@ def _log_k_lengths(pspace):
return
np
.
log
(
pspace
.
k_lengths
[
1
:])
def
_
logkl
(
power_space
):
def
_
relative_log_k_lengths
(
power_space
):
"""Log-distance to first bin
logkl.shape==power_space.shape, logkl[0]=logkl[1]=0"""
power_space
=
DomainTuple
.
make
(
power_space
)
...
...
@@ -98,7 +98,7 @@ class _SlopeRemover(EndomorphicOperator):
self
.
_domain
=
makeDomain
(
domain
)
assert
len
(
self
.
_domain
)
==
1
assert
isinstance
(
self
.
_domain
[
0
],
PowerSpace
)
logkl
=
_
logkl
(
self
.
_domain
)
logkl
=
_
relative_log_k_lengths
(
self
.
_domain
)
self
.
_sc
=
logkl
/
float
(
logkl
[
-
1
])
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
...
...
@@ -131,8 +131,7 @@ class _TwoLogIntegrations(LinearOperator):
if
mode
==
self
.
TIMES
:
x
=
x
.
to_global_data
()
res
=
np
.
empty
(
self
.
_target
.
shape
)
res
[
0
]
=
0
res
[
1
]
=
0
res
[
0
]
=
res
[
1
]
=
0
res
[
2
:]
=
np
.
cumsum
(
x
[
1
])
res
[
2
:]
=
(
res
[
2
:]
+
res
[
1
:
-
1
])
/
2
*
self
.
_log_vol
+
x
[
0
]
res
[
2
:]
=
np
.
cumsum
(
res
[
2
:])
...
...
@@ -215,7 +214,7 @@ class _Amplitude(Operator):
foo
[
0
]
=
_log_vol
(
target
)
**
2
/
12.
shift
=
from_global_data
(
dom
,
foo
)
t
=
from_global_data
(
target
,
_
logkl
(
target
))
t
=
from_global_data
(
target
,
_
relative_log_k_lengths
(
target
))
foo
,
bar
=
2
*
(
np
.
zeros
(
target
.
shape
),)
foo
[
1
:]
=
bar
[
0
]
=
totvol
...
...
Write
Preview
Supports
Markdown
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