Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
e51171cc
Commit
e51171cc
authored
Nov 06, 2019
by
Philipp Frank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup refactor slope handling
parent
e3d7fc8e
Pipeline
#63052
failed with stages
in 4 minutes and 16 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+6
-2
No files found.
nifty5/library/correlated_fields.py
View file @
e51171cc
...
...
@@ -63,7 +63,7 @@ class _SlopeRemover(EndomorphicOperator):
if
mode
==
self
.
TIMES
:
res
=
x
-
x
[
-
1
]
*
self
.
_sc
else
:
res
=
np
.
empty
(
x
.
sha
pe
)
res
=
np
.
zeros
(
x
.
shape
,
dtype
=
x
.
dty
pe
)
res
+=
x
res
[
-
1
]
-=
(
x
*
self
.
_sc
).
sum
()
return
from_global_data
(
self
.
_tgt
(
mode
),
res
)
...
...
@@ -75,8 +75,11 @@ def _make_slope_Operator(smooth,loglogavgslope):
logkl
-=
logkl
[
0
]
logkl
=
np
.
insert
(
logkl
,
0
,
0
)
noslope
=
_SlopeRemover
(
tg
,
logkl
)
@
smooth
# FIXME Move to tests
consistency_check
(
_SlopeRemover
(
tg
,
logkl
))
_t
=
VdotOperator
(
from_global_data
(
tg
,
logkl
)).
adjoint
return
noslope
+
_t
@
loglogavg
slope
return
_t
@
loglogavgslope
+
no
slope
def
_log_k_lengths
(
pspace
):
return
np
.
log
(
pspace
.
k_lengths
[
1
:])
...
...
@@ -186,6 +189,7 @@ class CorrelatedFieldMaker:
smooth
=
twolog
@
(
scale
*
ducktape
(
scale
.
target
,
None
,
key
))
smoothslope
=
_make_slope_Operator
(
smooth
,
loglogavgslope
)
#smoothslope = smooth
# move to tests
assert_allclose
(
...
...
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