From cd528ffcdce8820f54a21a49b1b95abf89bf5170 Mon Sep 17 00:00:00 2001 From: Andy Casey Date: Tue, 19 Sep 2023 05:19:04 -0600 Subject: [PATCH] calculate healpix correctly --- python/apogee_drp/apred/qa.py | 3 ++- python/apogee_drp/apred/rv.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/apogee_drp/apred/qa.py b/python/apogee_drp/apred/qa.py index f2d7d96e..974fe254 100644 --- a/python/apogee_drp/apred/qa.py +++ b/python/apogee_drp/apred/qa.py @@ -4786,7 +4786,8 @@ def old_makeVisHTML(load=None, plate=None, mjd=None, survey=None, apred=None, te apStarRelPath = None if (objtype != 'SKY') & (objid != '2MNone') & (objid != '2M') & (objid != ''): # Find which healpix this star is in - healpix = apload.obj2healpix(objid) + #healpix = apload.obj2healpix(objid) + healpix = apload.get_healpix(jdata["RA"], jdata["DEC"]) healpixgroup = str(healpix // 1000) healpix = str(healpix) diff --git a/python/apogee_drp/apred/rv.py b/python/apogee_drp/apred/rv.py index 7e6926ad..d626ab2a 100644 --- a/python/apogee_drp/apred/rv.py +++ b/python/apogee_drp/apred/rv.py @@ -140,7 +140,7 @@ def doppler_rv(star,apred,telescope,mjd=None,nres=[5,4.25,3.5],windows=None,twea startab['v_apred'] = gitvers startab['mjdbeg'] = np.min(allvisits['mjd'].astype(int)) startab['mjdend'] = np.max(allvisits['mjd'].astype(int)) - startab['healpix'] = apload.obj2healpix(star) + startab['healpix'] = apload.get_healpix(startab["ra"], startab["dec"]) startab['nvisits'] = nallvisits # Copy data from visit tocopy = ['ra','dec','glon','glat','jmag','jerr','hmag','herr','kmag','kerr','src_h','catalogid', @@ -884,7 +884,8 @@ def visitcomb(allvisit,starver,load=None, apred='r13',telescope='apo25m',nres=[5 apstar.header['V_APRED'] = (plan.getgitvers(), 'APOGEE software version') apstar.header['APRED'] = (apred, 'APOGEE reduction version') apstar.header['STARVER'] = (starver, 'apStar version') - apstar.header['HEALPIX'] = ( apload.obj2healpix(allvisit['apogee_id'][0]), 'HEALPix location') + #apstar.header['HEALPIX'] = ( apload.obj2healpix(allvisit['apogee_id'][0]), 'HEALPix location') + apstar.header["HEALPIX"] = (apload.get_healpix(allvisit['ra'].max(),allvisit['dec'].max())[0], 'HEALPix location') try :apstar.header['SNR'] = (np.nanmedian(apstar.flux[0,:]/apstar.err[0,:]), 'Median S/N per apStar pixel') except :apstar.header['SNR'] = (0., 'Median S/N per apStar pixel') apstar.header['RA'] = (allvisit['ra'].max(), 'right ascension, deg, J2000')