コード例 #1
0
    def superimpose_bound_cen(self, center, size, label,
                              color='red', coord_in='C'):
        '''Superimpose the footprint of a survey on the background image
        by giving input radec boundaries for the map. Boundaries are defined
        as the center and "radius" in ra/dec.

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

        size : array-like with shape (2,)
            The length of the edge of the rectangle in degrees

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

        color : string or array-like with shape (3,)
            The color to use when overlaying the survey footprint. Either a
            string or rgb triplet. Default : 'red'

        coord_in : 'C', 'G', or 'E'
            The coordinate system of the input parameters. 'C' would mean
            input values are in ra,dec. Default : 'C'
        '''

        hpx_map = util.gen_map_centersize(center, size, self.nside)

        self.superimpose_hpxmap(hpx_map, label, color=color,
                                coord_in=coord_in)
コード例 #2
0
    def superimpose_bound_cen(self,
                              center,
                              size,
                              label,
                              color='red',
                              coord_in='C'):
        '''Superimpose the footprint of a survey on the background image
        by giving input radec boundaries for the map. Boundaries are defined
        as the center and "radius" in ra/dec.

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

        size : array-like with shape (2,)
            The length of the edge of the rectangle in degrees

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

        color : string or array-like with shape (3,)
            The color to use when overlaying the survey footprint. Either a
            string or rgb triplet. Default : 'red'

        coord_in : 'C', 'G', or 'E'
            The coordinate system of the input parameters. 'C' would mean
            input values are in ra,dec. Default : 'C'
        '''

        hpx_map = util.gen_map_centersize(center, size, self.nside)

        self.superimpose_hpxmap(hpx_map, label, color=color, coord_in=coord_in)
コード例 #3
0
    def get_rectangle(self, survey_name):
        '''Generates a healpix map for a given survey given a center point
        and edge length of the rectanlge.

        Handler in .cfg file: "rectangle"

        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', a 'size', and a
        'coord' entry. The 'size' entry must contain the lon,lat length of the
        edge of the rectangle. The nside of the output map is the same as the
        nside specified in the initialization 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]

#       edge length. The corners of the box are center +- length/2.0
        length = self.config.get(survey_name, 'size').split(',')
        length = [tmp.strip() for tmp in length]
        length = SkyCoord(length[0], length[1])
        length = [length.ra.deg, length.dec.deg]

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

        hpx_map = util.gen_map_centersize(center, length, self.nside)

        return [hpx_map], coord