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
a1135cbe
Commit
a1135cbe
authored
Oct 10, 2017
by
Martin Reinecke
Browse files
cleanups
parent
c1a26f29
Pipeline
#19478
passed with stage
in 4 minutes and 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
a1135cbe
...
@@ -58,13 +58,13 @@ that apply to fields.
...
@@ -58,13 +58,13 @@ that apply to fields.
<!-- -->
<!-- -->
Field.conjugate Field.dim Field.norm
Field.conjugate Field.dim Field.norm
Field.vdot
Field.set_val
Field.weight
Field.vdot Field.weight
-
[
Operators
](
http://www.mpa-garching.mpg.de/ift/nifty/operator.html
)
-
[
Operators
](
http://www.mpa-garching.mpg.de/ift/nifty/operator.html
)
-
`DiagonalOperator`
- purely diagonal matrices in a specified
-
`DiagonalOperator`
- purely diagonal matrices in a specified
basis
basis
-
`
Projection
Operator`
-
projections onto subsets of a specified
-
`
FFT
Operator`
-
conversion between spaces and their harmonic
basi
s
counterpart
s
-
(and more)
-
(and more)
-
(and more)
-
(and more)
...
@@ -110,12 +110,12 @@ For a quick start, you can browse through the [informal
...
@@ -110,12 +110,12 @@ For a quick start, you can browse through the [informal
introduction
](
http://www.mpa-garching.mpg.de/ift/nifty/start.html
)
or
introduction
](
http://www.mpa-garching.mpg.de/ift/nifty/start.html
)
or
dive into NIFTY by running one of the demonstrations, e.g.:
dive into NIFTY by running one of the demonstrations, e.g.:
python demos/wiener_filter.py
python demos/wiener_filter
_via_curvature
.py
Acknowledgement
Acknowledgement
---------------
---------------
Please
,
acknowledge the use of NIFTY in your publication(s) by using a
Please acknowledge the use of NIFTY in your publication(s) by using a
phrase such as the following:
phrase such as the following:
> *"Some of the results in this publication have been derived using the
> *"Some of the results in this publication have been derived using the
...
...
nifty/operators/power_projection_operator.py
View file @
a1135cbe
...
@@ -23,7 +23,7 @@ from .. import dobj
...
@@ -23,7 +23,7 @@ from .. import dobj
import
numpy
as
np
import
numpy
as
np
class
PowerProjectionOperator
(
LinearOperator
):
class
PowerProjectionOperator
(
LinearOperator
):
def
__init__
(
self
,
domain
,
space
,
power_space
=
None
):
def
__init__
(
self
,
domain
,
space
=
None
,
power_space
=
None
):
super
(
PowerProjectionOperator
,
self
).
__init__
()
super
(
PowerProjectionOperator
,
self
).
__init__
()
# Initialize domain and target
# Initialize domain and target
...
@@ -36,8 +36,6 @@ class PowerProjectionOperator(LinearOperator):
...
@@ -36,8 +36,6 @@ class PowerProjectionOperator(LinearOperator):
hspace
=
self
.
_domain
[
space
]
hspace
=
self
.
_domain
[
space
]
if
not
hspace
.
harmonic
:
if
not
hspace
.
harmonic
:
raise
ValueError
(
"Operator acts on harmonic spaces only"
)
raise
ValueError
(
"Operator acts on harmonic spaces only"
)
if
isinstance
(
hspace
,
PowerSpace
):
raise
TypeError
(
"Operator cannot act on PowerSpaces"
)
if
power_space
is
None
:
if
power_space
is
None
:
power_space
=
PowerSpace
(
hspace
)
power_space
=
PowerSpace
(
hspace
)
else
:
else
:
...
@@ -64,9 +62,7 @@ class PowerProjectionOperator(LinearOperator):
...
@@ -64,9 +62,7 @@ class PowerProjectionOperator(LinearOperator):
pindex
=
self
.
_target
[
self
.
_space
].
pindex
pindex
=
self
.
_target
[
self
.
_space
].
pindex
pindex
=
pindex
.
reshape
((
1
,
pindex
.
size
,
1
))
pindex
=
pindex
.
reshape
((
1
,
pindex
.
size
,
1
))
arr
=
x
.
val
.
reshape
(
x
.
domain
.
collapsed_shape_for_domain
(
self
.
_space
))
arr
=
x
.
val
.
reshape
(
x
.
domain
.
collapsed_shape_for_domain
(
self
.
_space
))
out
=
dobj
.
zeros
(
self
.
_domain
.
collapsed_shape_for_domain
(
self
.
_space
),
out
=
arr
[(
slice
(
None
),
pindex
.
ravel
(),
slice
(
None
))]
dtype
=
x
.
dtype
)
out
[()]
=
arr
[(
slice
(
None
),
pindex
.
ravel
(),
slice
(
None
))]
return
Field
(
self
.
_domain
,
out
.
reshape
(
self
.
_domain
.
shape
))
return
Field
(
self
.
_domain
,
out
.
reshape
(
self
.
_domain
.
shape
))
@
property
@
property
...
...
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