jobovy / apogee

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

DR16 Selection function #57

Open DHortaD opened 4 years ago

DHortaD commented 4 years ago

Hey Jo,

I tried cloning Ted's apogee ap2sf apogee branch to run the updated selection function for APOGEE dr16, but I seem to get the following error:

""

apo = apsel.apogeeCombinedSelect(year=7) 0%| | 0/89396 [00:00<?, ?it/s]Warning: no visit in combined spectrum found for data point b'apogee.apo25m.s.stars.N7789.2M00000068+5710233 ' b't9-5094-55874-263' 0

Traceback (most recent call last): File "", line 1, in File "/Users/qpasa/Desktop/apogee-halo/apogee/apogee/apogee/select/apogeeSelect.py", line 2169, in init apo1sel = apogee1Select(year=self.apo1year, mjd=mjd, sample=sample, locations=ap1_locations, _justprocessobslog=_justprocessobslog) File "/Users/qpasa/Desktop/apogee-halo/apogee/apogee/apogee/select/apogeeSelect.py", line 731, in init self._load_spec_data(sample=sample, mjd=mjd) File "/Users/qpasa/Desktop/apogee-halo/apogee/apogee/apogee/select/apogeeSelect.py", line 1664, in _load_spec_data statIndx= self.determine_statistical(allStar, ) File "/Users/qpasa/Desktop/apogee-halo/apogee/apogee/apogee/select/apogeeSelect.py", line 1505, in determine_statistical avisit= specdata['ALL_VISITS'][ii].split(',')[0].strip() #this is a visit ID TypeError: a bytes-like object is required, not 'str' ""

Could it be that the file from which the selection function is reading has changed from a bytes to a string? it seems to me like a python2-python3 problem? I am running it on python3.

Cheers Danny

jobovy commented 4 years ago

Forwarding to @jmackereth...

jmackereth commented 4 years ago

Hi @DHortaD - lets re-raise this over on my fork, and solve it over there.

jmackereth commented 4 years ago

actually.... I didn't realise you couldn't raise issues in forks. So when I find a solution, i'll post it here.

jmackereth commented 4 years ago

I believe this issue was a bug which was fixed in a commit that I hadn't yet pushed up (https://github.com/jobovy/apogee/commit/51b92092c106a40b0fbf777375b5fe042cddfa10). If you could pull the latest version and re-try, that would be great.

jobovy commented 4 years ago

We just merged the DR14 and DR16 selection functions in 4e2a3e4, so if this is still relevant, please re-test.