Ejemplo n.º 1
0
    def beamx(self, feed, freq):
        """Beam for the x polarisation feed.

        Parameters
        ----------
        feed : integer
            Index for the feed.
        freq : integer
            Index for the frequency.

        Returns
        -------
        beam : np.ndarray
            Healpix maps (of size [self._nside, 2]) of the field pattern in the
            theta and phi directions.
        """
        beampert = int(self.beamclass[feed] / 2)

        if beampert == 0:

            return cylbeam.beam_x(self._angpos, self.zenith,
                self.cylinder_width / self.wavelengths[freq], self.fwhm_e, self.fwhm_h)

        elif beampert == 1:

            beam0 = cylbeam.beam_x(self._angpos, self.zenith,
                self.cylinder_width / self.wavelengths[freq], self.fwhm_e, self.fwhm_h)

            beam1 = cylbeam.beam_x(self._angpos, self.zenith,
                self.cylinder_width / self.wavelengths[freq], self.fwhm_e * 1.01, self.fwhm_h)

            dbeam = (beam1 - beam0) / (0.01 * self.fwhm_e)

            return dbeam
Ejemplo n.º 2
0
    def beamx(self, feed, freq):
        """Beam for the x polarisation feed.

        Parameters
        ----------
        feed : integer
            Index for the feed.
        freq : integer
            Index for the frequency.

        Returns
        -------
        beam : np.ndarray
            Healpix maps (of size [self._nside, 2]) of the field pattern in the
            theta and phi directions.
        """
        beampert = int(self.beamclass[feed] // 2)

        if beampert == 0:

            return cylbeam.beam_x(
                self._angpos,
                self.zenith,
                self.cylinder_width / self.wavelengths[freq],
                self.fwhm_e,
                self.fwhm_h,
            )

        elif beampert == 1:

            beam0 = cylbeam.beam_x(
                self._angpos,
                self.zenith,
                self.cylinder_width / self.wavelengths[freq],
                self.fwhm_e,
                self.fwhm_h,
            )

            beam1 = cylbeam.beam_x(
                self._angpos,
                self.zenith,
                self.cylinder_width / self.wavelengths[freq],
                self.fwhm_e * 1.01,
                self.fwhm_h,
            )

            dbeam = (beam1 - beam0) / (0.01 * self.fwhm_e)

            return dbeam
Ejemplo n.º 3
0
    def beamx(self, feed, freq):

        return cylbeam.beam_x(
            self._angpos,
            self.zenith,
            self.cylinder_width / self.wavelengths[freq],
            self.fwhm_e,
            self.fwhm_h,
        )
Ejemplo n.º 4
0
 def beamx(self, feed, freq):
     
     return cylbeam.beam_x(self._angpos, self.zenith,
         self.cylinder_width / self.wavelengths[freq], self.fwhm_e, self.fwhm_h)
Ejemplo n.º 5
0
    def beam(self, feed, freq, angpos=None):
        """Primary beam implementation for the CHIME/Pathfinder.

        This only supports normal CHIME cylinder antennas. Asking for the beams
        for other types of inputs will cause an exception to be thrown. The
        beams from this routine are rotated by `self.rotation_angle` to account
        for the CHIME/Pathfinder rotation.

        Parameters
        ----------
        feed : int
            Index for the feed.
        freq : int
            Index for the frequency.
        angpos : np.ndarray[nposition, 2], optional
            Angular position on the sky (in radians).
            If not provided, default to the _angpos
            class attribute.

        Returns
        -------
        beam : np.ndarray[nposition, 2]
            Amplitude vector of beam at each position on the sky.
        """
        # # Fetch beam parameters out of config database.

        feed_obj = self.feeds[feed]

        # Check that feed exists and is a CHIME cylinder antenna
        if feed_obj is None:
            raise ValueError(
                "Craziness. The requested feed doesn't seem to exist.")

        if not tools.is_array(feed_obj):
            raise ValueError("Requested feed is not a CHIME antenna.")

        # If the angular position was not provided, then use the values in the
        # class attribute.
        if angpos is None:
            angpos = self._angpos

        # Get the beam rotation parameters.
        yaw = -self.rotation_angle
        pitch = 0.0
        roll = 0.0

        rot = np.radians([yaw, pitch, roll])

        # We can only support feeds angled parallel or perp to the cylinder
        # axis. Check for these and throw exception for anything else.
        if tools.is_array_y(feed_obj):
            beam = cylbeam.beam_y(
                angpos,
                self.zenith,
                self.cylinder_width / self.wavelengths[freq],
                self.fwhm_ey[freq],
                self.fwhm_hy[freq],
                rot=rot,
            )
        elif tools.is_array_x(feed_obj):
            beam = cylbeam.beam_x(
                angpos,
                self.zenith,
                self.cylinder_width / self.wavelengths[freq],
                self.fwhm_ex[freq],
                self.fwhm_hx[freq],
                rot=rot,
            )
        else:
            raise RuntimeError(
                "Given polarisation (feed.pol=%s) not supported." %
                feed_obj.pol)

        # Normalize the beam
        if self._beam_normalization is not None:
            beam *= self._beam_normalization[freq, feed, np.newaxis, :]

        return beam