gaia-unlimited / gaiaunlimited

Code for GaiaUnlimited Gaia selection function tools
https://gaiaunlimited.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
22 stars 5 forks source link

adding possibility of Nested argument in get_healpix_centers #48

Closed radsouza closed 11 months ago

radsouza commented 1 year ago

Adding this possibility will allow the user to be able to use the nested argument. Furthermore, give the healpix numbering scheme of Gaia, nested should be the default argument.

def get_healpix_centers(order): """Get centers of HEALPix as astropy coordinates.

Args:
    order (int): The order of the pixelisation

Returns:
    astropy.coordinates.SkyCoord: coordinates of the centers.
"""
nside = hp.order2nside(order)
npix = hp.order2npix(order)
ipix = np.arange(npix)
ra, dec = hp.pix2ang(nside, ipix,  lonlat=True)
return coord.SkyCoord(ra * u.deg, dec * u.deg)
TristanCantatGaudin commented 11 months ago

The function get_healpix_centers now takes an optional nest argument. It still defaults to False, which is the behaviour of hp.pix2ang. (commit 2950c2d)