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
54c16dab
Commit
54c16dab
authored
May 20, 2020
by
Lukas Platz
Browse files
explain effect of `total_N` parameter better
parent
86a65633
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty6/library/correlated_fields.py
View file @
54c16dab
...
@@ -356,7 +356,8 @@ class CorrelatedFieldMaker:
...
@@ -356,7 +356,8 @@ class CorrelatedFieldMaker:
"""Constrution helper for hirarchical correlated field models.
"""Constrution helper for hirarchical correlated field models.
The correlated field models are parametrized by creating
The correlated field models are parametrized by creating
powerspectrum operators acting on their target subdomains
power spectrum operators ("amplitudes")
acting on their target subdomains
via calls to :func:`add_fluctuations`.
via calls to :func:`add_fluctuations`.
During creation of the :class:`CorrelatedFieldMaker` via
During creation of the :class:`CorrelatedFieldMaker` via
:func:`make`, a global offset from zero can be added to the
:func:`make`, a global offset from zero can be added to the
...
@@ -375,8 +376,18 @@ class CorrelatedFieldMaker:
...
@@ -375,8 +376,18 @@ class CorrelatedFieldMaker:
Creation of the model operator is finished by calling the method
Creation of the model operator is finished by calling the method
:func:`finalize`, which returns the configured operator.
:func:`finalize`, which returns the configured operator.
An operator representing an array of correlated field models
can be constructed by setting the `total_N` parameter of
:func:`make`. It will have an
:class:`~nifty.domains.unstructucture_domain.UnstructureDomain`
of shape `(total_N,)` prepended to its target domain and represent
`total_N` correlated fields simulataneously.
The degree of information sharing between the correlated field
models can be configured via the `dofdex` parameters
of :func:`make` and :func:`add_fluctuations`.
See the methods :func:`make`, :func:`add_fluctuations`
See the methods :func:`make`, :func:`add_fluctuations`
and :func:`finalize` for usage in
struc
tion
s
."""
and :func:`finalize` for
further
usage in
forma
tion."""
def
__init__
(
self
,
offset_mean
,
offset_fluctuations_op
,
prefix
,
total_N
):
def
__init__
(
self
,
offset_mean
,
offset_fluctuations_op
,
prefix
,
total_N
):
if
not
isinstance
(
offset_fluctuations_op
,
Operator
):
if
not
isinstance
(
offset_fluctuations_op
,
Operator
):
raise
TypeError
(
"offset_fluctuations_op needs to be an operator"
)
raise
TypeError
(
"offset_fluctuations_op needs to be an operator"
)
...
@@ -404,17 +415,19 @@ class CorrelatedFieldMaker:
...
@@ -404,17 +415,19 @@ class CorrelatedFieldMaker:
prefix : string
prefix : string
Prefix to the names of the domains of the cf operator to be made.
Prefix to the names of the domains of the cf operator to be made.
This determines the names of the operator domain.
This determines the names of the operator domain.
total_N : integer
total_N : integer
, optional
Number of
copies with of the fi
el
d
to re
turn
.
Number of
field mod
el
s
to
c
re
ate
.
If not 0, the first entry of the operators target will be an
If not 0, the first entry of the operators target will be an
:class:`~nifty.domains.unstructured_domain.UnstructuredDomain`
:class:`~nifty.domains.unstructured_domain.UnstructuredDomain`
with length `total_N`.
with length `total_N`.
dofdex : np.array of integers
dofdex : np.array of integers
, optional
An integer array specifying the zero mode models used if
An integer array specifying the zero mode models used if
total_N > 1. It needs to have length of total_N. If total_N=3 and
total_N > 1. It needs to have length of total_N. If total_N=3 and
dofdex=[0,0,1], that means that two models for the zero mode are
dofdex=[0,0,1], that means that two models for the zero mode are
instanciated; the first one is used for the first and second copy
instanciated; the first one is used for the first and second
of the model and the second is used for the third.
field model and the second is used for the third field model.
*If not specified*, use the same zero mode model for all
constructed field models.
"""
"""
if
dofdex
is
None
:
if
dofdex
is
None
:
dofdex
=
np
.
full
(
total_N
,
0
)
dofdex
=
np
.
full
(
total_N
,
0
)
...
@@ -449,8 +462,8 @@ class CorrelatedFieldMaker:
...
@@ -449,8 +462,8 @@ class CorrelatedFieldMaker:
on which they apply.
on which they apply.
The parameters `fluctuations`, `flexibility`, `asperity` and
The parameters `fluctuations`, `flexibility`, `asperity` and
`loglogavgslope` configure the power spectrum model
used on the
`loglogavgslope` configure the power spectrum model
("amplitude")
target field subdomain `target_subdomain`.
used on the
target field subdomain `target_subdomain`.
It is assembled as the sum of a power law component
It is assembled as the sum of a power law component
(linear slope in log-log power-frequency-space),
(linear slope in log-log power-frequency-space),
a smooth varying component (integrated wiener process) and
a smooth varying component (integrated wiener process) and
...
@@ -480,12 +493,14 @@ class CorrelatedFieldMaker:
...
@@ -480,12 +493,14 @@ class CorrelatedFieldMaker:
index : int
index : int
Position target_subdomain in the final total domain of the
Position target_subdomain in the final total domain of the
correlated field operator.
correlated field operator.
dofdex : np.array
dofdex : np.array
, optional
An integer array specifying the
amplitude
models used if
An integer array specifying the
power spectrum
models used if
total_N > 1. It needs to have length of total_N. If total_N=3 and
total_N > 1. It needs to have length of total_N. If total_N=3 and
dofdex=[0,0,1], that means that two models for the zero mode are
dofdex=[0,0,1], that means that two power spectrum models are
instanciated; the first one is used for the first and second copy
instanciated; the first one is used for the first and second
of the model and the second is used for the third.
field model and the second one is used for the third field model.
*If not given*, use the same power spectrum model for all
constructed field models.
harmonic_partner : :class:`~nifty6.domain.Domain`,
\
harmonic_partner : :class:`~nifty6.domain.Domain`,
\
:class:`~nifty6.domain_tuple.DomainTuple`
:class:`~nifty6.domain_tuple.DomainTuple`
In which harmonic space to define the power spectrum
In which harmonic space to define the power spectrum
...
...
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