Skip to content

Commit

Permalink
Return int64 from radec2pix (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucchi-cmu authored Nov 22, 2024
1 parent 14ac56d commit 4844911
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/hats/pixel_math/healpix_shim.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def order2pixarea(order: int, degrees: bool = False) -> float:
return pix_area_rad


def radec2pix(order: int, ra: float, dec: float) -> int:
def radec2pix(order: int, ra: float, dec: float) -> np.ndarray[np.int64]:
if not is_order_valid(order):
raise ValueError("Invalid value for order")

ra = Longitude(ra, unit="deg")
dec = Latitude(dec, unit="deg")

return cdshealpix.lonlat_to_healpix(ra, dec, order)
return cdshealpix.lonlat_to_healpix(ra, dec, order).astype(np.int64)


def ring2nest(order: int, ipix: int) -> int:
Expand All @@ -92,15 +92,6 @@ def ang2vec(ra, dec, **kwargs) -> np.ndarray:
return np.array([coords.x.value, coords.y.value, coords.z.value]).T


## FITS
def read_map(*args, **kwargs):
return hp.read_map(*args, **kwargs)


def write_map(*args, **kwargs):
return hp.write_map(*args, **kwargs)


## Custom functions


Expand Down

0 comments on commit 4844911

Please sign in to comment.