Esempio n. 1
0
    def superimpose_bound_vtx(self, vertices, label, color='red',
                              coord_in='C'):
        '''Superimpose the footprint of a survey on the background image
        by giving the ra/dec corners of the image. The enclosed survey
        footprint is generated by calling healpy.query_polygon.

        Parameters
        ----------
        vertices : array-like with shape (n,2)
            The n corners of the survey footprint 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', 'E', or 'G'
            The coordinate system of the input vertices. Default : 'C'
        '''

        hpx_map = util.gen_map_polygon(vertices, self.nside)

        self.superimpose_hpxmap(hpx_map, label, color=color,
                                coord_in=coord_in)
Esempio n. 2
0
    def superimpose_bound_vtx(self,
                              vertices,
                              label,
                              color='red',
                              coord_in='C'):
        '''Superimpose the footprint of a survey on the background image
        by giving the ra/dec corners of the image. The enclosed survey
        footprint is generated by calling healpy.query_polygon.

        Parameters
        ----------
        vertices : array-like with shape (n,2)
            The n corners of the survey footprint 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', 'E', or 'G'
            The coordinate system of the input vertices. Default : 'C'
        '''

        hpx_map = util.gen_map_polygon(vertices, self.nside)

        self.superimpose_hpxmap(hpx_map, label, color=color, coord_in=coord_in)
Esempio n. 3
0
    def get_polygon(self, survey_name):
        '''Generates a healpix map for a given survey given vertices of
        a polygon.

        Handler in .cfg file: "polygon"

        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 'vertex1', ..., 'vertexXX'
        entries containing the ra,dec locations of each vertex. Nside of
        the output map is the same as the nside specified in the
        initialization of this class.
        '''

        lons = []
        lats = []

        i = 1
        while True:
            radec_point = 'vertex'+str(i)
            try:
                radec_val = self.config.get(survey_name, radec_point)
            except ConfigParser.NoOptionError:
                break

            lonlat_val = radec_val.split(',')
            lonlat_val = [tmp.strip() for tmp in lonlat_val]
            lonlat_val = SkyCoord(lonlat_val[0], lonlat_val[1])
            lons.append(lonlat_val.ra.deg)
            lats.append(lonlat_val.dec.deg)
            i += 1

        vtxs = np.transpose([lons, lats])

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

        hpx_map = util.gen_map_polygon(vtxs, self.nside)

        return [hpx_map], coord