Commit 79f806e2 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

rearrange

parent 15d0cad6
Pipeline #19378 failed with stage
in 4 minutes and 2 seconds
......@@ -18,7 +18,7 @@
from __future__ import division
import numpy as np
from ..space import Space
from .space import Space
class GLSpace(Space):
......
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from .gl_space import GLSpace
......@@ -18,8 +18,7 @@
from __future__ import division
import numpy as np
from ..space import Space
from .space import Space
class HPSpace(Space):
......
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from .hp_space import HPSpace
......@@ -17,10 +17,8 @@
# and financially supported by the Studienstiftung des deutschen Volkes.
from __future__ import division
import numpy as np
from ..space import Space
from .space import Space
class LMSpace(Space):
......
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from .lm_space import LMSpace
......@@ -17,10 +17,9 @@
# and financially supported by the Studienstiftung des deutschen Volkes.
import numpy as np
from ...spaces.space import Space
from .space import Space
from functools import reduce
from ... import dobj
from .. import dobj
class PowerSpace(Space):
......@@ -51,9 +50,6 @@ class PowerSpace(Space):
mapped to which power bin
k_lengths : numpy.ndarray
Sorted array of all k-modes.
rho : numpy.ndarray
The amount of k-modes that get mapped to one power bin is given by
rho.
dim : np.int
Total number of dimensionality, i.e. the number of pixels.
harmonic : bool
......@@ -148,7 +144,11 @@ class PowerSpace(Space):
if not (isinstance(harmonic_partner, Space) and
harmonic_partner.harmonic):
raise ValueError("harmonic_partner must be a harmonic space.")
if harmonic_partner.scalar_dvol() is None:
raise ValueError("harmonic partner must have "
"scalar volume factors")
self._harmonic_partner = harmonic_partner
pdvol = harmonic_partner.scalar_dvol()
if binbounds is not None:
binbounds = tuple(binbounds)
......@@ -165,12 +165,13 @@ class PowerSpace(Space):
temp_k_lengths = np.bincount(temp_pindex.ravel(),
weights=k_length_array.ravel()) \
/ temp_rho
temp_dvol = temp_rho*pdvol
self._powerIndexCache[key] = (binbounds,
temp_pindex,
temp_k_lengths,
temp_rho)
temp_dvol)
(self._binbounds, self._pindex, self._k_lengths, self._rho) = \
(self._binbounds, self._pindex, self._k_lengths, self._dvol) = \
self._powerIndexCache[key]
@staticmethod
......@@ -199,7 +200,10 @@ class PowerSpace(Space):
return self.shape[0]
def scalar_dvol(self):
return 1.
return None
def dvol(self):
return self._dvol
def get_k_length_array(self):
return self.k_lengths.copy()
......@@ -232,9 +236,3 @@ class PowerSpace(Space):
""" Sorted array of all k-modes.
"""
return self._k_lengths
@property
def rho(self):
"""Degeneracy factor of the individual k-vectors.
"""
return self._rho
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from .power_space import PowerSpace
......@@ -32,7 +32,7 @@ from __future__ import division
from builtins import range
from functools import reduce
import numpy as np
from ..space import Space
from .space import Space
class RGSpace(Space):
......
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from .rg_space import RGSpace
......@@ -18,7 +18,7 @@
import abc
from ...domain_object import DomainObject
from ..domain_object import DomainObject
class Space(DomainObject):
......
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from .space import Space
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