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
780be86e
Commit
780be86e
authored
May 10, 2017
by
Theo Steininger
Browse files
Renamed real_signal to decompose_power.
parent
e9f7688b
Pipeline
#12219
passed with stages
in 12 minutes and 15 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/field.py
View file @
780be86e
...
...
@@ -168,7 +168,7 @@ class Field(Loggable, Versionable, object):
# ---Powerspectral methods---
def
power_analyze
(
self
,
spaces
=
None
,
log
=
False
,
nbin
=
None
,
binbounds
=
None
,
real_signal
=
False
):
decompose_power
=
False
):
# check if all spaces in `self.domain` are either harmonic or
# power_space instances
for
sp
in
self
.
domain
:
...
...
@@ -219,7 +219,7 @@ class Field(Loggable, Versionable, object):
pindex
=
power_domain
.
pindex
rho
=
power_domain
.
rho
if
real_signal
:
if
decompose_power
:
hermitian_part
,
anti_hermitian_part
=
\
harmonic_domain
.
hermitian_decomposition
(
self
.
val
,
...
...
@@ -245,7 +245,7 @@ class Field(Loggable, Versionable, object):
result_domain
=
list
(
self
.
domain
)
result_domain
[
space_index
]
=
power_domain
if
real_signal
:
if
decompose_power
:
result_dtype
=
np
.
complex
else
:
result_dtype
=
np
.
float
...
...
@@ -303,8 +303,8 @@ class Field(Loggable, Versionable, object):
return
result_obj
def
power_synthesize
(
self
,
spaces
=
None
,
real_power
=
True
,
real_signal
=
False
,
mean
=
None
,
std
=
None
):
def
power_synthesize
(
self
,
spaces
=
None
,
real_power
=
True
,
decompose_power
=
False
,
mean
=
None
,
std
=
None
):
# check if the `spaces` input is valid
spaces
=
utilities
.
cast_axis_to_tuple
(
spaces
,
len
(
self
.
domain
))
...
...
@@ -363,7 +363,7 @@ class Field(Loggable, Versionable, object):
lambda
x
:
x
*
local_rescaler
.
imag
,
inplace
=
True
)
if
real_signal
:
if
decompose_power
:
for
power_space_index
in
spaces
:
harmonic_domain
=
result_domain
[
power_space_index
]
result_val_list
=
[
harmonic_domain
.
hermitian_decomposition
(
...
...
nifty/operators/composed_operator/composed_operator.py
View file @
780be86e
...
...
@@ -21,7 +21,9 @@ from nifty.operators.linear_operator import LinearOperator
class
ComposedOperator
(
LinearOperator
):
# ---Overwritten properties and methods---
def
__init__
(
self
,
operators
):
def
__init__
(
self
,
operators
,
default_spaces
=
None
):
super
(
ComposedOperator
,
self
).
__init__
(
default_spaces
)
self
.
_operator_store
=
()
for
op
in
operators
:
if
not
isinstance
(
op
,
LinearOperator
):
...
...
nifty/sugar.py
View file @
780be86e
...
...
@@ -34,10 +34,10 @@ def create_power_operator(domain, power_spectrum, dtype=None,
distribution_strategy
=
distribution_strategy
)
fp
=
Field
(
power_domain
,
val
=
power_spectrum
,
dtype
=
dtype
,
val
=
power_spectrum
,
dtype
=
dtype
,
distribution_strategy
=
distribution_strategy
)
f
=
fp
.
power_synthesize
(
mean
=
1
,
std
=
0
,
real_signal
=
False
)
f
=
fp
.
power_synthesize
(
mean
=
1
,
std
=
0
,
decompose_power
=
False
)
power_operator
=
DiagonalOperator
(
domain
,
diagonal
=
f
,
bare
=
True
)
...
...
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