astropy / astroquery

Functions and classes to access online data resources. Maintainers: @keflavich and @bsipocz and @ceb8
http://astroquery.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
706 stars 400 forks source link

JPL SBDB query fails for wildcard query of '467P*' #2905

Closed ttmc closed 11 months ago

ttmc commented 11 months ago

I just used the Python REPL (with Python 3.12.1) as follows:

>>> from astroquery.jplsbdb import SBDB
>>> result = SBDB.query('467P*')
>>> print(SBDB.schematic(result))
+-- moreInfo: https://ssd-api.jpl.nasa.gov/doc/sbdb.html
+-- message: specified object was not found
+-- code: 200

Note the asterisk at the end of the query string '467P*'.

The above result can happen for lost comets, such as comet 3D (i.e. a search for '3P' fails the same as the above query), but 467P is not lost* as of today. In fact, a search for '467P' (without the wildcard asterisk on the end) works:

>>> result = SBDB.query('467P')
>>> print(SBDB.schematic(result))
+-+ object: 
| +-- pha: False
| +-- neo: False
| +-- fullname: 467P/LINEAR-Grauer
| +-- prefix: P
| +-+ orbit_class: 
| | +-- code: JFc
| | +-- name: Jupiter-family Comet
| +-- orbit_id: 14
| +-- des: 467P
| +-- kind: cn
| +-- spkid: 1003153
+-+ signature: 
| +-- version: 1.3
| +-- source: NASA/JPL Small-Body Database (SBDB) API
+-+ orbit: 
| +-- two_body: None
| +-- cov_epoch: 2456140.5 d
| +-- n_obs_used: 94
| +-- epoch: 2456140.5 d
| +-- n_dop_obs_used: None
| +-- orbit_id: 14
| +-- not_valid_after: None
| +-- n_del_obs_used: None
| +-+ elements: 
| | +-- e: 0.0739
| | +-- e_sig: 2.9e-06
| | +-- a: 5.68 AU
| | +-- a_sig: 3.6e-06 AU
| | +-- q: 5.26 AU
| | +-- q_sig: 1.4e-05 AU
| | +-- i: 2.55 deg
| | +-- i_sig: 5.7e-05 deg
| | +-- om: 44.1 deg
| | +-- om_sig: 0.00059 deg
| | +-- w: 263.0 deg
| | +-- w_sig: 0.0012 deg
| | +-- ma: 96.2 deg
| | +-- ma_sig: 0.00058 deg
| | +-- tp: 2454818.316 d
| | +-- tp_sig: 0.0092 d
| | +-- per: 4950.0 d
| | +-- per_sig: 0.0047 d
| | +-- n: 0.0727 deg / d
| | +-- n_sig: 6.9e-08 deg / d
| | +-- ad: 6.1 AU
| | +-- ad_sig: 3.9e-06 AU
| +-- producer: Otto Matic
| +-- soln_date: 2023-10-11 04:52:10
| +-- model_pars: []
| +-- moid: 4.25 AU
| +-- equinox: J2000
| +-- pe_used: DE441
| +-- comment: None
| +-- sb_used: SB441-N16
| +-- t_jup: 2.998
| +-- rms: 0.73
| +-- not_valid_before: None
| +-- data_arc: 5182
| +-- first_obs: 2009-07-14
| +-- condition_code: 1
| +-- moid_jup: 0.182 AU
| +-- source: JPL
| +-- last_obs: 2023-09-21

I looped over all the numbered comets (1 through 472 as of today), and 467 is the only one with the above issue. Fragmented comets return a different response ("specified query matched more than one object") but that's okay; it's not incorrect.

bsipocz commented 11 months ago

@ttmc - Your wild-carded query works for me. what version of astroquery are you using? (if not the dev branch, then I would suggest to update with python -m pip install -U --pre astroquery

In [1]: >>> from astroquery.jplsbdb import SBDB
   ...: >>> result = SBDB.query('467P*')
   ...: >>> print(SBDB.schematic(result))
+-+ object: 
| +-+ orbit_class: 
| | +-- code: JFc
| | +-- name: Jupiter-family Comet
| +-- pha: False
| +-- orbit_id: 14
| +-- kind: cn
| +-- fullname: 467P/LINEAR-Grauer
| +-- prefix: P
| +-- des: 467P
| +-- neo: False
| +-- spkid: 1003153
+-+ orbit: 
| +-- orbit_id: 14
| +-- two_body: None
| +-- pe_used: DE441
| +-- data_arc: 5182
| +-- n_del_obs_used: None
| +-- cov_epoch: 2456140.5 d
| +-- first_obs: 2009-07-14
| +-- rms: 0.73
| +-- n_dop_obs_used: None
| +-- source: JPL
| +-- n_obs_used: 94
| +-- sb_used: SB441-N16
| +-- moid: 4.25 AU
| +-- not_valid_before: None
| +-- epoch: 2456140.5 d
| +-- comment: None
| +-+ elements: 
| | +-- e: 0.0739
| | +-- e_sig: 2.9e-06
| | +-- a: 5.68 AU
| | +-- a_sig: 3.6e-06 AU
| | +-- q: 5.26 AU
| | +-- q_sig: 1.4e-05 AU
| | +-- i: 2.55 deg
| | +-- i_sig: 5.7e-05 deg
| | +-- om: 44.1 deg
| | +-- om_sig: 0.00059 deg
| | +-- w: 263.0 deg
| | +-- w_sig: 0.0012 deg
| | +-- ma: 96.2 deg
| | +-- ma_sig: 0.00058 deg
| | +-- tp: 2454818.316 d
| | +-- tp_sig: 0.0092 d
| | +-- per: 4950.0 d
| | +-- per_sig: 0.0047 d
| | +-- n: 0.0727 deg / d
| | +-- n_sig: 6.9e-08 deg / d
| | +-- ad: 6.1 AU
| | +-- ad_sig: 3.9e-06 AU
| +-- soln_date: 2023-10-11 04:52:10
| +-- moid_jup: 0.182 AU
| +-- condition_code: 1
| +-- not_valid_after: None
| +-- equinox: J2000
| +-- model_pars: []
| +-- t_jup: 2.998
| +-- producer: Otto Matic
| +-- last_obs: 2023-09-21
+-+ signature: 
| +-- source: NASA/JPL Small-Body Database (SBDB) API
| +-- version: 1.3
ttmc commented 11 months ago

@bsipocz I just did a "normal" update of the astroquery package (with no --pre) but still had the same issue. Then I upgraded to the dev branch (by adding the --pre) as you suggested, and sure enough, the query for '467P*' now works.

I'm reluctant to close this issue, because for "normal" users of astroquery, it's still an issue. Maybe leave this issue open until the dev branch gets merged into the main branch?

bsipocz commented 11 months ago

@ttmc - We do close this issue, as the issue tracker is only supposed to track issues that are not yet fixed. Also, please note that the documentation clearly states that for astroquery the recommended way to install is with --pre (we do push out a lot of dev releases to pypi that contain hotfixes to address changes to server changes, so the library not at all like a usual backward compatible one.

bsipocz commented 11 months ago

https://astroquery.readthedocs.io/en/latest/#installation