@@ -101,16 +101,18 @@ def resolve_object(objectname, resolver=None, resolve_all=False):
101101 The resolver to use when resolving a named target into coordinates. Valid options are "SIMBAD" and "NED".
102102 If not specified, the default resolver order will be used. Please see the
103103 `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.
105105 resolve_all : bool, optional
106106 If True, will try to resolve the object name using all available resolvers ("NED", "SIMBAD").
107107 Function will return a dictionary where the keys are the resolver names and the values are the
108108 resolved coordinates. Default is False.
109109
110110 Returns
111111 -------
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.
114116 """
115117 is_catalog = False # Flag to check if object name belongs to a MAST catalog
116118 catalog = None # Variable to store the catalog name
@@ -171,8 +173,9 @@ def resolve_object(objectname, resolver=None, resolve_all=False):
171173 if resolver_coord .separation (catalog_coord ) > 1 * u .arcsec :
172174 # Warn user if the coordinates differ by more than 1 arcsec
173175 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 )
175177
178+ log .debug (f'Coordinates resolved using { resolver } : { resolver_coord } ' )
176179 return resolver_coord
177180
178181 if not result :
@@ -187,7 +190,9 @@ def resolve_object(objectname, resolver=None, resolve_all=False):
187190
188191 # Case when resolve_all is False and no resolver is specified
189192 # 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
191196
192197
193198def parse_input_location (coordinates = None , objectname = None , resolver = None ):
@@ -224,7 +229,7 @@ def parse_input_location(coordinates=None, objectname=None, resolver=None):
224229 raise InvalidQueryError ("One of objectname and coordinates must be specified." )
225230
226231 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 )
228233
229234 if objectname :
230235 obj_coord = resolve_object (objectname , resolver )
0 commit comments