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 399 forks source link

Time not supported in epoch values for JPL Horizons queries #1201

Closed hettlage closed 6 years ago

hettlage commented 6 years ago

The following code runs fine:

from astroquery.jplhorizons import Horizons
from astroquery.jplhorizons import conf
conf.horizons_server = 'https://ssd.jpl.nasa.gov/horizons_batch.cgi'
obj = Horizons(id='Ceres', location='568',
               epochs={'start':'2010-01-01',
                       'stop':'2010-03-01',
                       'step':'10d'})
print(obj.ephemerides())

According to the astroquery.jplhorizons documentation, the format for the start and stop time in the epochs dictionary should be “YYYY-MM-DD [HH:MM:SS]”. However, the following code fails:

from astroquery.jplhorizons import Horizons
from astroquery.jplhorizons import conf
conf.horizons_server = 'https://ssd.jpl.nasa.gov/horizons_batch.cgi'
obj = Horizons(id='Ceres', location='568',
               epochs={'start':'2010-01-01 12:00:00',
                       'stop':'2010-03-01',
                       'step':'10d'})
print(obj.ephemerides())

fails with an error (IOError: Cannot parse table column names.), as its request to the JPL server receives the following response:

 INPUT ERROR in VLADD  in following line:
 START_TIME = 2010-01-01 12:00:00
     Too many constants  ^
BATVAR: problem loading execution-control setting:
LINE=START_TIME = 2010-01-01 12:00:00
WLDINI: error loading execution-control file.

!$$SOF
TABLE_TYPE = OBSERVER
QUANTITIES = "1,3,4,8,9,10,18,19,20,21,23,24,27,31,33,36"
COMMAND = "Ceres;"
CENTER = '568'
SOLAR_ELONG = "0,180"
LHA_CUTOFF = 0
CSV_FORMAT = YES
CAL_FORMAT = BOTH
ANG_FORMAT = DEG
START_TIME = 2010-01-01 12:00:00
STOP_TIME = 2010-03-01
STEP_SIZE = 10d
SKIP_DAYLT = NO

The issue seems to be that the START_TIME value is not wrapped in quotes.

bsipocz commented 6 years ago

cc @mkelley @mommermi

mommermi commented 6 years ago

Thanks for this detailed report; this issue has been fixed in #1204

mommermi commented 6 years ago

this is fixed with #1207 and can be closed now