Commit 27b869ee authored by Theo Steininger's avatar Theo Steininger

Modified the dtype defaults for spaces.

parent 4d7e7b46
......@@ -71,7 +71,7 @@ class GLSpace(Space):
# ---Overwritten properties and methods---
def __init__(self, nlat=2, nlon=None, dtype=np.dtype('float')):
def __init__(self, nlat=2, nlon=None, dtype=None):
"""
Sets the attributes for a gl_space class instance.
......
......@@ -96,7 +96,7 @@ class HPSpace(Space):
# ---Overwritten properties and methods---
def __init__(self, nside=2, dtype=np.dtype('float')):
def __init__(self, nside=2, dtype=None):
"""
Sets the attributes for a hp_space class instance.
......
......@@ -74,7 +74,7 @@ class LMSpace(Space):
Pixel volume of the :py:class:`lm_space`, which is always 1.
"""
def __init__(self, lmax, dtype=np.dtype('complex128')):
def __init__(self, lmax, dtype=None):
"""
Sets the attributes for an lm_space class instance.
......@@ -131,11 +131,12 @@ class LMSpace(Space):
@property
def dim(self):
l = self.lmax
m = self.mmax
# the LMSpace consist of the full triangle (including -m's!),
# minus two little triangles if mmax < lmax
# dim = (((2*(l+1)-1)+1)**2/4 - 2 * (l-m)(l-m+1)/2
return np.int((l+1)**2 - (l-m)*(l-m+1.))
# dim = np.int((l+1)**2 - (l-m)*(l-m+1.))
# We fix l == m
return np.int((l+1)**2)
@property
def total_volume(self):
......
......@@ -18,7 +18,7 @@ class PowerSpace(Space):
def __init__(self, harmonic_domain=RGSpace((1,)),
distribution_strategy='not',
log=False, nbin=None, binbounds=None,
dtype=np.dtype('float')):
dtype=None):
super(PowerSpace, self).__init__(dtype)
self._ignore_for_hash += ['_pindex', '_kindex', '_rho', '_pundex',
......
......@@ -150,7 +150,8 @@ from keepers import Loggable,\
Versionable
class Space(Versionable, Loggable, object):
class Space(Versionable, Loggable, Plottable, object):
"""
.. __ __
.. /__/ / /_
......@@ -204,7 +205,10 @@ class Space(Versionable, Loggable, object):
"""
# parse dtype
self.dtype = np.dtype(dtype)
casted_dtype = np.result_type(dtype, np.float64)
if casted_dtype != dtype:
self.Logger.warning("Input dtype reset to: %s" % str(casted_dtype))
self.dtype = casted_dtype
self._ignore_for_hash = ['_global_id']
......
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