Commit a1135cbe authored by Martin Reinecke's avatar Martin Reinecke
Browse files

cleanups

parent c1a26f29
Pipeline #19478 passed with stage
in 4 minutes and 14 seconds
...@@ -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
- `ProjectionOperator` - projections onto subsets of a specified - `FFTOperator` - conversion between spaces and their harmonic
basis counterparts
- (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
......
...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment