@@ -47,6 +47,9 @@ class MastMissionsClass(MastQueryWithLogin):
4747 'spectral_type' , 'bmv0_mag' , 'u_mag' , 'b_mag' , 'v_mag' , 'gaia_g_mean_mag' , 'star_mass' ,
4848 'instrument' , 'grating' , 'filter' , 'observation_id' ]
4949
50+ # maximum supported query radius
51+ _max_query_radius = 30 * u .arcmin
52+
5053 def __init__ (self , * , mission = 'hst' , mast_token = None ):
5154 super ().__init__ (mast_token = mast_token )
5255
@@ -217,6 +220,7 @@ def query_region_async(self, coordinates, *, radius=3*u.arcmin, limit=5000, offs
217220 Default is 3 arcminutes. The radius around the coordinates to search within.
218221 The string must be parsable by `~astropy.coordinates.Angle`. The
219222 appropriate `~astropy.units.Quantity` object from `~astropy.units` may also be used.
223+ The maximum supported query radius is 30 arcminutes.
220224 limit : int
221225 Default is 5000. The maximum number of dataset IDs in the results.
222226 offset : int
@@ -235,6 +239,11 @@ def query_region_async(self, coordinates, *, radius=3*u.arcmin, limit=5000, offs
235239 Returns
236240 -------
237241 response : list of `~requests.Response`
242+
243+ Raises
244+ ------
245+ InvalidQueryError
246+ If the query radius is larger than the limit (30 arcminute).
238247 """
239248
240249 self .limit = limit
@@ -249,6 +258,11 @@ def query_region_async(self, coordinates, *, radius=3*u.arcmin, limit=5000, offs
249258 # If radius is just a number, assume arcminutes
250259 radius = coord .Angle (radius , u .arcmin )
251260
261+ if radius > self ._max_query_radius :
262+ raise InvalidQueryError (
263+ f"Query radius too large. Must be ≤{ self ._max_query_radius } , got { radius } ."
264+ )
265+
252266 # Dataset ID column should always be returned
253267 if select_cols :
254268 select_cols .append (self .dataset_kwds .get (self .mission , None ))
@@ -284,6 +298,7 @@ def query_criteria_async(self, *, coordinates=None, objectname=None, radius=3*u.
284298 Default is 3 arcminutes. The radius around the coordinates to search within.
285299 The string must be parsable by `~astropy.coordinates.Angle`. The
286300 appropriate `~astropy.units.Quantity` object from `~astropy.units` may also be used.
301+ The maximum supported query radius is 30 arcminutes.
287302 limit : int
288303 Default is 5000. The maximum number of dataset IDs in the results.
289304 offset : int
@@ -310,6 +325,11 @@ def query_criteria_async(self, *, coordinates=None, objectname=None, radius=3*u.
310325 Returns
311326 -------
312327 response : list of `~requests.Response`
328+
329+ Raises
330+ ------
331+ InvalidQueryError
332+ If the query radius is larger than the limit (30 arcminute).
313333 """
314334
315335 self .limit = limit
@@ -327,6 +347,11 @@ def query_criteria_async(self, *, coordinates=None, objectname=None, radius=3*u.
327347 # if radius is just a number we assume degrees
328348 radius = coord .Angle (radius , u .arcmin )
329349
350+ if radius > self ._max_query_radius :
351+ raise InvalidQueryError (
352+ f"Query radius too large. Must be ≤{ self ._max_query_radius } , got { radius } ."
353+ )
354+
330355 # Dataset ID column should always be returned
331356 if select_cols :
332357 select_cols .append (self .dataset_kwds .get (self .mission , None ))
0 commit comments