Exemplo n.º 1
0
 def healpix_for_radec(self, ra, dec):
     '''
     Returns the healpix number for a given single (scalar) RA,Dec.
     '''
     from astrometry.util.util import radecdegtohealpix, healpix_xy_to_ring
     hpxy = radecdegtohealpix(ra, dec, self.nside)
     ipring = healpix_xy_to_ring(hpxy, self.nside)
     return ipring
Exemplo n.º 2
0
 def healpix_for_radec(self, ra, dec):
     '''
     Returns the healpix number for a given single (scalar) RA,Dec.
     '''
     from astrometry.util.util import radecdegtohealpix, healpix_xy_to_ring, healpix_xy_to_nested
     hpxy = radecdegtohealpix(ra, dec, self.nside)
     if self.indexing == 'ring':
         hp = healpix_xy_to_ring(hpxy, self.nside)
     elif self.indexing == 'nested':
         hp = healpix_xy_to_nested(hpxy, self.nside)
     else:
         # assume XY!
         hp = hpxy
     return hp
Exemplo n.º 3
0
    def get_cat(self,ra,dec):
        """Read the healpixed PS1 catalogs given input ra,dec coordinates."""
        from astrometry.util.fits import fits_table, merge_tables
        from astrometry.util.util import radecdegtohealpix, healpix_xy_to_ring
        ipring = np.empty(len(ra)).astype(int)
        for iobj, (ra1, dec1) in enumerate(zip(ra,dec)):
            hpxy = radecdegtohealpix(ra1,dec1,self.nside)
            ipring[iobj] = healpix_xy_to_ring(hpxy,self.nside)
        pix = np.unique(ipring)

        cat = list()
        for ipix in pix:
            fname = os.path.join(self.ps1dir,'ps1-'+'{:05d}'.format(ipix)+'.fits')
            print('Reading {}'.format(fname))
            cat.append(fits_table(fname))
        cat = merge_tables(cat)
        return cat
Exemplo n.º 4
0
    def get_cat(self,ra,dec):
        """Read the healpixed PS1 catalogs given input ra,dec coordinates."""
        from astrometry.util.fits import fits_table, merge_tables
        from astrometry.util.util import radecdegtohealpix, healpix_xy_to_ring
        ipring = np.empty(len(ra)).astype(int)
        for iobj, (ra1, dec1) in enumerate(zip(ra,dec)):
            hpxy = radecdegtohealpix(ra1,dec1,self.nside)
            ipring[iobj] = healpix_xy_to_ring(hpxy,self.nside)
        pix = np.unique(ipring)

        cat = list()
        for ipix in pix:
            fname = os.path.join(self.ps1dir,'ps1-'+'{:05d}'.format(ipix)+'.fits')
            print('Reading {}'.format(fname))
            cat.append(fits_table(fname))
        cat = merge_tables(cat)
        return cat