Skip to content

Commit 5d9ffe1

Browse files
authored
Merge pull request #779 from imbasimba/master
Fixed bug in Integral query
2 parents 076ba0a + 0009084 commit 5d9ffe1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

astroquery/esasky/core.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,15 +644,14 @@ def _build_observation_query(self, coordinates, radius, json):
644644
from_query = " FROM %s" %json[self.__TAP_TABLE_STRING]
645645
if (radiusDeg != 0 or json[self.__IS_SURVEY_MISSION_STRING]):
646646
if (json[self.__IS_SURVEY_MISSION_STRING]):
647-
area_or_point_string = "pos"
647+
where_query = (" WHERE 1=CONTAINS(pos, CIRCLE('ICRS', %f, %f, %f));"
648+
%(ra, dec, radiusDeg))
648649
else:
649-
area_or_point_string = "fov"
650-
where_query = (" WHERE 1=INTERSECTS(CIRCLE('ICRS', %f, %f, %f), %s);"
651-
%(ra, dec, radiusDeg, area_or_point_string))
650+
where_query = (" WHERE 1=INTERSECTS(CIRCLE('ICRS', %f, %f, %f), fov);"
651+
%(ra, dec, radiusDeg))
652652
else:
653-
area_or_point_string = "fov"
654-
where_query = (" WHERE 1=CONTAINS(POINT('ICRS', %f, %f), %s);"
655-
%(ra, dec, area_or_point_string))
653+
where_query = (" WHERE 1=CONTAINS(POINT('ICRS', %f, %f), fov);"
654+
%(ra, dec))
656655

657656
query = "".join([select_query, metadata_tap_names, from_query,
658657
where_query])

0 commit comments

Comments
 (0)