Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ift
NIFTy
Commits
3ac39d77
Commit
3ac39d77
authored
Mar 01, 2019
by
Lukas Platz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added Point Source model based on MfCorrelatedField
parent
e64541c3
Changes
2
Hide whitespace changes
Inline
Sidebyside
Showing
2 changed files
with
53 additions
and
1 deletion
+53
1
nifty5/__init__.py
nifty5/__init__.py
+2
1
nifty5/library/correlated_fields.py
nifty5/library/correlated_fields.py
+51
0
No files found.
nifty5/__init__.py
View file @
3ac39d77
...
...
@@ 82,7 +82,8 @@ from .library.dynamic_operator import (dynamic_operator,
from
.library.light_cone_operator
import
LightConeOperator
from
.library.wiener_filter_curvature
import
WienerFilterCurvature
from
.library.correlated_fields
import
CorrelatedField
,
MfCorrelatedField
from
.library.correlated_fields
import
(
CorrelatedField
,
MfCorrelatedField
,
MfPartiallyCorrelatedField
)
from
.library.adjust_variances
import
(
make_adjust_variances_hamiltonian
,
do_adjust_variances
)
...
...
nifty5/library/correlated_fields.py
View file @
3ac39d77
...
...
@@ 141,3 +141,54 @@ def MfCorrelatedField(target, amplitudes, name='xi'):
vol
=
reduce
(
mul
,
[
sp
.
scalar_dvol
**
0.5
for
sp
in
hsp
])
return
ht
(
vol
*
A
*
ducktape
(
hsp
,
None
,
name
))
def
MfPartiallyCorrelatedField
(
target
,
energy_amplitude
,
name
=
'xi_u'
):
"""Constructs an operator which turns white Gaussian excitation fields
into a correlated field defined on a DomainTuple with two entries.
On the first domain, a white correlation structure is assumed. On
the second domain, the correlation structures given by energy_amplitude
is used.
This operator may be used as a model for multifrequency reconstructions
with correlation structure only in the energy direction.
Parameters

target : Domain, DomainTuple or tuple of Domain
Target of the operator. Must contain exactly two spaces.
It is assumed that the second space is the energy domain.
energy_amplitude: Operator
amplitude operator for the energy correlation structure
name : string
:class:`MultiField` key for xifield.
Returns

Operator
Correlated field
Notes

In NIFTy, nonharmonic RGSpaces are by definition periodic. Therefore
the operator constructed by this method will output a correlated field
with *periodic* boundary conditions. If a nonperiodic field is needed,
one needs to combine this operator with a :class:`FieldZeroPadder` or even
two (one for the energy and one for the spatial subdomain)
"""
tgt
=
DomainTuple
.
make
(
target
)
if
len
(
tgt
)
!=
2
:
raise
ValueError
h_space
=
DomainTuple
.
make
([
dom
.
get_default_codomain
()
for
dom
in
tgt
])
ht1
=
HarmonicTransformOperator
(
h_space
,
target
=
tgt
[
0
],
space
=
0
)
ht2
=
HarmonicTransformOperator
(
ht1
.
target
,
target
=
tgt
[
1
],
space
=
1
)
ht
=
ht2
@
ht1
p_space
=
energy_amplitude
.
target
[
0
]
power_distributor
=
PowerDistributor
(
h_space
[

1
],
p_space
)
A
=
power_distributor
(
energy_amplitude
)
dd
=
ContractionOperator
(
h_space
,
0
).
adjoint
return
ht
((
dd
@
A
)
*
ducktape
(
h_space
,
None
,
name
))
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