# Path: cora/util/units.py
# G = 6.6742e-11
# 
# Path: cora/core/skysim.py
# def clarray(aps, lmax, zarray, zromb=3, zwidth=None):
# def mkfullsky(corr, nside, alms=False, rng=None):
# def mkconstrained(corr, constraints, nside):


import numpy as np
from cora.util import units
from cora.core import skysim


class Sky3d(Map3d):
    """Base class for generating maps of the spherical sky at multiple frequencies.

    Attributes
    ----------
    oversample : int
        Over sample the angular power spectrum in frequency/redshift and
        integrate over them to capture the effect of finite width frequency
        channels.
    """

    oversample = 3

    def angular_powerspectrum(self, l, nu1, nu2):
        """C_l(nu1, nu2) for the given map."""

        raise Exception("Not implemented in base class.")

    def mean_nu(self, freq):
        return np.zeros_like(freq)

    def getfield(self):
        raise Exception("Not implemented in base class.")

    def getsky(self):
        """Create a map of the unpolarised sky."""

        lmax = 3 * self.nside - 1

# Path: cora/util/units.py
# G = 6.6742e-11
# 
# Path: cora/core/skysim.py
# def clarray(aps, lmax, zarray, zromb=3, zwidth=None):
# def mkfullsky(corr, nside, alms=False, rng=None):
# def mkconstrained(corr, constraints, nside):


# Path: cora/core/maps.py
import numpy as np
from cora.util import units
from cora.core import skysim



class Sky3d(Map3d):
    """Base class for generating maps of the spherical sky at multiple frequencies.

    Attributes
    ----------
    oversample : int
        Over sample the angular power spectrum in frequency/redshift and
        integrate over them to capture the effect of finite width frequency
        channels.
    """

    oversample = 3

    def angular_powerspectrum(self, l, nu1, nu2):
        """C_l(nu1, nu2) for the given map."""

        raise Exception("Not implemented in base class.")

    def mean_nu(self, freq):
        return np.zeros_like(freq)

    def getfield(self):
        raise Exception("Not implemented in base class.")

    def getsky(self):
        """Create a map of the unpolarised sky."""

        lmax = 3 * self.nside - 1

        cla = skysim.clarray(