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
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
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
f7cf5ded
Commit
f7cf5ded
authored
Jan 14, 2019
by
Philipp Arras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics and fixups
parent
9c813309
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
18 deletions
+10
-18
nifty5/domains/log_rg_space.py
nifty5/domains/log_rg_space.py
+1
-2
nifty5/library/amplitude_operator.py
nifty5/library/amplitude_operator.py
+5
-5
nifty5/operators/slope_operator.py
nifty5/operators/slope_operator.py
+4
-11
No files found.
nifty5/domains/log_rg_space.py
View file @
f7cf5ded
...
...
@@ -16,11 +16,10 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
from
functools
import
reduce
import
numpy
as
np
from
..
import
dobj
from
..field
import
Field
from
..sugar
import
exp
from
.structured_domain
import
StructuredDomain
...
...
nifty5/library/amplitude_operator.py
View file @
f7cf5ded
...
...
@@ -32,16 +32,16 @@ def _create_cepstrum_amplitude_field(domain, cepstrum):
q_array
=
domain
.
get_k_array
()
# Fill all non-zero modes
no_zero_modes
=
(
slice
(
1
,
None
),
)
*
dim
ks
=
q_array
[(
slice
(
None
),
)
+
no_zero_modes
]
no_zero_modes
=
(
slice
(
1
,
None
),)
*
dim
ks
=
q_array
[(
slice
(
None
),)
+
no_zero_modes
]
cepstrum_field
=
np
.
zeros
(
shape
)
cepstrum_field
[
no_zero_modes
]
=
cepstrum
(
ks
)
# Fill zero-mode subspaces
for
i
in
range
(
dim
):
fst_dims
=
(
slice
(
None
),
)
*
i
sl
=
fst_dims
+
(
slice
(
1
,
None
),
)
sl2
=
fst_dims
+
(
0
,
)
fst_dims
=
(
slice
(
None
),)
*
i
sl
=
fst_dims
+
(
slice
(
1
,
None
),)
sl2
=
fst_dims
+
(
0
,)
cepstrum_field
[
sl2
]
=
np
.
sum
(
cepstrum_field
[
sl
],
axis
=
i
)
return
Field
.
from_global_data
(
domain
,
cepstrum_field
)
...
...
nifty5/operators/slope_operator.py
View file @
f7cf5ded
...
...
@@ -33,20 +33,13 @@ class SlopeOperator(LinearOperator):
Parameters
----------
domain : domain or DomainTuple, shape=(2,)
It has to be an UnstructuredDomain.
The domain of the slope mean and the y-intercept mean.
target : domain or DomainTuple
The output domain has to a LogRGSpace
sigmas : np.array, shape=(2,)
The slope variance and the y-intercept variance.
target : LogRGSpace
The target of the operator which needs to be one-dimensional.
"""
def
__init__
(
self
,
target
):
if
not
isinstance
(
target
,
LogRGSpace
):
raise
TypeError
if
len
(
target
.
shape
)
!=
1
:
raise
ValueError
(
"Slope Operator only works for ndim == 1"
)
if
not
isinstance
(
target
,
LogRGSpace
)
or
not
len
(
target
.
shape
)
!=
1
:
raise
TypeError
(
"Slope Operator only works for ndim == 1"
)
self
.
_domain
=
DomainTuple
.
make
(
UnstructuredDomain
((
2
,)))
self
.
_target
=
DomainTuple
.
make
(
target
)
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
...
...
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