Skip to content

Commit

Permalink
Added data for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldvb committed Nov 7, 2020
1 parent 1c318f4 commit d2e0300
Show file tree
Hide file tree
Showing 5 changed files with 2,294 additions and 5 deletions.
3 changes: 3 additions & 0 deletions astroquery/imcce/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class Conf(_config.ConfigNamespace):
"""

# server settings
obs_codes_url = _config.ConfigItem(
'http://www.minorplanetcenter.net/iau/lists/ObsCodes.html',
'IAU observatory codes')
ephemcc_server = _config.ConfigItem(
'http://vo.imcce.fr/webservices/miriade/ephemcc_query.php',
'IMCCE/Miriade.ephemcc base server')
Expand Down
9 changes: 6 additions & 3 deletions astroquery/imcce/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_observatory_codes(self, restr=None):
Examples
--------
>>> from astroquery.imcce import Miriade
>>> obs = Miriade.get_observatory_codes('Green') # doctest: +REMOTE_DATA
>>> obs = Miriade.get_observatory_codes(restr='Green') # doctest: +REMOTE_DATA
>>> print(obs) # doctest: +REMOTE_DATA
<Table length=8>
Code Long. cos sin Name
Expand All @@ -70,9 +70,12 @@ def get_observatory_codes(self, restr=None):
Q54 147.28772 0.73929 -0.671278 Harlingten Telescope, Greenhill Observatory
Z54 358.92214 0.623422 0.779306 Greenmoor Observatory, Woodcote
"""
obs_codes_url = 'http://www.minorplanetcenter.net/iau/lists/ObsCodes.html'
URL = conf.obs_codes_url
TIMEOUT = conf.timeout

response = self._request('GET', URL, timeout=TIMEOUT)
if not hasattr(self, '_observatory_codes'):
self._observatory_codes = ascii.read(obs_codes_url,
self._observatory_codes = ascii.read(response.text,
format='fixed_width',
header_start=1,
data_start=2,
Expand Down
Loading

0 comments on commit d2e0300

Please sign in to comment.