Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DarkEnergySurvey/ugali
Browse files Browse the repository at this point in the history
Conflicts:
	ugali/utils/healpix.py
  • Loading branch information
kadrlica committed Sep 11, 2017
2 parents 9ec876b + fb0b8ae commit 76aafc2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ugali/utils/healpix.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ def lon2phi(lon): return np.radians(lon)
def theta2lat(theta): return 90. - np.degrees(theta)
def lat2theta(lat): return np.radians(90. - lat)

def pix2ang(nside, pix):
def pix2ang(nside, pix, nest=False):
"""
Return (lon, lat) in degrees instead of (theta, phi) in radians
"""
theta, phi = hp.pix2ang(nside, pix)
theta, phi = hp.pix2ang(nside, pix, nest=nest)
lon = phi2lon(phi)
lat = theta2lat(theta)
return lon, lat

def ang2pix(nside, lon, lat):
def ang2pix(nside, lon, lat, nest=False):
"""
Input (lon, lat) in degrees instead of (theta, phi) in radians
"""
theta = np.radians(90. - lat)
phi = np.radians(lon)
return hp.ang2pix(nside, theta, phi)
return healpy.ang2pix(nside, theta, phi, nest=nest)

def ang2vec(lon, lat):
theta = lat2theta(lat)
Expand Down

0 comments on commit 76aafc2

Please sign in to comment.