def beam(self, feed, freq): """Beam for a particular feed. Parameters ---------- feed : integer Index for the feed. freq : integer Index for the frequency. Returns ------- beam : np.ndarray A Healpix map (of size self._nside) of the beam. Potentially complex. """ if self._bc_freq != freq or self._bc_nside != self._nside: sigma = np.radians(self.fwhm) / (8.0 * np.log(2.0))**0.5 / ( self.frequencies[freq] / 150.0) pointing = np.array( [np.pi / 2.0 - np.radians(self.pointing), self.zenith[1]]) x2 = (1.0 - coord.sph_dot(self._angpos, pointing)**2) / (4 * sigma**2) self._bc_map = np.exp(-x2) self._bc_freq = freq self._bc_nside = self._nside return self._bc_map
def beam(self, feed, freq): """Beam for a particular feed. Parameters ---------- feed : integer Index for the feed. freq : integer Index for the frequency. Returns ------- beam : np.ndarray A Healpix map (of size self._nside) of the beam. Potentially complex. """ if self._bc_freq != freq or self._bc_nside != self._nside: sigma = np.radians(self.fwhm) / (8.0*np.log(2.0))**0.5 / (self.frequencies[freq] / 150.0) pointing = np.array([np.pi / 2.0 - np.radians(self.pointing), self.zenith[1]]) x2 = (1.0 - coord.sph_dot(self._angpos, pointing)**2) / (4*sigma**2) self._bc_map = np.exp(-x2) self._bc_freq = freq self._bc_nside = self._nside return self._bc_map
def horizon(sph_arr, zenith): r"""The horizon function at particular location. Parameters ---------- sph_arr : np.ndarray Angular positions (in spherical polar co-ordinates). zenith : np.ndarray The zenith vector in spherical polar-coordinates. Returns ------- horizon : np.ndarray The horizon function (including an angular projection term at each position). """ proj = coord.sph_dot(sph_arr, zenith) return np.signbit(-proj)
def beam_circular(angpos, zenith, uv_diameter): """Beam pattern for a circular dish. Parameters ---------- angpos : np.ndarray Array of angular positions zenith : np.ndarray Co-ordinates of the zenith. uv_diameter : scalar Diameter of the dish (in units of wavelength). Returns ------- beam : np.ndarray Beam pattern at each position in angpos. """ x = (1.0 - coord.sph_dot(angpos, zenith)**2)**0.5 * np.pi * uv_diameter return 2*jinc(x)
def beam_circular(angpos, zenith, uv_diameter): """Beam pattern for a circular dish. Parameters ---------- angpos : np.ndarray Array of angular positions zenith : np.ndarray Co-ordinates of the zenith. uv_diameter : scalar Diameter of the dish (in units of wavelength). Returns ------- beam : np.ndarray Beam pattern at each position in angpos. """ x = (1.0 - coord.sph_dot(angpos, zenith) ** 2) ** 0.5 * np.pi * uv_diameter return 2 * jinc(x)
def beam_circular(angpos, zenith, diameter): """Beam pattern for a uniformly illuminated circular dish. Parameters ---------- angpos : np.ndarray Array of angular positions zenith : np.ndarray Co-ordinates of the zenith. diameter : scalar Diameter of the dish (in units of wavelength). Returns ------- beam : np.ndarray Beam pattern at each position in angpos. """ def jinc(x): return 0.5 * (jn(0, x) + jn(2, x)) x = (1.0 - coord.sph_dot(angpos, zenith)**2)**0.5 * np.pi * diameter return 2 * jinc(x)
def beam_circular(angpos, zenith, diameter): """Beam pattern for a uniformly illuminated circular dish. Parameters ---------- angpos : np.ndarray Array of angular positions zenith : np.ndarray Co-ordinates of the zenith. diameter : scalar Diameter of the dish (in units of wavelength). Returns ------- beam : np.ndarray Beam pattern at each position in angpos. """ def jinc(x): return 0.5 * (jn(0, x) + jn(2, x)) x = (1.0 - coord.sph_dot(angpos, zenith)**2)**0.5 * np.pi * diameter return 2*jinc(x)
def gaussian_beam(angpos, pointing, fwhm): sigma = np.radians(fwhm) / (8.0*np.log(2.0))**0.5 x2 = (1.0 - coord.sph_dot(angpos, pointing)**2) / (4*sigma**2) return np.exp(-x2)
def gaussian_beam(angpos, pointing, fwhm): sigma = np.radians(fwhm) / (8.0 * np.log(2.0))**0.5 x2 = (1.0 - coord.sph_dot(angpos, pointing)**2) / (4 * sigma**2) return np.exp(-x2)