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
Neel Shah
NIFTy
Commits
c326b049
Commit
c326b049
authored
May 12, 2017
by
Theo Steininger
Browse files
Style fixes and replaced `logarithmic`, `nbin` and `binbounds` properties in PowerSpace by `config`
parent
388334ea
Changes
8
Hide whitespace changes
Inline
Side-by-side
nifty/domain_object.py
View file @
c326b049
...
...
@@ -25,18 +25,20 @@ from keepers import Loggable,\
class
DomainObject
(
Versionable
,
Loggable
,
object
):
"""The abstract class that can be used as a domain for a field.
This holds all the information and functionality a field needs to know
about
its domain and how the data of the field are stored.
This holds all the information and functionality a field needs to know
about
its domain and how the data of the field are stored.
Attributes
----------
dim : int
n
umber of pixel-dimensions of the underlying data object.
N
umber of pixel-dimensions of the underlying data object.
shape : tuple
shape of the array that stores the degrees of freedom for any field with
this domain.
Shape of the array that stores the degrees of freedom for any field
on this domain.
"""
__metaclass__
=
NiftyMeta
def
__init__
(
self
):
...
...
nifty/spaces/gl_space/gl_space.py
View file @
c326b049
...
...
@@ -38,7 +38,15 @@ class GLSpace(Space):
.. /______/
NIFTY subclass for Gauss-Legendre pixelizations [#]_ of the two-sphere.
Parameters
----------
nlat : int
Number of latitudinal bins (or rings) that are used for this
pixelization.
nlon : int, *optional*
Number of longditudinal bins that are used for this pixelization.
Attributes
----------
dim : np.int
...
...
@@ -48,7 +56,7 @@ class GLSpace(Space):
nlat : int
Number of latitudinal bins (or rings) that are used for this
pixelization.
nlon : int
, *optional*
nlon : int
Number of longditudinal bins that are used for this pixelization.
total_volume : np.float
The total volume of the space.
...
...
nifty/spaces/hp_space/hp_space.py
View file @
c326b049
...
...
@@ -32,7 +32,13 @@ class HPSpace(Space):
.. /__/
NIFTY subclass for HEALPix discretizations of the two-sphere [#]_.
Parameters
----------
nside : int
The corresponding HEALPix pixelization. The total number of pixels
is 12*nside**2.
Attributes
----------
dim : np.int
...
...
@@ -40,7 +46,7 @@ class HPSpace(Space):
harmonic : bool
Specifies whether the space is a signal or harmonic space.
nside : int
The corresponding HEALPix pixelization. The total number of pixels
The corresponding HEALPix pixelization. The total number of pixels
is 12*nside**2.
total_volume : np.float
The total volume of the space.
...
...
nifty/spaces/lm_space/lm_space.py
View file @
c326b049
...
...
@@ -37,6 +37,12 @@ class LMSpace(Space):
NIFTY subclass for spherical harmonics components, for representations
of fields on the two-sphere.
Parameters
----------
lmax : int
The maximal :math:`l` value of any spherical harmonics
:math:`Y_{lm}` that is represented in this Space.
Attributes
----------
lmax : int
...
...
nifty/spaces/power_space/power_indices.py
View file @
c326b049
...
...
@@ -26,21 +26,20 @@ from d2o.config import configuration as d2o_config
class
PowerIndices
(
object
):
"""Computes helpful quantities to deal with power spectra.
Given the shape and the density of a underlying rectangular grid this
Given the shape and the density of a underlying rectangular grid this
class provides the user
with the pindex, kindex, rho and pundex. The indices are binned
according to the supplied parameter scheme. If wanted, computed
results are stored for future reuse.
Attribu
tes
Parame
te
r
s
----------
shape : tuple, list, ndarray
Array-like object which specifies the shape of the underlying
rectangular grid
dgrid : tuple, list, ndarray
Array-like object which specifies the step-width of the
underlying grid
domain : NIFTy harmonic space
The space for which the power indices get computed
distribution_strategy : str
The distribution_strategy that will be used for the k_array and pindex
distributed_data_object.
logarithmic : bool *optional*
Flag specifying if the binning of the default indices is
performed on logarithmic scale.
...
...
nifty/spaces/power_space/power_space.py
View file @
c326b049
...
...
@@ -59,7 +59,7 @@ class PowerSpace(Space):
kindex : numpy.ndarray
Sorted array of all k-modes.
pundex : numpy.ndarray
Flat index of the first occurence of a k-vector with length==kindex[n]
Flat index of the first occurence of a k-vector with length==kindex[n]
in the k_array.
rho : numpy.ndarray
The amount of k-modes that get mapped to one power bin is given by
...
...
@@ -105,10 +105,7 @@ class PowerSpace(Space):
nbin
=
nbin
,
binbounds
=
binbounds
)
config
=
power_index
[
'config'
]
self
.
_logarithmic
=
config
[
'logarithmic'
]
self
.
_nbin
=
config
[
'nbin'
]
self
.
_binbounds
=
config
[
'binbounds'
]
self
.
_config
=
power_index
[
'config'
]
self
.
_pindex
=
power_index
[
'pindex'
]
self
.
_kindex
=
power_index
[
'kindex'
]
...
...
@@ -207,22 +204,11 @@ class PowerSpace(Space):
return
self
.
_harmonic_partner
@
property
def
logarithmic
(
self
):
""" Returns True if logarithmic binning is used.
def
config
(
self
):
""" Returns the configuration which was used for `logarithmic`, `nbin`
and `binbounds` during initialization.
"""
return
self
.
_logarithmic
@
property
def
nbin
(
self
):
""" Returns the number of power bins if specfied during initialization.
"""
return
self
.
_nbin
@
property
def
binbounds
(
self
):
""" Inner boundaries of the used bins if specfied during initialization.
"""
return
self
.
_binbounds
return
self
.
_config
@
property
def
pindex
(
self
):
...
...
nifty/spaces/rg_space/rg_space.py
View file @
c326b049
...
...
@@ -48,6 +48,26 @@ class RGSpace(Space):
NIFTY subclass for spaces of regular Cartesian grids.
Parameters
----------
shape : {int, numpy.ndarray}
Number of grid points or numbers of gridpoints along each axis.
zerocenter : {bool, numpy.ndarray}, *optional*
Whether x==0 (or k==0, respectively) is located in the center of
the grid (or the center of each axis speparately) or not.
(default: False).
distances : {float, numpy.ndarray}, *optional*
Distance between two grid points along each axis
(default: None).
If distances==None:
if harmonic==True, all distances will be set to 1
if harmonic==False, the distance along each axis will be
set to the inverse of the number of points along that
axis.
harmonic : bool, *optional*
Whether the space represents a grid in position or harmonic space.
(default: False).
Attributes
----------
harmonic : bool
...
...
test/test_spaces/test_power_space.py
View file @
c326b049
...
...
@@ -95,9 +95,7 @@ def get_weight_configs():
class
PowerSpaceInterfaceTest
(
unittest
.
TestCase
):
@
expand
([
[
'harmonic_partner'
,
Space
],
[
'logarithmic'
,
bool
],
[
'nbin'
,
(
int
,
NoneType
)],
[
'binbounds'
,
(
list
,
NoneType
)],
[
'config'
,
dict
]
[
'pindex'
,
distributed_data_object
],
[
'kindex'
,
np
.
ndarray
],
[
'rho'
,
np
.
ndarray
],
...
...
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