示例#1
0
    def superimpose_bound_circ(self, center, radius, label,
                               color='red', coord_in='C'):
        '''Superimpose the footprint of a survey on the background image
        by giving an input center ra/dec and a radius of a disc.

        Parameters
        ----------
        center : array-like with shape (2,)
            The center of the survey (degrees). ra/dec, gall/galb, etc.

        radius : float
            The radius of the disc (degrees)

        label : string
            The label to put on the colorbar for this survey

        color : string or array-like with shape (3,)
            The color for the survey. Either a string recognized by
            matplotlib or a rgb triplet. Default : 'red'

        coord_in : 'C', 'E', or 'G'
            The coordinate system of the input values. Default : 'C'
        '''

        hpx_map = util.gen_map_disc(center, radius, self.nside)

        self.superimpose_hpxmap(hpx_map, label, color=color,
                                coord_in=coord_in)
示例#2
0
    def superimpose_bound_circ(self,
                               center,
                               radius,
                               label,
                               color='red',
                               coord_in='C'):
        '''Superimpose the footprint of a survey on the background image
        by giving an input center ra/dec and a radius of a disc.

        Parameters
        ----------
        center : array-like with shape (2,)
            The center of the survey (degrees). ra/dec, gall/galb, etc.

        radius : float
            The radius of the disc (degrees)

        label : string
            The label to put on the colorbar for this survey

        color : string or array-like with shape (3,)
            The color for the survey. Either a string recognized by
            matplotlib or a rgb triplet. Default : 'red'

        coord_in : 'C', 'E', or 'G'
            The coordinate system of the input values. Default : 'C'
        '''

        hpx_map = util.gen_map_disc(center, radius, self.nside)

        self.superimpose_hpxmap(hpx_map, label, color=color, coord_in=coord_in)
示例#3
0
    def get_disc(self, survey_name):
        '''Generates a healpix map for a given survey given a center point
        and a disc radius.

        Handler in .cfg file: "disc"

        Parameters
        ----------
        survey_name : string
            Configuration file block specifying survey parameters

        Returns
        -------
        hpx_map : array-like
            The healpix map associated with the survey

        Notes
        -----
        The configuration file must contain a 'center' and a 'radius'
        entry. The nside of the output map is the same as the nside specified
        in the initializaiton of this class.
        '''

        center = self.config.get(survey_name, 'center').split(',')
        center = [tmp.strip() for tmp in center]
        center = SkyCoord(center[0], center[1])
        center = [center.ra.deg, center.dec.deg]

#       This calculation is so that radius can be input in different
#       coordinates (i.e. deg, arcminutes, etc.)
        radius = self.config.get(survey_name, 'radius')
        tmp = SkyCoord('0d', radius)
        radius = np.abs(tmp.dec.deg)

        coord = self.config.get(survey_name, 'coord')

        hpx_map = util.gen_map_disc(center, radius, self.nside)

        return [hpx_map], coord