Commit 80236a7a authored by Marco Selig's avatar Marco Selig

updated version 0.4.2; bugfixes applied.

parent 5ffbaa46
......@@ -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
......
......@@ -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]
......
......@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment