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
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
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
b3779f25
Commit
b3779f25
authored
May 22, 2017
by
Theo Steininger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes in the wording.
parent
30f0c275
Pipeline
#12808
passed with stage
in 4 minutes and 26 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
25 deletions
+31
-25
nifty/field.py
nifty/field.py
+16
-14
nifty/sugar.py
nifty/sugar.py
+15
-11
No files found.
nifty/field.py
View file @
b3779f25
...
@@ -270,13 +270,13 @@ class Field(Loggable, Versionable, object):
...
@@ -270,13 +270,13 @@ class Field(Loggable, Versionable, object):
def
power_analyze
(
self
,
spaces
=
None
,
logarithmic
=
False
,
nbin
=
None
,
def
power_analyze
(
self
,
spaces
=
None
,
logarithmic
=
False
,
nbin
=
None
,
binbounds
=
None
,
decompose_power
=
True
):
binbounds
=
None
,
decompose_power
=
True
):
""" Computes the square root power spectrum for a subspace of
the Field
.
""" Computes the square root power spectrum for a subspace of
`self`
.
Creates a PowerSpace for the space addressed by `spaces` with the given
Creates a PowerSpace for the space addressed by `spaces` with the given
binning and computes the power spectrum as a Field over this
binning and computes the power spectrum as a Field over this
PowerSpace. This can only be done if the subspace to be analyzed is a
PowerSpace. This can only be done if the subspace to be analyzed is a
harmonic space. The resulting field has the same units as the initial
harmonic space. The resulting field has the same units as the initial
field, corresponding to the square root of the power spectrum.
field, corresponding to the square root of the power spectrum.
Parameters
Parameters
----------
----------
...
@@ -457,16 +457,10 @@ class Field(Loggable, Versionable, object):
...
@@ -457,16 +457,10 @@ class Field(Loggable, Versionable, object):
def
power_synthesize
(
self
,
spaces
=
None
,
real_power
=
True
,
real_signal
=
True
,
def
power_synthesize
(
self
,
spaces
=
None
,
real_power
=
True
,
real_signal
=
True
,
mean
=
None
,
std
=
None
):
mean
=
None
,
std
=
None
):
"""
Yields a sampled field with this field squared
as its power spectrum.
"""
Yields a sampled field with `self`**2
as its power spectrum.
This method draws a Gaussian random field in the harmonic partner domain
This method draws a Gaussian random field in the harmonic partner
of this fields domains, using this field as power spectrum.
domain of this fields domains, using this field as power spectrum.
Notes
-----
For this the spaces specified by `spaces` must be a PowerSpace.
This expects this field to be the square root of a power spectrum, i.e.
to have the unit of the field to be sampled.
Parameters
Parameters
----------
----------
...
@@ -495,12 +489,20 @@ class Field(Loggable, Versionable, object):
...
@@ -495,12 +489,20 @@ class Field(Loggable, Versionable, object):
The output object. A random field created with the power spectrum
The output object. A random field created with the power spectrum
stored in the `spaces` in `self`.
stored in the `spaces` in `self`.
Notes
-----
For this the spaces specified by `spaces` must be a PowerSpace.
This expects this field to be the square root of a power spectrum, i.e.
to have the unit of the field to be sampled.
See Also
See Also
--------
--------
power_analyze
power_analyze
Raises
------
Raises
ValueError : If domain is not a PowerSpace
------
ValueError : If domain specified by `spaces` is not a PowerSpace.
"""
"""
# check if the `spaces` input is valid
# check if the `spaces` input is valid
...
...
nifty/sugar.py
View file @
b3779f25
...
@@ -26,30 +26,34 @@ __all__ = ['create_power_operator']
...
@@ -26,30 +26,34 @@ __all__ = ['create_power_operator']
def
create_power_operator
(
domain
,
power_spectrum
,
dtype
=
None
,
def
create_power_operator
(
domain
,
power_spectrum
,
dtype
=
None
,
distribution_strategy
=
'not'
):
distribution_strategy
=
'not'
):
""" Creates a diagonal operator with a certain power spectrum.
""" Creates a diagonal operator with the given power spectrum.
Constructs a diagonal operator that lives over the specified domain, or
Constructs a diagonal operator that lives over the specified domain, or
its harmonic domain in case it is not harmonic.
its default harmonic codomain in case it is not harmonic.
Parameters
Parameters
----------
----------
domain : DomainObject
domain : DomainObject
Domain over which the power operator shall live. If this is not a
Domain over which the power operator shall live. If this is not a
harmonic domain, it will return an operator for its harmonic domain
harmonic domain, it will return an operator for its harmonic
co
domain
instead.
instead.
power_spectrum :
{array-like, method}
power_spectrum :
(array-like, method)
An array-like object, or a method that implements the square root
An array-like object, or a method that implements the square root
of a power spectrum as a function of k.
of a power spectrum as a function of k.
dtype : type
,
*optional*
dtype : type *optional*
dtype that the field holding the power spectrum shall use
dtype that the field holding the power spectrum shall use
{default : None}
(default : None).
if dtype == None:
passes this on to constructor of Field
if dtype == None:
the dtype of `power_spectrum` will be used.
distribution_strategy : string
,
*optional*
distribution_strategy : string *optional*
Distributed strategy to be used by the underlying d2o objects.
Distributed strategy to be used by the underlying d2o objects.
{default : 'not'}
(default : 'not')
Returns
Returns
-------
-------
DiagonalOperator : An operator that
lives that implements the given power
DiagonalOperator : An operator that
implements the given power spectrum.
spectrum.
"""
"""
if
not
domain
.
harmonic
:
if
not
domain
.
harmonic
:
fft
=
FFTOperator
(
domain
)
fft
=
FFTOperator
(
domain
)
domain
=
fft
.
target
[
0
]
domain
=
fft
.
target
[
0
]
...
...
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