jobovy / apogee

Tools for dealing with APOGEE data
BSD 3-Clause "New" or "Revised" License
43 stars 25 forks source link

deprecation error in esutil? #36

Closed aburgasser closed 7 years ago

aburgasser commented 8 years ago

I found some deprecated command in esutil.htm when trying to remove duplicates

In [3]: allStar= apread.allStar(rmcommissioning=True,rmdups=True) ---------------------------------------------------------------------------e ... RuntimeError Traceback (most recent call last)

in () ----> 1 allStar= apread.allStar(rmcommissioning=True,rmdups=True) /Users/adam/projects/FAST/apogee/apogee/tools/read.py in allStar(rmcommissioning, main, exclude_star_bad, exclude_star_warn, ak, akvers, rmnovisits, adddist, distredux, rmdups, raw) 135 sys.stdout.write('\r'+"Removing duplicates (might take a while) and caching the duplicate-free file ...\r") 136 sys.stdout.flush() --> 137 data= remove_duplicates(data) 138 #Cache this file for subsequent use of rmdups 139 fitsio.write(dupsFilename,data,clobber=True) /Users/adam/projects/FAST/apogee/apogee/tools/read.py in remove_duplicates(data) 757 #Match the data against itself 758 h=esutil.htm.HTM() --> 759 htmrev2,minid,maxid = h.match_prepare(data['RA'],data['DEC']) 760 m1,m2,d12 = h.match(data['RA'],data['DEC'], 761 data['RA'],data['DEC'], /usr/local/lib/python3.4/site-packages/esutil/htm/htm.py in match_prepare(self, ra, dec, verbose) 254 """ 255 --> 256 raise RuntimeError('deprecated: use a htm.Matcher instead') 257 258 if verbose: RuntimeError: deprecated: use a htm.Matcher instead
jobovy commented 8 years ago

I think I fixed this, but esutil is giving me a segmentation fault when I try to run it, so I can't test whether it works. Let me know if this fixed it for you. Otherwise just run with rmdups=False and use the EXTRATARG bitmask to remove duplicates (http://www.sdss.org/dr13/algorithms/bitmasks/#APOGEE_EXTRATARG).

jobovy commented 7 years ago

I think this is fixed, since I've been able to run the new code and didn't notice a problem.