(self, map, vec2pix_func, rot=None, coord=None)
return img
Create an array containing the projection of the map.

        Input:
          - vec2pix_func: a function taking theta,phi and returning pixel number
          - map: an array containing the spherical map to project,
                 the pixelisation is described by vec2pix_func
        Return:
          - a 2D array with the projection of the map.

        Note: the Projector must contain information on the array.
Create an array containing the projection of the map.
Create an array containing the projection of the map .
def projmap(self, map, vec2pix_func, rot=None, coord=None):
        """Create an array containing the projection of the map.

        Input:
          - vec2pix_func: a function taking theta,phi and returning pixel number
          - map: an array containing the spherical map to project,
                 the pixelisation is described by vec2pix_func
        Return:
          - a 2D array with the projection of the map.

        Note: the Projector must contain information on the array.
        """
        x, y = self.ij2xy()
        if np.__version__ >= "1.1":
            matype = np.ma.core.MaskedArray
        else:
            matype = np.ma.array
        if type(x) is matype and x.mask is not np.ma.nomask:
            w = x.mask == False
        else:
            w = slice(None)
        img = np.zeros(x.shape, np.float64) - np.inf
        vec = self.xy2vec(np.asarray(x[w]), np.asarray(y[w]))
        vec = (R.Rotator(rot=rot, coord=self.mkcoord(coord))).I(vec)
        pix = vec2pix_func(vec[0], vec[1], vec[2])
        # support masked array for map, or a dictionnary (for explicit pixelisation)
        if isinstance(map, matype) and map.mask is not np.ma.nomask:
            mpix = map[pix]
            mpix[map.mask[pix]] = UNSEEN
        elif isinstance(map, dict):
            is_pix_seen = np.in1d(pix, map.keys()).reshape(pix.shape)
            is_pix_unseen = ~is_pix_seen
            mpix = np.zeros_like(img[w])
            mpix[is_pix_unseen] = UNSEEN
            pix_seen = pix[is_pix_seen]
            iterable = (map[p] for p in pix_seen)
            mpix[is_pix_seen] = np.fromiter(iterable, mpix.dtype, count=pix_seen.size)
        else:
            mpix = map[pix]
        img[w] = mpix
        return img
def projmap ( self , map , vec2pix_func , rot = None , coord = None ) : x , y = self . ij2xy ( ) if np . __version__ >= "1.1" : matype = np . ma . core . MaskedArray else : matype = np . ma . array if type ( x ) is matype and x . mask is not np . ma . nomask : w = x . mask == False else : w = slice ( None ) img = np . zeros ( x . shape , np . float64 ) - np . inf vec = self . xy2vec ( np . asarray ( x [ w ] ) , np . asarray ( y [ w ] ) ) vec = ( R . Rotator ( rot = rot , coord = self . mkcoord ( coord ) ) ) . I ( vec ) pix = vec2pix_func ( vec [ 0 ] , vec [ 1 ] , vec [ 2 ] ) # support masked array for map, or a dictionnary (for explicit pixelisation) if isinstance ( map , matype ) and map . mask is not np . ma . nomask : mpix = map [ pix ] mpix [ map . mask [ pix ] ] = UNSEEN elif isinstance ( map , dict ) : is_pix_seen = np . in1d ( pix , map . keys ( ) ) . reshape ( pix . shape ) is_pix_unseen = ~ is_pix_seen mpix = np . zeros_like ( img [ w ] ) mpix [ is_pix_unseen ] = UNSEEN pix_seen = pix [ is_pix_seen ] iterable = ( map [ p ] for p in pix_seen ) mpix [ is_pix_seen ] = np . fromiter ( iterable , mpix . dtype , count = pix_seen . size ) else : mpix = map [ pix ] img [ w ] = mpix return img