Skip to content

Commit 777f80b

Browse files
committed
Fix spec query not working for DR >= 12
1 parent bcef716 commit 777f80b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

astroquery/sdss/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ def query_crossid_async(self, coordinates, obj_names=None,
144144

145145
sql_query += ',dbo.fPhotoTypeN(p.type) as type \
146146
FROM #upload u JOIN #x x ON x.up_id = u.up_id \
147-
JOIN PhotoObjAll p ON p.objID = x.objID ORDER BY x.up_id'
147+
JOIN PhotoObjAll p ON p.objID = x.objID '
148+
if specobj_fields:
149+
sql_query += 'JOIN SpecObjAll s ON p.objID = s.bestObjID '
150+
sql_query += 'ORDER BY x.up_id'
148151

149152
data = "obj_id ra dec \n"
150153
data += " \n ".join(['{0} {1} {2}'.format(obj_names[i],

0 commit comments

Comments
 (0)