Skip to content

Commit cafc323

Browse files
volodymyrssbsipocz
authored andcommitted
always provide unit in mission list request
1 parent a03f301 commit cafc323

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

astroquery/heasarc/core.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22

3+
from typing import Union
34
import warnings
45
from io import StringIO, BytesIO
56
from astropy.table import Table
@@ -86,8 +87,10 @@ def query_mission_cols(self, mission, cache=True, get_query_payload=False,
8687
All other parameters have no effect
8788
"""
8889

89-
response = self.query_region_async(position='0.0 0.0', mission=mission,
90-
radius='361 degree', cache=cache,
90+
response = self.query_region_async(position=coordinates.SkyCoord(0.0, 0.0, unit='deg'),
91+
mission=mission,
92+
radius='361 degree',
93+
cache=cache,
9194
get_query_payload=get_query_payload,
9295
resultsmax=1,
9396
fields='All')
@@ -127,8 +130,8 @@ def query_object_async(self, object_name, mission,
127130

128131
return self.query_async(request_payload, cache=cache)
129132

130-
def query_region_async(self, position, mission, radius,
131-
cache=True, get_query_payload=False,
133+
def query_region_async(self, position: Union[coordinates.SkyCoord, str],
134+
mission, radius, cache=True, get_query_payload=False,
132135
**kwargs):
133136
"""
134137
Query around specific set of coordinates within a given mission
@@ -138,7 +141,7 @@ def query_region_async(self, position, mission, radius,
138141
139142
Parameters
140143
----------
141-
position : `astropy.coordinates` or str
144+
position : `astropy.coordinates.SkyCoord` or str
142145
The position around which to search. It may be specified as a
143146
string in which case it is resolved using online services or as
144147
the appropriate `astropy.coordinates` object. ICRS coordinates

astroquery/heasarc/tests/test_heasarc_remote_isdc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_basic_example(self):
146146
radius='1 degree'
147147
)
148148

149-
assert len(table) == 270
149+
assert len(table) == 274
150150

151151
def test_mission_list(self):
152152
heasarc = Heasarc()
@@ -206,4 +206,4 @@ def test_query_region(self):
206206
)
207207
table = heasarc.query_region(c, mission=mission, radius='1 degree')
208208

209-
assert len(table) == 270
209+
assert len(table) == 274

0 commit comments

Comments
 (0)