@@ -101,16 +101,18 @@ def resolve_object(objectname, resolver=None, resolve_all=False):
101
101
The resolver to use when resolving a named target into coordinates. Valid options are "SIMBAD" and "NED".
102
102
If not specified, the default resolver order will be used. Please see the
103
103
`STScI Archive Name Translation Application (SANTA) <https://mastresolver.stsci.edu/Santa-war/>`__
104
- for more information. Default is None.
104
+ for more information. If ``resolve_all`` is True, this parameter will be ignored. Default is None.
105
105
resolve_all : bool, optional
106
106
If True, will try to resolve the object name using all available resolvers ("NED", "SIMBAD").
107
107
Function will return a dictionary where the keys are the resolver names and the values are the
108
108
resolved coordinates. Default is False.
109
109
110
110
Returns
111
111
-------
112
- response : `~astropy.coordinates.SkyCoord`
113
- The sky position of the given object.
112
+ response : `~astropy.coordinates.SkyCoord`, dict
113
+ If `resolve_all` is False, returns a `~astropy.coordinates.SkyCoord` object with the resolved coordinates.
114
+ If `resolve_all` is True, returns a dictionary where the keys are the resolver names and the values are
115
+ `~astropy.coordinates.SkyCoord` objects with the resolved coordinates.
114
116
"""
115
117
is_catalog = False # Flag to check if object name belongs to a MAST catalog
116
118
catalog = None # Variable to store the catalog name
@@ -171,8 +173,9 @@ def resolve_object(objectname, resolver=None, resolve_all=False):
171
173
if resolver_coord .separation (catalog_coord ) > 1 * u .arcsec :
172
174
# Warn user if the coordinates differ by more than 1 arcsec
173
175
warnings .warn (f'Resolver { resolver } returned coordinates that differ from MAST { catalog } catalog '
174
- 'by more than 0. 1 arcsec. ' , InputWarning )
176
+ 'by more than 1 arcsec. ' , InputWarning )
175
177
178
+ log .debug (f'Coordinates resolved using { resolver } : { resolver_coord } ' )
176
179
return resolver_coord
177
180
178
181
if not result :
@@ -187,7 +190,9 @@ def resolve_object(objectname, resolver=None, resolve_all=False):
187
190
188
191
# Case when resolve_all is False and no resolver is specified
189
192
# SANTA returns result from first compatible resolver
190
- return SkyCoord (result [0 ]['ra' ], result [0 ]['decl' ], unit = 'deg' )
193
+ coord = SkyCoord (result [0 ]['ra' ], result [0 ]['decl' ], unit = 'deg' )
194
+ log .debug (f'Coordinates resolved using { result [0 ]["resolver" ]} : { coord } ' )
195
+ return coord
191
196
192
197
193
198
def parse_input_location (coordinates = None , objectname = None , resolver = None ):
@@ -224,7 +229,7 @@ def parse_input_location(coordinates=None, objectname=None, resolver=None):
224
229
raise InvalidQueryError ("One of objectname and coordinates must be specified." )
225
230
226
231
if not objectname and resolver :
227
- warnings .warn ("Resolver is only used when resolving object names. It will be ignored." , InputWarning )
232
+ warnings .warn ("Resolver is only used when resolving object names and will be ignored." , InputWarning )
228
233
229
234
if objectname :
230
235
obj_coord = resolve_object (objectname , resolver )
0 commit comments