77
88from astropy .io import votable , fits
99from astropy .table import Table
10+ from astropy .utils .decorators import deprecated_renamed_argument
11+ from astropy .utils .exceptions import AstropyDeprecationWarning
1012
1113from astroquery .query import BaseQuery
1214from astroquery .utils import class_or_instance
@@ -56,8 +58,8 @@ def _validate_nafid_input_type(self, params):
5658 If the input does not have the minimum required parameters set to
5759 an at least truthy value.
5860 """
59- if not params .get ("obj_nafid " , False ):
60- raise ValueError ("When input type is 'nafid_input ' key 'obj_nafid ' is required." )
61+ if not params .get ("obj_naifid " , False ):
62+ raise ValueError ("When input type is 'naifid_input ' key 'obj_naifid ' is required." )
6163
6264 def _validate_mpc_input_type (self , params ):
6365 """
@@ -148,15 +150,15 @@ def _validate_input(self, params):
148150
149151 if input_type == "name_input" :
150152 self ._validate_name_input_type (params )
151- elif input_type == "nafid_input " :
153+ elif input_type == "naifid_input " :
152154 self ._validate_nafid_input_type (params )
153155 elif input_type == "mpc_input" :
154156 self ._validate_mpc_input_type (params )
155157 elif input_type == "manual_input" :
156158 self ._validate_manual_input_type (params )
157159 else :
158160 raise ValueError (
159- "Unrecognized 'input_type'. Expected `name_input`, `nafid_input ` "
161+ "Unrecognized 'input_type'. Expected `name_input`, `naifid_input ` "
160162 f"`mpc_input` or `manual_input`, got { input_type } instead."
161163 )
162164
@@ -229,8 +231,9 @@ def list_catalogs(self):
229231 catalogs .remove ("--- Internal use only:" )
230232 return catalogs
231233
234+ @deprecated_renamed_argument ('obj_nafid' , 'obj_naifid' , since = '0.4.12' )
232235 def get_images (self , catalog = "wise_merge" , input_mode = "name_input" , ephem_step = 0.25 ,
233- obs_begin = None , obs_end = None , obj_name = None , obj_nafid = None , obj_type = None ,
236+ obs_begin = None , obs_end = None , obj_name = None , obj_naifid = None , obj_type = None ,
234237 mpc_data = None , body_designation = None , epoch = None , eccentricity = None ,
235238 inclination = None , arg_perihelion = None , ascend_node = None , semimajor_axis = None ,
236239 mean_anomaly = None , perih_dist = None , perih_time = None , get_query_payload = False ,
@@ -268,8 +271,8 @@ def get_images(self, catalog="wise_merge", input_mode="name_input", ephem_step=0
268271 obj_name : str or None
269272 Object name.
270273 Required when input mode is ``"name_input"``.
271- obj_nafid : str or None
272- Object NAIFD .
274+ obj_naifid : str or None
275+ Object NAIF ID .
273276 Required when input mode is ``"naifid_input"``.
274277 obj_type : str or None
275278 Object type, ``"Asteroid"`` or ``Comet``.
@@ -328,6 +331,14 @@ def get_images(self, catalog="wise_merge", input_mode="name_input", ephem_step=0
328331 images : list
329332 A list of `~astropy.io.fits.HDUList` objects.
330333 """
334+ if input_mode == "nafid_input" :
335+ warnings .warn (
336+ "'nafid_input' is deprecated; use 'naifid_input' instead (the API value is 'naifid_input')." ,
337+ AstropyDeprecationWarning ,
338+ stacklevel = 2 ,
339+ )
340+ input_mode = "naifid_input"
341+
331342 # We insist on output_mode being regular so that it executes quicker,
332343 # and we insist on tarballs so the download is quicker. We ignore
333344 # whatever else user provides, but leave the parameters as arguments to
@@ -339,7 +350,7 @@ def get_images(self, catalog="wise_merge", input_mode="name_input", ephem_step=0
339350 obs_end = obs_end ,
340351 ephem_step = ephem_step ,
341352 obj_name = obj_name ,
342- obj_nafid = obj_nafid ,
353+ obj_naifid = obj_naifid ,
343354 obj_type = obj_type ,
344355 mpc_data = mpc_data ,
345356 body_designation = body_designation ,
@@ -376,9 +387,10 @@ def get_images(self, catalog="wise_merge", input_mode="name_input", ephem_step=0
376387 return images
377388
378389 @class_or_instance
390+ @deprecated_renamed_argument ('obj_nafid' , 'obj_naifid' , since = '0.4.12' )
379391 def query_object (self , catalog = "wise_merge" , input_mode = "name_input" , output_mode = "Regular" ,
380392 ephem_step = 0.25 , with_tarballs = False , obs_begin = None , obs_end = None ,
381- obj_name = None , obj_nafid = None , obj_type = None , mpc_data = None ,
393+ obj_name = None , obj_naifid = None , obj_type = None , mpc_data = None ,
382394 body_designation = None , epoch = None , eccentricity = None , inclination = None ,
383395 arg_perihelion = None , ascend_node = None , semimajor_axis = None , mean_anomaly = None ,
384396 perih_dist = None , perih_time = None , get_query_payload = False ):
@@ -437,8 +449,8 @@ def query_object(self, catalog="wise_merge", input_mode="name_input", output_mod
437449 obj_name : str or None
438450 Object name.
439451 Required when input mode is ``"name_input"``.
440- obj_nafid : str or None
441- Object NAIFD
452+ obj_naifid : str or None
453+ Object NAIF ID.
442454 Required when input mode is ``"naifid_input"``.
443455 obj_type : str or None
444456 Object type, ``"Asteroid"`` or ``Comet``
@@ -498,6 +510,14 @@ def query_object(self, catalog="wise_merge", input_mode="name_input", output_mod
498510 in ``"VOTable"`` an `~astropy.io.votable.tree.VOTableFile`. See
499511 module help for more details on the content of these tables.
500512 """
513+ if input_mode == "nafid_input" :
514+ warnings .warn (
515+ "'nafid_input' is deprecated; use 'naifid_input' instead (the API value is 'naifid_input')." ,
516+ AstropyDeprecationWarning ,
517+ stacklevel = 2 ,
518+ )
519+ input_mode = "naifid_input"
520+
501521 # This is a map between the keyword names used by the MOST cgi-bin
502522 # service and their more user-friendly names. For example,
503523 # input_type -> input_mode or fits_region_files --> with tarballs
@@ -510,7 +530,7 @@ def query_object(self, catalog="wise_merge", input_mode="name_input", output_mod
510530 "ephem_step" : ephem_step ,
511531 "fits_region_files" : "on" if with_tarballs else "" ,
512532 "obj_name" : obj_name ,
513- "obj_nafid " : obj_nafid ,
533+ "obj_naifid " : obj_naifid ,
514534 "obj_type" : obj_type ,
515535 "mpc_data" : mpc_data ,
516536 "body_designation" : body_designation ,
0 commit comments