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.
<!-- -->
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)
- `DiagonalOperator` - purely diagonal matrices in a specified
basis
- `ProjectionOperator` - projections onto subsets of a specified
basis
- `FFTOperator` - conversion between spaces and their harmonic
counterparts
- (and more)
- (and more)
......@@ -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
dive into NIFTY by running one of the demonstrations, e.g.:
python demos/wiener_filter.py
python demos/wiener_filter_via_curvature.py
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:
> *"Some of the results in this publication have been derived using the
......
......@@ -23,7 +23,7 @@ from .. import dobj
import numpy as np
class PowerProjectionOperator(LinearOperator):
def __init__(self, domain, space, power_space=None):
def __init__(self, domain, space=None, power_space=None):
super(PowerProjectionOperator, self).__init__()
# Initialize domain and target
......@@ -36,8 +36,6 @@ class PowerProjectionOperator(LinearOperator):
hspace = self._domain[space]
if not hspace.harmonic:
raise ValueError("Operator acts on harmonic spaces only")
if isinstance(hspace, PowerSpace):
raise TypeError("Operator cannot act on PowerSpaces")
if power_space is None:
power_space = PowerSpace(hspace)
else:
......@@ -64,9 +62,7 @@ class PowerProjectionOperator(LinearOperator):
pindex = self._target[self._space].pindex
pindex = pindex.reshape((1, pindex.size, 1))
arr = x.val.reshape(x.domain.collapsed_shape_for_domain(self._space))
out = dobj.zeros(self._domain.collapsed_shape_for_domain(self._space),
dtype=x.dtype)
out[()] = arr[(slice(None), pindex.ravel(), slice(None))]
out = arr[(slice(None), pindex.ravel(), slice(None))]
return Field(self._domain, out.reshape(self._domain.shape))
@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