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
13
Merge Requests
13
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
895884f3
Commit
895884f3
authored
May 19, 2020
by
Rouven Lemmerz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed init testing
parent
d1a1d8f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
24 deletions
+19
-24
nifty6/operators/block_diagonal_operator.py
nifty6/operators/block_diagonal_operator.py
+8
-2
nifty6/operators/harmonic_operators.py
nifty6/operators/harmonic_operators.py
+11
-22
No files found.
nifty6/operators/block_diagonal_operator.py
View file @
895884f3
...
...
@@ -18,7 +18,7 @@
from
..multi_domain
import
MultiDomain
from
..multi_field
import
MultiField
from
.endomorphic_operator
import
EndomorphicOperator
from
.linear_operator
import
LinearOperator
class
BlockDiagonalOperator
(
EndomorphicOperator
):
"""
...
...
@@ -38,7 +38,13 @@ class BlockDiagonalOperator(EndomorphicOperator):
self
.
_capability
=
self
.
_all_ops
for
op
in
self
.
_ops
:
if
op
is
not
None
:
self
.
_capability
&=
op
.
capability
if
isinstance
(
op
,
LinearOperator
):
if
op
.
target
is
not
op
.
domain
:
raise
TypeError
(
"domain and target mismatch"
)
self
.
_capability
&=
op
.
capability
else
:
raise
TypeError
(
"LinearOperator expected"
)
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
...
...
nifty6/operators/harmonic_operators.py
View file @
895884f3
...
...
@@ -263,7 +263,7 @@ def _unpickleSHTOperator(*args):
return
SHTOperator
(
*
args
)
class
HarmonicTransformOperator
(
LinearOperator
):
def
HarmonicTransformOperator
(
domain
,
target
=
None
,
space
=
None
):
"""Transforms between a harmonic domain and a position domain counterpart.
Built-in domain pairs are
...
...
@@ -271,7 +271,8 @@ class HarmonicTransformOperator(LinearOperator):
- an LMSpace and a HPSpace
- an LMSpace and a GLSpace
The supported operations are times() and adjoint_times().
The supported operations are times() and adjoint_times() for LMSpaces
and all for RGSpaces.
Parameters
----------
...
...
@@ -287,7 +288,7 @@ class HarmonicTransformOperator(LinearOperator):
space : int, optional
The index of the domain on which the operator should act
If None, it is set to 0 if domain contains exactly one subdomain.
domain[space] must be a harmonic domain.
domain[space] must be a harmonic domain
on the sphere or an RGSpace
.
Notes
-----
...
...
@@ -296,26 +297,14 @@ class HarmonicTransformOperator(LinearOperator):
field values are real in either space. If you require a true Fourier
transform you should use FFTOperator instead.
"""
domain
=
DomainTuple
.
make
(
domain
)
space
=
utilities
.
infer_space
(
domain
,
space
)
hspc
=
domain
[
space
]
if
isinstance
(
hspc
,
RGSpace
):
return
HartleyOperator
(
domain
,
target
,
space
)
else
:
return
SHTOperator
(
domain
,
target
,
space
)
def
__init__
(
self
,
domain
,
target
=
None
,
space
=
None
):
domain
=
DomainTuple
.
make
(
domain
)
space
=
utilities
.
infer_space
(
domain
,
space
)
hspc
=
domain
[
space
]
if
not
hspc
.
harmonic
:
raise
TypeError
(
"HarmonicTransformOperator only works on a harmonic space"
)
if
isinstance
(
hspc
,
RGSpace
):
self
.
_op
=
HartleyOperator
(
domain
,
target
,
space
)
else
:
self
.
_op
=
SHTOperator
(
domain
,
target
,
space
)
self
.
_domain
=
self
.
_op
.
domain
self
.
_target
=
self
.
_op
.
target
self
.
_capability
=
self
.
TIMES
|
self
.
ADJOINT_TIMES
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
return
self
.
_op
.
apply
(
x
,
mode
)
def
HarmonicSmoothingOperator
(
domain
,
sigma
,
space
=
None
):
...
...
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