@@ -809,9 +809,9 @@ def get_images(self, position="", radius=__ZERO_ARCMIN_STRING,
809
809
810
810
Parameters
811
811
----------
812
- position : str or `astropy.coordinates` object
812
+ position : str or `astropy.coordinates` object, optional
813
813
Can either be a string of the location, eg 'M51', or the coordinates
814
- of the object.
814
+ of the object. An input is required for either position or observation_ids.
815
815
radius : str or `~astropy.units.Quantity`, optional
816
816
The radius of a region. Defaults to 0.
817
817
missions : string or list, optional
@@ -827,6 +827,7 @@ def get_images(self, position="", radius=__ZERO_ARCMIN_STRING,
827
827
observation_ids : string or list, optional
828
828
A list of observation ID's, you would like to download.
829
829
If this parameter is empty, a cone search will be performed instead using the radius and position.
830
+ An input is required for either position or observation_ids.
830
831
831
832
Returns
832
833
-------
@@ -852,6 +853,8 @@ def get_images(self, position="", radius=__ZERO_ARCMIN_STRING,
852
853
"1342247257", "30002561-25100", "hst_07553_3h_wfpc2_f160bw_pc", "ocli05leq"]
853
854
get_images(observation_ids=observation_ids, missions=missions)
854
855
"""
856
+ if position == "" and observation_ids is None :
857
+ raise ValueError ("An input is required for either position or observation_ids." )
855
858
sanitized_position = self ._sanitize_input_position (position )
856
859
sanitized_radius = self ._sanitize_input_radius (radius )
857
860
sanitized_missions = self ._sanitize_input_mission (missions )
@@ -900,9 +903,9 @@ def get_spectra(self, position="", radius=__ZERO_ARCMIN_STRING,
900
903
901
904
Parameters
902
905
----------
903
- position : str or `astropy.coordinates` object
906
+ position : str or `astropy.coordinates` object, optional
904
907
Can either be a string of the location, eg 'M51', or the coordinates
905
- of the object.
908
+ of the object. An input is required for either position or observation_ids.
906
909
radius : str or `~astropy.units.Quantity`, optional
907
910
The radius of a region. Defaults to 0.
908
911
missions : string or list, optional
@@ -918,6 +921,7 @@ def get_spectra(self, position="", radius=__ZERO_ARCMIN_STRING,
918
921
observation_ids : string or list, optional
919
922
A list of observation ID's, you would like to download.
920
923
If this parameter is empty, a cone search will be performed instead using the radius and position.
924
+ An input is required for either position or observation_ids.
921
925
922
926
Returns
923
927
-------
@@ -945,6 +949,8 @@ def get_spectra(self, position="", radius=__ZERO_ARCMIN_STRING,
945
949
get_spectra(observation_ids=observation_ids, missions=missions)
946
950
947
951
"""
952
+ if position == "" and observation_ids is None :
953
+ raise ValueError ("An input is required for either position or observation_ids." )
948
954
sanitized_position = self ._sanitize_input_position (position )
949
955
sanitized_radius = self ._sanitize_input_radius (radius )
950
956
sanitized_missions = self ._sanitize_input_spectra (missions )
@@ -1368,7 +1374,7 @@ def _build_region_query(self, coordinates, radius, row_limit, json):
1368
1374
select_query = "SELECT "
1369
1375
if row_limit > 0 :
1370
1376
select_query = "" .join ([select_query , "TOP {} " .format (row_limit )])
1371
- elif not row_limit = = - 1 :
1377
+ elif row_limit ! = - 1 :
1372
1378
raise ValueError ("Invalid value of row_limit" )
1373
1379
1374
1380
select_query = "" .join ([select_query , "* " ])
@@ -1408,7 +1414,7 @@ def _build_id_query(self, ids, row_limit, json):
1408
1414
select_query = "SELECT "
1409
1415
if row_limit > 0 :
1410
1416
select_query = "" .join ([select_query , "TOP {} " .format (row_limit )])
1411
- elif not row_limit = = - 1 :
1417
+ elif row_limit ! = - 1 :
1412
1418
raise ValueError ("Invalid value of row_limit" )
1413
1419
1414
1420
select_query = "" .join ([select_query , "* " ])
0 commit comments