Beispiel #1
0
    def _unique_baselines(self):
        """Calculate the unique baseline pairs.
        
        Pairs are considered identical if they have the same baseline
        separation,
        
        Parameters
        ----------
        fpairs : np.ndarray
            An array of all the feed pairs, packed as [[i1, i2, ...], [j1, j2, ...] ].

        Returns
        -------
        baselines : np.ndarray
            An array of all the unique pairs. Packed as [ [i1, i2, ...], [j1, j2, ...]].
        redundancy : np.ndarray
            For each unique pair, give the number of equivalent pairs.
        """
        
        base_map, base_mask = super(CylinderTelescope, self)._unique_baselines()


        if not self.in_cylinder:
            # Construct array of indices
            fshape = [self.nfeed, self.nfeed]
            f_ind = np.indices(fshape)

            # Construct array of baseline separations in complex representation
            bl1 = (self.feedpositions[f_ind[0]] - self.feedpositions[f_ind[1]])

            ic_mask = np.where(bl1[..., 0] != 0.0, np.ones(fshape, dtype=np.bool), np.zeros(fshape, dtype=np.bool))
            base_mask = np.logical_and(base_mask, ic_mask)
            base_map = telescope._remap_keyarray(base_map, base_mask)
        
        return base_map, base_mask
Beispiel #2
0
    def _unique_beams(self):

        beam_mask = np.identity(self.nfeed, dtype=np.bool)
        beam_map = telescope._remap_keyarray(np.diag(np.arange(self.nfeed)),
                                             mask=beam_mask)

        return beam_map, beam_mask
Beispiel #3
0
    def _unique_baselines(self):
        """
        Ensures baselines from different pointings are treated as unique
        """
        fmap, mask = self.single_pointing_telescope._unique_baselines()

        block_fmap = linalg.block_diag(*[
            fmap + i * self.single_pointing_telescope.nfeed
            for i, _ in enumerate(self.pointings)
        ])
        block_mask = linalg.block_diag(*[mask for _ in self.pointings])

        return _remap_keyarray(block_fmap, block_mask), block_mask
Beispiel #4
0
    def _unique_baselines(self):
        """Calculate the unique baseline pairs.

        Pairs are considered identical if they have the same baseline
        separation,

        Parameters
        ----------
        fpairs : np.ndarray
            An array of all the feed pairs, packed as [[i1, i2, ...], [j1, j2, ...] ].

        Returns
        -------
        baselines : np.ndarray
            An array of all the unique pairs. Packed as [ [i1, i2, ...], [j1, j2, ...]].
        redundancy : np.ndarray
            For each unique pair, give the number of equivalent pairs.
        """

        base_map, base_mask = super(CylinderTelescope,
                                    self)._unique_baselines()

        if not self.in_cylinder:
            # Construct array of indices
            fshape = [self.nfeed, self.nfeed]
            f_ind = np.indices(fshape)

            # Construct array of baseline separations in complex representation
            bl1 = self.feedpositions[f_ind[0]] - self.feedpositions[f_ind[1]]

            ic_mask = np.where(
                bl1[..., 0] != 0.0,
                np.ones(fshape, dtype=bool),
                np.zeros(fshape, dtype=bool),
            )
            base_mask = np.logical_and(base_mask, ic_mask)
            base_map = telescope._remap_keyarray(base_map, base_mask)

        return base_map, base_mask
    def _unique_baselines(self):
        # Reimplement unique baselines in order to mask out either according to total
        # baseline length or maximum North-South and East-West baseline seperation.

        from drift.core import telescope

        # Construct array of indices
        fshape = [self.nfeed, self.nfeed]
        f_ind = np.indices(fshape)

        # Construct array of baseline separations
        bl1 = self.feedpositions[f_ind[0]] - self.feedpositions[f_ind[1]]
        bl2 = np.around(bl1[..., 0] + 1.0j * bl1[..., 1], self._bl_tol)

        # Construct array of baseline lengths
        blen = np.sum(bl1**2, axis=-1)**0.5

        if self.baseline_masking_type == "total_length":
            # Create mask of included baselines
            mask = np.logical_and(blen >= self.minlength,
                                  blen <= self.maxlength)
        else:
            mask_ew = np.logical_and(
                abs(bl1[..., 0]) >= self.minlength_ew,
                abs(bl1[..., 0]) <= self.maxlength_ew,
            )
            mask_ns = np.logical_and(
                abs(bl1[..., 1]) >= self.minlength_ns,
                abs(bl1[..., 1]) <= self.maxlength_ns,
            )
            mask = np.logical_and(mask_ew, mask_ns)

        # Remove the auto correlated baselines between all polarisations
        if not self.auto_correlations:
            mask = np.logical_and(blen > 0.0, mask)

        return telescope._remap_keyarray(bl2, mask), mask
Beispiel #6
0
    def _unique_beams(self):

        beam_mask = np.identity(self.nfeed, dtype=np.bool)
        beam_map = telescope._remap_keyarray(np.diag(np.arange(self.nfeed)), mask=beam_mask)

        return beam_map, beam_mask