# Path: cora/core/maps.py
# class Map2d(object):
# class Map3d(Map2d):
# class Sky3d(Map3d):
#     def like_map(cls, mapobj, *args, **kwargs):
#     def _width_array(self):
#     def _num_array(self):
#     def x_pixels(self):
#     def y_pixels(self):
#     def nside(self):
#     def nside(self, value):
#     def like_map(cls, mapobj, *args, **kwargs):
#     def _width_array(self):
#     def _num_array(self):
#     def nu_num(self):
#     def nu_num(self, num):
#     def frequencies(self):
#     def frequencies(self, freq):
#     def like_kiyo_map(cls, mapobj, *args, **kwargs):
#     def angular_powerspectrum(self, l, nu1, nu2):
#     def mean_nu(self, freq):
#     def getfield(self):
#     def getsky(self):
#     def getpolsky(self):
#     def getalms(self, lmax):
# 
# Path: cora/util/fftutil.py
# def rfftfreqn(n, d=None):
# def rfftn(arr):
# def irfftn(arr):
# 
# Path: cora/util/units.py
# G = 6.6742e-11


import numpy as np
import math
from cora.core import maps
from cora.util import fftutil, units
        from cora.util.cubicspline import LogInterpolater
            from os.path import dirname, join
            * self._n.prod()
            / (2.0 * self._w.prod()) ** 0.5
        )

        if not np.isfinite(self._kweight.flat[0]):
            self._kweight.flat[0] = 0.0

        self._kweightgen = True

    def getfield(self):
        r"""Generate a new realisation of the 3d field.

        Returns
        -------
        field : ndarray
            A realisation of the power spectrum. Shape is self._n.
        """

        self.generate_kweight()
        s = self._kweight.shape

        # Fill array
        f = np.random.standard_normal(s) + 1.0j * np.random.standard_normal(s)
        f *= self._kweight

        # TODO: is self._n argument here correct?
        r = fftutil.irfftn(f)
        return r



# Path: cora/core/maps.py
# class Map2d(object):
# class Map3d(Map2d):
# class Sky3d(Map3d):
#     def like_map(cls, mapobj, *args, **kwargs):
#     def _width_array(self):
#     def _num_array(self):
#     def x_pixels(self):
#     def y_pixels(self):
#     def nside(self):
#     def nside(self, value):
#     def like_map(cls, mapobj, *args, **kwargs):
#     def _width_array(self):
#     def _num_array(self):
#     def nu_num(self):
#     def nu_num(self, num):
#     def frequencies(self):
#     def frequencies(self, freq):
#     def like_kiyo_map(cls, mapobj, *args, **kwargs):
#     def angular_powerspectrum(self, l, nu1, nu2):
#     def mean_nu(self, freq):
#     def getfield(self):
#     def getsky(self):
#     def getpolsky(self):
#     def getalms(self, lmax):
# 
# Path: cora/util/fftutil.py
# def rfftfreqn(n, d=None):
# def rfftn(arr):
# def irfftn(arr):
# 
# Path: cora/util/units.py
# G = 6.6742e-11


# Path: cora/core/gaussianfield.py
import numpy as np
import math
from cora.core import maps
from cora.util import fftutil, units
        from cora.util.cubicspline import LogInterpolater
            from os.path import dirname, join

            * self._n.prod()
            / (2.0 * self._w.prod()) ** 0.5
        )

        if not np.isfinite(self._kweight.flat[0]):
            self._kweight.flat[0] = 0.0

        self._kweightgen = True

    def getfield(self):
        r"""Generate a new realisation of the 3d field.

        Returns
        -------
        field : ndarray
            A realisation of the power spectrum. Shape is self._n.
        """

        self.generate_kweight()
        s = self._kweight.shape

        # Fill array
        f = np.random.standard_normal(s) + 1.0j * np.random.standard_normal(s)
        f *= self._kweight

        # TODO: is self._n argument here correct?
        r = fftutil.irfftn(f)
        return r



class RandomFieldA2F(RandomField, maps.Map3d):