Skip to content

Commit d7f362f

Browse files
committed
assume default_role is set
1 parent 46fefaf commit d7f362f

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

astroquery/sdss/core.py

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def query_crossid_async(self, coordinates, *, radius=5. * u.arcsec, timeout=TIME
6666
6767
This query returns the nearest `primary object`_.
6868
69-
Note that there is a server-side limit of 3 arcmin on `radius`.
69+
Note that there is a server-side limit of 3 arcmin on ``radius``.
7070
7171
.. _`primary object`: https://www.sdss.org/dr17/help/glossary/#surveyprimary
7272
@@ -129,10 +129,10 @@ def query_crossid_async(self, coordinates, *, radius=5. * u.arcsec, timeout=TIME
129129
Raises
130130
------
131131
TypeError
132-
If the `radius` keyword could not be parsed as an angle.
132+
If the ``radius`` keyword could not be parsed as an angle.
133133
ValueError
134-
If the `radius` exceeds 3 arcmin, or if the sizes of
135-
`coordinates` and `obj_names` do not match.
134+
If the ``radius`` exceeds 3 arcmin, or if the sizes of
135+
``coordinates`` and ``obj_names`` do not match.
136136
137137
Returns
138138
-------
@@ -208,16 +208,16 @@ def query_region_async(self, coordinates, *, radius=None,
208208
spectro=False, field_help=False, get_query_payload=False,
209209
data_release=conf.default_release, cache=True):
210210
"""
211-
Used to query a region around given coordinates. Either `radius` or
211+
Used to query a region around given coordinates. Either ``radius`` or
212212
`width` must be specified.
213213
214-
When called with keyword `radius`, a radial or "cone" search is
214+
When called with keyword ``radius``, a radial or "cone" search is
215215
performed, centered on each of the given coordinates. In this mode, internally,
216216
this function is equivalent to the object cross-ID (`query_crossid`),
217217
with slightly different parameters. Note that in this mode there is a server-side
218-
limit of 3 arcmin on `radius`.
218+
limit of 3 arcmin on ``radius``.
219219
220-
When called with keyword `width`, and optionally a different `height`,
220+
When called with keyword ``width``, and optionally a different ``height``,
221221
a rectangular search is performed, centered on each of the given
222222
coordinates. In this mode, internally, this function is equivalent to
223223
a general SQL query (`query_sql`).
@@ -286,6 +286,15 @@ def query_region_async(self, coordinates, *, radius=None,
286286
cache : bool, optional
287287
If ``True`` use the request caching mechanism.
288288
289+
Raises
290+
------
291+
TypeError
292+
If the ``radius``, ``width`` or ``height`` keywords could not be parsed as an angle.
293+
ValueError
294+
If both ``radius`` and ``width`` are set (or neither),
295+
or if the ``radius`` exceeds 3 arcmin,
296+
or if the sizes of ``coordinates`` and ``obj_names`` do not match.
297+
289298
Examples
290299
--------
291300
>>> from astroquery.sdss import SDSS
@@ -307,17 +316,6 @@ def query_region_async(self, coordinates, *, radius=None,
307316
The result of the query as a `~astropy.table.Table` object.
308317
309318
"""
310-
# Move Raises section here, since async_to_sync does not appear to like it.
311-
#
312-
# Raises
313-
# ------
314-
# TypeError
315-
# If the `radius`, `width` or `height` keywords could not be parsed as an angle.
316-
# ValueError
317-
# If both `radius` and `width are set (or neither),
318-
# or if the `radius` exceeds 3 arcmin,
319-
# or if the sizes of `coordinates` and `obj_names` do not match.
320-
321319
# Allow field_help requests to pass without requiring a radius or width.
322320
if field_help and radius is None and width is None:
323321
radius = 2.0 * u.arcsec
@@ -1279,7 +1277,7 @@ def _get_crossid_url(self, data_release):
12791277

12801278
def _rectangle_sql(self, ra, dec, width, height=None, cosdec=False):
12811279
"""
1282-
Generate SQL for a rectangular query centered on `ra`, `dec`.
1280+
Generate SQL for a rectangular query centered on ``ra``, ``dec``.
12831281
12841282
This assumes that RA is defined on the range ``[0, 360)``, and Dec on
12851283
``[-90, 90]``.
@@ -1293,9 +1291,11 @@ def _rectangle_sql(self, ra, dec, width, height=None, cosdec=False):
12931291
width : float
12941292
Width of rectangle in degrees.
12951293
height : float, optional
1296-
Height of rectangle in degrees. If not specified, `width` is used.
1294+
Height of rectangle in degrees. If not specified, ``width`` is used.
12971295
cosdec : bool, optional
12981296
If ``True`` apply ``cos(dec)`` correction to the rectangle.
1297+
Otherwise, rectangles become increasingly triangle-like
1298+
near the poles.
12991299
13001300
Returns
13011301
-------
@@ -1312,8 +1312,6 @@ def _rectangle_sql(self, ra, dec, width, height=None, cosdec=False):
13121312
d1 = dec + dd
13131313
if d1 > 90.0:
13141314
d1 = 90.0
1315-
if d1 < d0:
1316-
d0, d1 = d1, d0
13171315
ra_wrap = False
13181316
r0 = ra - dr
13191317
if r0 < 0:

0 commit comments

Comments
 (0)