Skip to content
GitLab
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
80236a7a
Commit
80236a7a
authored
Jul 04, 2013
by
Marco Selig
Browse files
updated version 0.4.2; bugfixes applied.
parent
5ffbaa46
Changes
3
Hide whitespace changes
Inline
Side-by-side
nifty_core.py
View file @
80236a7a
...
...
@@ -484,7 +484,7 @@ class _about(object): ## nifty support class for global settings
"""
## version
self
.
_version
=
"0.4.
1
"
self
.
_version
=
"0.4.
2
"
## switches and notifications
self
.
_errors
=
notification
(
default
=
True
,
ccode
=
notification
.
_code
)
...
...
@@ -8597,7 +8597,7 @@ class diagonal_operator(operator):
self
.
sym
=
True
else
:
self
.
val
=
diag
about
.
infos
.
cprint
(
"INFO: non-self-adjoint complex diagonal operator."
)
#
about.infos.cprint("INFO: non-self-adjoint complex diagonal operator.")
self
.
sym
=
False
## check whether identity
...
...
@@ -8641,7 +8641,7 @@ class diagonal_operator(operator):
self
.
sym
=
True
else
:
self
.
val
=
newdiag
about
.
infos
.
cprint
(
"INFO: non-self-adjoint complex diagonal operator."
)
#
about.infos.cprint("INFO: non-self-adjoint complex diagonal operator.")
self
.
sym
=
False
## check whether identity
...
...
powerspectrum.py
View file @
80236a7a
...
...
@@ -216,14 +216,13 @@ def calc_ps_fast(field,axes,dgrid,zerocentered=False,fourier=False,pindex=None,k
Fourier space have the same length (default=None).
"""
## field absolutes
if
(
not
fourier
):
foufield
=
np
.
fft
.
fftshift
(
np
.
fft
.
fftn
(
field
))
elif
(
np
.
any
(
zerocentered
==
False
)):
foufield
=
np
.
fft
.
fftshift
(
field
,
axes
=
shiftaxes
(
zerocentered
,
st_to_zero_mode
=
True
))
foufield
=
np
.
fft
.
fftn
(
field
)
else
:
foufield
=
field
if
(
np
.
any
(
zerocentered
==
False
))
and
(
pindex
is
None
):
## kdict is zerocentered, but pindex is shifted
foufield
=
np
.
fft
.
fftshift
(
foufield
,
axes
=
shiftaxes
(
zerocentered
,
st_to_zero_mode
=
True
))
fieldabs
=
np
.
abs
(
foufield
)
**
2
if
(
rho
is
None
):
...
...
@@ -244,7 +243,7 @@ def calc_ps_fast(field,axes,dgrid,zerocentered=False,fourier=False,pindex=None,k
rho
[
position
]
+=
1
else
:
## power spectrum
ps
=
np
.
zeros
(
len
(
set
(
pindex
.
flatten
()))
)
ps
=
np
.
zeros
(
np
.
max
(
pindex
)
+
1
)
rho
=
np
.
zeros
(
ps
.
size
)
for
ii
in
np
.
ndindex
(
pindex
.
shape
):
ps
[
pindex
[
ii
]]
+=
fieldabs
[
ii
]
...
...
setup.py
View file @
80236a7a
...
...
@@ -23,7 +23,7 @@ from distutils.core import setup
import
os
setup
(
name
=
"nifty"
,
version
=
"0.4.
0
"
,
version
=
"0.4.
2
"
,
description
=
"Numerical Information Field Theory"
,
author
=
"Marco Selig"
,
author_email
=
"mselig@mpa-garching.mpg.de"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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