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
180eefc6
Commit
180eefc6
authored
Jun 04, 2017
by
Martin Reinecke
Browse files
correction
parent
3e0f331f
Pipeline
#13304
passed with stage
in 5 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/spaces/power_space/power_space.py
View file @
180eefc6
...
...
@@ -35,7 +35,7 @@ class PowerSpace(Space):
derived from this PowerSpace, e.g. the pindex.
(default : 'not')
logarithmic : bool *optional*
True if logarithmic binning should be used (default :
Fals
e).
True if logarithmic binning should be used (default :
Non
e).
nbin : {int, None} *optional*
The number of bins that should be used for power spectrum binning
(default : None).
...
...
@@ -102,7 +102,7 @@ class PowerSpace(Space):
# neighbors.
# I'm appending the last value*2 to the array to treat the
# rightmost point correctly.
tmp
=
tmp
[
np
.
diff
(
np
.
append
(
tmp
,
2
*
tmp
[
-
1
]))
>
tol
]
tmp
=
tmp
[
np
.
diff
(
np
.
append
(
tmp
,
2
*
tmp
[
-
1
]))
>
tol
]
#FIXME: np.r_ ??
bb
=
tmp
[
0
:
-
1
]
+
0.5
*
np
.
diff
(
tmp
)
else
:
if
binbounds
is
not
None
:
...
...
@@ -263,7 +263,7 @@ class PowerSpace(Space):
def
_to_hdf5
(
self
,
hdf5_group
):
hdf5_group
.
attrs
[
'binbounds'
]
=
str
(
self
.
_binbounds
)
hdf5_group
[
'distribution_strategy'
]
=
self
.
_pindex
.
distribution_strategy
hdf5_group
.
attrs
[
'distribution_strategy'
]
=
self
.
_pindex
.
distribution_strategy
return
{
'harmonic_partner'
:
self
.
harmonic_partner
,
...
...
@@ -273,5 +273,5 @@ class PowerSpace(Space):
def
_from_hdf5
(
cls
,
hdf5_group
,
repository
):
hp
=
repository
.
get
(
'harmonic_partner'
,
hdf5_group
)
exec
(
"bb = "
+
hdf5_group
.
attrs
[
'binbounds'
])
ds
=
hdf5_group
[
'distribution_strategy'
]
[()]
ds
=
hdf5_group
.
attrs
[
'distribution_strategy'
]
return
PowerSpace
(
hp
,
ds
,
binbounds
=
bb
)
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