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
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
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
3c27689a
Commit
3c27689a
authored
May 19, 2020
by
Lukas Platz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cf: rename position_spaces -> target_subdomains
parent
bd25233d
Pipeline
#75196
passed with stages
in 26 minutes and 9 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
nifty6/library/correlated_fields.py
nifty6/library/correlated_fields.py
+17
-17
No files found.
nifty6/library/correlated_fields.py
View file @
3c27689a
...
...
@@ -370,7 +370,7 @@ class CorrelatedFieldMaker:
The target of the constructed operator will be a
:class:`~nifty6.domain_tuple.DomainTuple`
containing the `
position_space
s` of the added fluctuations in the
containing the `
target_subdomain
s` of the added fluctuations in the
order of the `add_fluctuations` calls.
Creation of the model operator is finished by calling the method
...
...
@@ -382,7 +382,7 @@ class CorrelatedFieldMaker:
if
not
isinstance
(
offset_fluctuations_op
,
Operator
):
raise
TypeError
(
"offset_fluctuations_op needs to be an operator"
)
self
.
_a
=
[]
self
.
_
position_space
s
=
[]
self
.
_
target_subdomain
s
=
[]
self
.
_offset_mean
=
offset_mean
self
.
_azm
=
offset_fluctuations_op
...
...
@@ -428,7 +428,7 @@ class CorrelatedFieldMaker:
return
CorrelatedFieldMaker
(
offset_mean
,
zm
,
prefix
,
total_N
)
def
add_fluctuations
(
self
,
position_space
,
target_subdomain
,
fluctuations_mean
,
fluctuations_stddev
,
flexibility_mean
,
...
...
@@ -448,7 +448,7 @@ class CorrelatedFieldMaker:
The parameters `fluctuations`, `flexibility`, `asperity` and
`loglogavgslope` configure the power spectrum model used on the
target field subdomain `
position_space
`.
target field subdomain `
target_subdomain
`.
It is assembled as the sum of a power law component
(linear slope in log-log power-frequency-space),
a smooth varying component (integrated wiener process) and
...
...
@@ -460,7 +460,7 @@ class CorrelatedFieldMaker:
Parameters
----------
position_space
: :class:`~nifty6.domain.Domain`,
\
target_subdomain
: :class:`~nifty6.domain.Domain`,
\
:class:`~nifty6.domain_tuple.DomainTuple`
Target subdomain on which the correlation structure defined
in this call should hold.
...
...
@@ -484,10 +484,10 @@ class CorrelatedFieldMaker:
In which harmonic space to define the power spectrum
"""
if
harmonic_partner
is
None
:
harmonic_partner
=
position_space
.
get_default_codomain
()
harmonic_partner
=
target_subdomain
.
get_default_codomain
()
else
:
position_space
.
check_codomain
(
harmonic_partner
)
harmonic_partner
.
check_codomain
(
position_space
)
target_subdomain
.
check_codomain
(
harmonic_partner
)
harmonic_partner
.
check_codomain
(
target_subdomain
)
if
dofdex
is
None
:
dofdex
=
np
.
full
(
self
.
_total_N
,
0
)
...
...
@@ -496,12 +496,12 @@ class CorrelatedFieldMaker:
if
self
.
_total_N
>
0
:
N
=
max
(
dofdex
)
+
1
position_space
=
makeDomain
((
UnstructuredDomain
(
N
),
position_space
))
target_subdomain
=
makeDomain
((
UnstructuredDomain
(
N
),
target_subdomain
))
else
:
N
=
0
position_space
=
makeDomain
(
position_space
)
target_subdomain
=
makeDomain
(
target_subdomain
)
prefix
=
str
(
prefix
)
# assert isinstance(
position_space
[space], (RGSpace, HPSpace, GLSpace)
# assert isinstance(
target_subdomain
[space], (RGSpace, HPSpace, GLSpace)
fluct
=
_LognormalMomentMatching
(
fluctuations_mean
,
fluctuations_stddev
,
...
...
@@ -515,15 +515,15 @@ class CorrelatedFieldMaker:
avgsl
=
_normal
(
loglogavgslope_mean
,
loglogavgslope_stddev
,
self
.
_prefix
+
prefix
+
'loglogavgslope'
,
N
)
amp
=
_Amplitude
(
PowerSpace
(
harmonic_partner
),
fluct
,
flex
,
asp
,
avgsl
,
self
.
_azm
,
position_space
[
-
1
].
total_volume
,
self
.
_azm
,
target_subdomain
[
-
1
].
total_volume
,
self
.
_prefix
+
prefix
+
'spectrum'
,
dofdex
)
if
index
is
not
None
:
self
.
_a
.
insert
(
index
,
amp
)
self
.
_
position_spaces
.
insert
(
index
,
position_space
)
self
.
_
target_subdomains
.
insert
(
index
,
target_subdomain
)
else
:
self
.
_a
.
append
(
amp
)
self
.
_
position_spaces
.
append
(
position_space
)
self
.
_
target_subdomains
.
append
(
target_subdomain
)
def
_finalize_from_op
(
self
):
n_amplitudes
=
len
(
self
.
_a
)
...
...
@@ -543,11 +543,11 @@ class CorrelatedFieldMaker:
azm
=
expander
@
self
.
_azm
ht
=
HarmonicTransformOperator
(
hspace
,
self
.
_
position_space
s
[
0
][
amp_space
],
self
.
_
target_subdomain
s
[
0
][
amp_space
],
space
=
spaces
[
0
])
for
i
in
range
(
1
,
n_amplitudes
):
ht
=
HarmonicTransformOperator
(
ht
.
target
,
self
.
_
position_space
s
[
i
][
amp_space
],
self
.
_
target_subdomain
s
[
i
][
amp_space
],
space
=
spaces
[
i
])
@
ht
a
=
[]
for
ii
in
range
(
n_amplitudes
):
...
...
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