Skip to content

Commit f9b659d

Browse files
authored
Merge pull request #2601 from bsipocz/BUG_skyview_radius
BUG: fix skyview radius
2 parents cd8c963 + ed9cdb7 commit f9b659d

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

CHANGES.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ simbad
136136
radius as a string in ``query_region()`` and ``query_region_async()``.
137137
[#2494]
138138

139+
skyview
140+
^^^^^^^
141+
142+
- Fix bug for ``radius`` parameter to not behave as diameter. [#2601]
143+
144+
- Optional keyword arguments are now keyword only. [#2601]
145+
139146
svo_fps
140147
^^^^^^^
141148

astroquery/skyview/core.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _submit_form(self, input=None, cache=True):
8585
response.raise_for_status()
8686
return response
8787

88-
def get_images(self, position, survey, coordinates=None, projection=None,
88+
def get_images(self, position, survey, *, coordinates=None, projection=None,
8989
pixels=None, scaling=None, sampler=None, resolver=None,
9090
deedger=None, lut=None, grid=None, gridlabels=None,
9191
radius=None, height=None, width=None, cache=True,
@@ -172,7 +172,8 @@ def get_images(self, position, survey, coordinates=None, projection=None,
172172
gridlabels : bool
173173
annotate the grid with coordinates positions if True
174174
radius : `~astropy.units.Quantity` or None
175-
The radius of the specified field. Overrides width and height.
175+
The angular radius of the specified field.
176+
Overrides the ``width`` and ``height`` parameters.
176177
width : `~astropy.units.Quantity` or None
177178
The width of the specified field. Must be specified
178179
with ``height``.
@@ -197,18 +198,16 @@ def get_images(self, position, survey, coordinates=None, projection=None,
197198
A list of `~astropy.io.fits.HDUList` objects.
198199
199200
"""
200-
readable_objects = self.get_images_async(position, survey, coordinates,
201-
projection, pixels, scaling,
202-
sampler, resolver, deedger,
203-
lut, grid, gridlabels,
204-
radius=radius, height=height,
205-
width=width,
206-
cache=cache,
207-
show_progress=show_progress)
201+
readable_objects = self.get_images_async(position, survey, coordinates=coordinates,
202+
projection=projection, pixels=pixels, scaling=scaling,
203+
sampler=sampler, resolver=resolver, deedger=deedger,
204+
lut=lut, grid=grid, gridlabels=gridlabels,
205+
radius=radius, height=height, width=width,
206+
cache=cache, show_progress=show_progress)
208207
return [obj.get_fits() for obj in readable_objects]
209208

210209
@prepend_docstr_nosections(get_images.__doc__)
211-
def get_images_async(self, position, survey, coordinates=None,
210+
def get_images_async(self, position, survey, *, coordinates=None,
212211
projection=None, pixels=None, scaling=None,
213212
sampler=None, resolver=None, deedger=None, lut=None,
214213
grid=None, gridlabels=None, radius=None, height=None,
@@ -218,18 +217,18 @@ def get_images_async(self, position, survey, coordinates=None,
218217
-------
219218
A list of context-managers that yield readable file-like objects
220219
"""
221-
image_urls = self.get_image_list(position, survey, coordinates,
222-
projection, pixels, scaling, sampler,
223-
resolver, deedger, lut, grid,
224-
gridlabels, radius=radius,
220+
image_urls = self.get_image_list(position, survey, coordinates=coordinates,
221+
projection=projection, pixels=pixels, scaling=scaling, sampler=sampler,
222+
resolver=resolver, deedger=deedger, lut=lut, grid=grid,
223+
gridlabels=gridlabels, radius=radius,
225224
height=height, width=width,
226225
cache=cache)
227226
return [commons.FileContainer(url, encoding='binary',
228227
show_progress=show_progress)
229228
for url in image_urls]
230229

231230
@prepend_docstr_nosections(get_images.__doc__, sections=['Returns', 'Examples'])
232-
def get_image_list(self, position, survey, coordinates=None,
231+
def get_image_list(self, position, survey, *, coordinates=None,
233232
projection=None, pixels=None, scaling=None,
234233
sampler=None, resolver=None, deedger=None, lut=None,
235234
grid=None, gridlabels=None, radius=None, width=None,
@@ -251,7 +250,7 @@ def get_image_list(self, position, survey, coordinates=None,
251250
self._validate_surveys(survey)
252251

253252
if radius is not None:
254-
size_deg = str(radius.to(u.deg).value)
253+
size_deg = str(radius.to(u.deg).value * 2)
255254
elif width and height:
256255
size_deg = "{0},{1}".format(width.to(u.deg).value,
257256
height.to(u.deg).value)

0 commit comments

Comments
 (0)