diff --git a/CHANGES.rst b/CHANGES.rst index b0d7964ee2..17174b6013 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -28,6 +28,11 @@ linelists.cdms - Add a keyword to control writing of new species cache files. This is needed to prevent tests from overwriting those files. [#3297] +eso +^^^ + +- Use TAP backend instead of WDB. [#3141] + heasarc ^^^^^^^ diff --git a/astroquery/eso/__init__.py b/astroquery/eso/__init__.py index af287ef28a..c2b0e466fa 100644 --- a/astroquery/eso/__init__.py +++ b/astroquery/eso/__init__.py @@ -11,14 +11,14 @@ class Conf(_config.ConfigNamespace): """ row_limit = _config.ConfigItem( - 50, + 1000, 'Maximum number of rows returned (set to -1 for unlimited).') username = _config.ConfigItem( "", 'Optional default username for ESO archive.') - query_instrument_url = _config.ConfigItem( - "http://archive.eso.org/wdb/wdb/eso", - 'Root query URL for main and instrument queries.') + tap_url = _config.ConfigItem( + "https://archive.eso.org/tap_obs", + 'URL for TAP queries.') conf = Conf() diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 421e6fd81a..97712721e9 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -1,59 +1,59 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +===================== +ESO Astroquery Module +===================== +European Southern Observatory (ESO) +""" import base64 import email +import functools import json +import os import os.path +import sys import re import shutil import subprocess import time import warnings -import webbrowser import xml.etree.ElementTree as ET -from io import BytesIO -from typing import List, Optional, Tuple, Dict, Set +from typing import List, Optional, Tuple, Dict, Set, Union +import astropy.table import astropy.utils.data import keyring import requests.exceptions from astropy.table import Table, Column from astropy.utils.decorators import deprecated_renamed_argument from bs4 import BeautifulSoup +from pyvo.dal import TAPService +import pyvo.dal.exceptions as pde from astroquery import log from . import conf -from ..exceptions import RemoteServiceError, NoResultsWarning, LoginError +from ..exceptions import RemoteServiceError, LoginError, \ + NoResultsWarning, MaxResultsWarning from ..query import QueryWithLogin from ..utils import schema +from .utils import _UserParams, raise_if_coords_not_valid, reorder_columns, \ + _raise_if_has_deprecated_keys, _py2adql, \ + DEFAULT_LEAD_COLS_PHASE3, DEFAULT_LEAD_COLS_RAW -__doctest_skip__ = ['EsoClass.*'] - - -def _check_response(content): - """ - Check the response from an ESO service query for various types of error - If all is OK, return True - """ - if b"NETWORKPROBLEM" in content: - raise RemoteServiceError("The query resulted in a network " - "problem; the service may be offline.") - elif b"# No data returned !" not in content: - return True +__doctest_skip__ = ['EsoClass.*'] class CalSelectorError(Exception): """ Raised on failure to parse CalSelector's response. """ - pass -class AuthInfo: - def __init__(self, username: str, password: str, token: str): +class _AuthInfo: + def __init__(self, username: str, token: str): self.username = username - self.password = password self.token = token self.expiration_time = self._get_exp_time_from_token() @@ -62,15 +62,52 @@ def _get_exp_time_from_token(self) -> int: decoded_token = base64.b64decode(self.token.split(".")[1] + "==") return int(json.loads(decoded_token)['exp']) - def expired(self) -> bool: + def _expired(self) -> bool: # we anticipate the expiration time by 10 minutes to avoid issues return time.time() > self.expiration_time - 600 +class _EsoNames: + raw_table = "dbo.raw" + phase3_table = "ivoa.ObsCore" + raw_instruments_column = "instrument" + phase3_surveys_column = "obs_collection" + + @staticmethod + def ist_table(instrument_name): + """ + Returns the name of the instrument specific table (IST) + """ + return f"ist.{instrument_name}" + + apex_quicklooks_table = ist_table.__func__("apex_quicklooks") + apex_quicklooks_pid_column = "project_id" + + +def unlimited_max_rec(func): + """ + decorator to overwrite maxrec for specific queries + """ + @functools.wraps(func) + def wrapper(self, *args, **kwargs): + if not isinstance(self, EsoClass): + raise ValueError(f"Expecting EsoClass, found {type(self)}") + + tmpvar = self.maxrec + try: + self.maxrec = sys.maxsize + result = func(self, *args, **kwargs) + finally: + self.maxrec = tmpvar + return result + return wrapper + + class EsoClass(QueryWithLogin): - ROW_LIMIT = conf.row_limit + """ + User facing class to query the ESO archive + """ USERNAME = conf.username - QUERY_INSTRUMENT_URL = conf.query_instrument_url CALSELECTOR_URL = "https://archive.eso.org/calselector/v1/associations" DOWNLOAD_URL = "https://dataportal.eso.org/dataPortal/file/" AUTH_URL = "https://www.eso.org/sso/oidc/token" @@ -78,152 +115,37 @@ class EsoClass(QueryWithLogin): def __init__(self): super().__init__() - self._instrument_list = None - self._survey_list = None - self._auth_info: Optional[AuthInfo] = None + self._auth_info: Optional[_AuthInfo] = None + self._hash = None + self._maxrec = None + self.maxrec = conf.row_limit - def _activate_form(self, response, *, form_index=0, form_id=None, inputs={}, - cache=True, method=None): + @property + def maxrec(self): """ - Parameters - ---------- - method: None or str - Can be used to override the form-specified method + Getter of the maxrec attribute + Safeguard that truncates the number of records returned by a query """ - # Extract form from response - root = BeautifulSoup(response.content, 'html5lib') - if form_id is None: - form = root.find_all('form')[form_index] - else: - form = root.find_all('form', id=form_id)[form_index] - # Construct base url - form_action = form.get('action') - if "://" in form_action: - url = form_action - elif form_action.startswith('/'): - url = '/'.join(response.url.split('/', 3)[:3]) + form_action + return self._maxrec + + @maxrec.setter + def maxrec(self, value): + mr = self._maxrec + + # type check + if not (value is None or isinstance(value, int)): + raise TypeError(f"maxrec attribute must be of type int or None; found {type(value)}") + + if value is None or value < 1: + mr = sys.maxsize else: - url = response.url.rsplit('/', 1)[0] + '/' + form_action - # Identify payload format - fmt = None - form_method = form.get('method').lower() - if form_method == 'get': - fmt = 'get' # get(url, params=payload) - elif form_method == 'post': - if 'enctype' in form.attrs: - if form.attrs['enctype'] == 'multipart/form-data': - fmt = 'multipart/form-data' # post(url, files=payload) - elif form.attrs['enctype'] == 'application/x-www-form-urlencoded': - fmt = 'application/x-www-form-urlencoded' # post(url, data=payload) - else: - raise Exception("enctype={0} is not supported!".format(form.attrs['enctype'])) - else: - fmt = 'application/x-www-form-urlencoded' # post(url, data=payload) - # Extract payload from form - payload = [] - for form_elem in form.find_all(['input', 'select', 'textarea']): - value = None - is_file = False - tag_name = form_elem.name - key = form_elem.get('name') - if tag_name == 'input': - is_file = (form_elem.get('type') == 'file') - value = form_elem.get('value') - if form_elem.get('type') in ['checkbox', 'radio']: - if form_elem.has_attr('checked'): - if not value: - value = 'on' - else: - value = None - elif tag_name == 'select': - if form_elem.get('multiple') is not None: - value = [] - if form_elem.select('option[value]'): - for option in form_elem.select('option[value]'): - if option.get('selected') is not None: - value.append(option.get('value')) - else: - for option in form_elem.select('option'): - if option.get('selected') is not None: - # bs4 NavigableString types have bad, - # undesirable properties that result - # in recursion errors when caching - value.append(str(option.string)) - else: - if form_elem.select('option[value]'): - for option in form_elem.select('option[value]'): - if option.get('selected') is not None: - value = option.get('value') - # select the first option field if none is selected - if value is None: - value = form_elem.select( - 'option[value]')[0].get('value') - else: - # survey form just uses text, not value - for option in form_elem.select('option'): - if option.get('selected') is not None: - value = str(option.string) - # select the first option field if none is selected - if value is None: - value = str(form_elem.select('option')[0].string) - - if key in inputs: - if isinstance(inputs[key], list): - # list input is accepted (for array uploads) - value = inputs[key] - else: - value = str(inputs[key]) - - if (key is not None): # and (value is not None): - if fmt == 'multipart/form-data': - if is_file: - payload.append( - (key, ('', '', 'application/octet-stream'))) - else: - if type(value) is list: - for v in value: - entry = (key, ('', v)) - # Prevent redundant key, value pairs - # (can happen if the form repeats them) - if entry not in payload: - payload.append(entry) - elif value is None: - entry = (key, ('', '')) - if entry not in payload: - payload.append(entry) - else: - entry = (key, ('', value)) - if entry not in payload: - payload.append(entry) - else: - if type(value) is list: - for v in value: - entry = (key, v) - if entry not in payload: - payload.append(entry) - else: - entry = (key, value) - if entry not in payload: - payload.append(entry) - - # for future debugging - self._payload = payload - log.debug("Form: payload={0}".format(payload)) - - if method is not None: - fmt = method - - log.debug("Method/format = {0}".format(fmt)) - - # Send payload - if fmt == 'get': - response = self._request("GET", url, params=payload, cache=cache) - elif fmt == 'multipart/form-data': - response = self._request("POST", url, files=payload, cache=cache) - elif fmt == 'application/x-www-form-urlencoded': - response = self._request("POST", url, data=payload, cache=cache) - - return response + mr = value + + self._maxrec = mr + + def _tap_url(self) -> str: + url = os.environ.get('ESO_TAP_URL', conf.tap_url) + return url def _authenticate(self, *, username: str, password: str) -> bool: """ @@ -240,7 +162,7 @@ def _authenticate(self, *, username: str, password: str) -> bool: response = self._request('GET', self.AUTH_URL, params=url_params) if response.status_code == 200: token = json.loads(response.content)['id_token'] - self._auth_info = AuthInfo(username=username, password=password, token=token) + self._auth_info = _AuthInfo(username=username, token=token) log.info("Authentication successful!") return True else: @@ -271,8 +193,8 @@ def _get_auth_info(self, username: str, *, store_password: bool = False, return username, password - def _login(self, *, username: str = None, store_password: bool = False, - reenter_password: bool = False) -> bool: + def _login(self, *args, username: str = None, store_password: bool = False, + reenter_password: bool = False, **kwargs) -> bool: """ Login to the ESO User Portal. @@ -282,11 +204,11 @@ def _login(self, *, username: str = None, store_password: bool = False, Username to the ESO Public Portal. If not given, it should be specified in the config file. store_password : bool, optional - Stores the password securely in your keyring. Default is False. + Stores the password securely in your keyring. Default is `False`. reenter_password : bool, optional Asks for the password even if it is already stored in the keyring. This is the way to overwrite an already stored passwork - on the keyring. Default is False. + on the keyring. Default is `False`. """ username, password = self._get_auth_info(username=username, @@ -296,248 +218,472 @@ def _login(self, *, username: str = None, store_password: bool = False, return self._authenticate(username=username, password=password) def _get_auth_header(self) -> Dict[str, str]: - if self._auth_info and self._auth_info.expired(): - log.info("Authentication token has expired! Re-authenticating ...") - self._authenticate(username=self._auth_info.username, - password=self._auth_info.password) - if self._auth_info and not self._auth_info.expired(): + if self._auth_info and self._auth_info._expired(): + raise LoginError( + "Authentication token has expired! Please log in again." + ) + if self._auth_info and not self._auth_info._expired(): return {'Authorization': 'Bearer ' + self._auth_info.token} else: return {} - def list_instruments(self, *, cache=True): - """ List all the available instrument-specific queries offered by the ESO archive. + def _maybe_warn_about_table_length(self, table): + """ + Issues a warning when a table is empty or when the + results are truncated + """ + if len(table) < 1: + warnings.warn("Query returned no results", NoResultsWarning) + + if len(table) == self.maxrec: + warnings.warn(f"Results truncated to {self.maxrec}. " + "To retrieve all the records set to None the maxrec attribute", + MaxResultsWarning) + + def _try_download_pyvo_table(self, + query_str: str, + tap: TAPService) -> Optional[astropy.table.Table]: + table_to_return = Table() + + def message(query_str): + return (f"Error executing the following query:\n\n" + f"{query_str}\n\n" + "See examples here: https://archive.eso.org/tap_obs/examples\n\n" + f"For maximum query freedom use the query_tap_service method:\n\n" + f' >>> Eso().query_tap_service( "{query_str}" )\n\n') + + try: + table_to_return = tap.search(query_str, maxrec=self.maxrec).to_table() + self._maybe_warn_about_table_length(table_to_return) + except pde.DALQueryError: + log.error(message(query_str)) + except pde.DALFormatError as e: + raise pde.DALFormatError(message(query_str) + f"cause: {e.cause}") from e + except Exception as e: + raise RuntimeError( + f"Unhandled exception {type(e)}\n" + message(query_str)) from e + + return table_to_return + + def _tap_service(self, authenticated: bool = False) -> TAPService: + + if authenticated and not self.authenticated(): + raise LoginError( + "It seems you are trying to issue an authenticated query without " + "being authenticated. Possible solutions:\n" + "1. Set the query function argument authenticated=False" + " OR\n" + "2. Login with your username and password: " + ".login(username=" + ) + + log.debug(f"Querying from {self._tap_url()}") + if authenticated: + h = self._get_auth_header() + self._session.headers = {**self._session.headers, **h} + tap_service = TAPService(self._tap_url(), session=self._session) + else: + tap_service = TAPService(self._tap_url()) + + return tap_service + + def query_tap_service(self, + query_str: str, + authenticated: bool = False, + ) -> Optional[astropy.table.Table]: + """ + Query the ESO TAP service using a free ADQL string. + + Parameters + ---------- + query_str : str + The ADQL query string to be executed. + authenticated : bool, optional + If ``True``, the query is run as an authenticated user. + Authentication must be performed beforehand via + :meth:`astroquery.eso.EsoClass.login`. Authenticated queries + may be slower. Default is ``False``. + + Returns + ------- + astropy.table.Table or None + The query results in an :class:`~astropy.table.Table`, or + ``None`` if no data is found. + + Examples + -------- + >>> from astroquery.eso import Eso + >>> eso_instance = Eso() + >>> eso_instance.query_tap_service("SELECT * FROM ivoa.ObsCore") + """ + table_to_return = None + tap_service = self._tap_service(authenticated) + table_to_return = self._try_download_pyvo_table(query_str, tap_service) + return table_to_return + + @unlimited_max_rec + @deprecated_renamed_argument('cache', None, since='0.4.11') + def list_instruments(self, cache=True) -> List[str]: + """ + List all the available instrument-specific queries offered by the ESO archive. Returns ------- instrument_list : list of strings cache : bool - Defaults to True. If set overrides global caching behavior. - See :ref:`caching documentation `. + Deprecated - unused. + """ + _ = cache # We're aware about disregarding the argument + query_str = ("select table_name from TAP_SCHEMA.tables " + "where schema_name='ist' order by table_name") + res = self.query_tap_service(query_str)["table_name"].data + + l_res = list(res) + + # Remove ist.apex_quicklooks, which is not actually a raw instrument + if _EsoNames.apex_quicklooks_table in l_res: + l_res.remove(_EsoNames.apex_quicklooks_table) + + l_res = list(map(lambda x: x.split(".")[1], l_res)) + return l_res + + @unlimited_max_rec + @deprecated_renamed_argument('cache', None, since='0.4.11') + def list_surveys(self, *, cache=True) -> List[str]: """ - if self._instrument_list is None: - url = "http://archive.eso.org/cms/eso-data/instrument-specific-query-forms.html" - instrument_list_response = self._request("GET", url, cache=cache) - root = BeautifulSoup(instrument_list_response.content, 'html5lib') - self._instrument_list = [] - for element in root.select("div[id=col3] a[href]"): - href = element.attrs["href"] - if u"http://archive.eso.org/wdb/wdb/eso" in href: - instrument = href.split("/")[-2] - if instrument not in self._instrument_list: - self._instrument_list.append(instrument) - return self._instrument_list - - def list_surveys(self, *, cache=True): - """ List all the available surveys (phase 3) in the ESO archive. + List all the available surveys (phase 3) in the ESO archive. Returns ------- - survey_list : list of strings + collection_list : list of strings cache : bool - Defaults to True. If set overrides global caching behavior. - See :ref:`caching documentation `. + Deprecated - unused. """ - if self._survey_list is None: - survey_list_response = self._request( - "GET", "http://archive.eso.org/wdb/wdb/adp/phase3_main/form", - cache=cache) - root = BeautifulSoup(survey_list_response.content, 'html5lib') - self._survey_list = [] - collections_table = root.find('table', id='collections_table') - other_collections = root.find('select', id='collection_name_option') - # it is possible to have empty collections or other collections... - collection_elts = (collections_table.find_all('input', type='checkbox') - if collections_table is not None - else []) - other_elts = (other_collections.find_all('option') - if other_collections is not None - else []) - for element in (collection_elts + other_elts): - if 'value' in element.attrs: - survey = element.attrs['value'] - if survey and survey not in self._survey_list and 'Any' not in survey: - self._survey_list.append(survey) - return self._survey_list - - def query_surveys(self, *, surveys='', cache=True, - help=False, open_form=False, **kwargs): + _ = cache # We're aware about disregarding the argument + t = _EsoNames.phase3_table + c = _EsoNames.phase3_surveys_column + query_str = f"select distinct {c} from {t}" + res = list(self.query_tap_service(query_str)[c].data) + return res + + @unlimited_max_rec + def _print_table_help(self, table_name: str) -> None: + """ + Prints the columns contained in a given table + """ + help_query = ( + f"select column_name, datatype, xtype, unit " + # TODO: The column description renders output unmanageable + # f", description " + f"from TAP_SCHEMA.columns " + f"where table_name = '{table_name}'") + available_cols = self.query_tap_service(help_query) + + count_query = f"select count(*) from {table_name}" + num_records = list(self.query_tap_service(count_query)[0].values())[0] + + # All this block is to print nicely... + # This whole function should be better written and the output + # shown tidier + nlines = len(available_cols) + 2 + n_ = astropy.conf.max_lines + m_ = astropy.conf.max_width + astropy.conf.max_lines = nlines + astropy.conf.max_width = sys.maxsize + log.info(f"\nColumns present in the table {table_name}:\n{available_cols}\n" + f"\nNumber of records present in the table {table_name}:\n{num_records}\n") + astropy.conf.max_lines = n_ + astropy.conf.max_width = m_ + + def _query_on_allowed_values( + self, + user_params: _UserParams + ) -> Union[astropy.table.Table, int, str]: + up = user_params # shorthand + + if up.print_help: + self._print_table_help(up.table_name) + return + + _raise_if_has_deprecated_keys(up.column_filters) + + raise_if_coords_not_valid(up.cone_ra, up.cone_dec, up.cone_radius) + + query = _py2adql(up) + + if up.query_str_only: + return query + + ret_table = self.query_tap_service(query_str=query, authenticated=up.authenticated) + return list(ret_table[0].values())[0] if up.count_only else ret_table + + @deprecated_renamed_argument(('open_form', 'cache'), (None, None), + since=['0.4.11', '0.4.11']) + def query_surveys( + self, + surveys: Union[List[str], str] = None, *, + cone_ra: float = None, cone_dec: float = None, cone_radius: float = None, + columns: Union[List, str] = None, + column_filters: Optional[dict] = None, + top: int = None, + count_only: bool = False, + query_str_only: bool = False, + help: bool = False, + authenticated: bool = False, + open_form: bool = False, cache: bool = False, + ) -> Union[astropy.table.Table, int, str]: """ Query survey Phase 3 data contained in the ESO archive. Parameters ---------- - survey : string or list - Name of the survey(s) to query. Should beone or more of the - names returned by `~astroquery.eso.EsoClass.list_surveys`. If - specified as a string, should be a comma-separated list of - survey names. - cache : bool - Defaults to True. If set overrides global caching behavior. - See :ref:`caching documentation `. + surveys : str or list, optional + Name of the survey(s) to query. Should be one or more of the + names returned by :meth:`~astroquery.eso.EsoClass.list_surveys`. If specified + as a string, it should be a comma-separated list of survey names. + If not specified, returns records relative to all surveys. Default is ``None``. + cone_ra : float, optional + Cone Search Center - Right Ascension in degrees. + cone_dec : float, optional + Cone Search Center - Declination in degrees. + cone_radius : float, optional + Cone Search Radius in degrees. + columns : str or list of str, optional + Name of the columns the query should return. If specified as a string, + it should be a comma-separated list of column names. + top : int, optional + When set to ``N``, returns only the top ``N`` records. + count_only : bool, optional + If ``True``, returns only an ``int``: the count of the records + the query would return when set to ``False``. Default is ``False``. + query_str_only : bool, optional + If ``True``, returns only a ``str``: the query string that + would be issued to the TAP service. Default is ``False``. + help : bool, optional + If ``True``, prints all the parameters accepted in ``column_filters`` + and ``columns``. Default is ``False``. + authenticated : bool, optional + If ``True``, runs the query as an authenticated user. + Authentication must be done beforehand via + :meth:`~astroquery.eso.EsoClass.login`. Authenticated queries may be slower. + Default is ``False``. + column_filters : dict or None, optional + Constraints applied to the query in ADQL syntax, + e.g., ``{"exp_start": "between '2024-12-31' and '2025-12-31'"}``. + Default is ``None``. + open_form : bool, optional + **Deprecated** - unused. + cache : bool, optional + **Deprecated** - unused. Returns ------- - table : `~astropy.table.Table` or `None` - A table representing the data available in the archive for the - specified survey, matching the constraints specified in ``kwargs``. - The number of rows returned is capped by the ROW_LIMIT - configuration item. `None` is returned when the query has no - results. - + astropy.table.Table, str, int or None + - By default, returns an :class:`~astropy.table.Table` containing records + based on the specified columns and constraints. + Returns ``None`` if the query has no results. + - When ``count_only`` is ``True``, returns an ``int`` representing the + record count for the specified filters. + - When ``query_str_only`` is ``True``, returns the query string that + would be issued to the TAP service given the specified arguments. """ - - url = "http://archive.eso.org/wdb/wdb/adp/phase3_main/form" - if open_form: - webbrowser.open(url) - elif help: - self._print_surveys_help(url, cache=cache) - else: - survey_form = self._request("GET", url, cache=cache) - query_dict = kwargs - query_dict["wdbo"] = "csv/download" - if isinstance(surveys, str): - surveys = surveys.split(",") - query_dict['collection_name'] = surveys - if self.ROW_LIMIT >= 0: - query_dict["max_rows_returned"] = int(self.ROW_LIMIT) - else: - query_dict["max_rows_returned"] = 10000 - - survey_response = self._activate_form(survey_form, form_index=0, - form_id='queryform', - inputs=query_dict, cache=cache) - - content = survey_response.content - # First line is always garbage - content = content.split(b'\n', 1)[1] - log.debug("Response content:\n{0}".format(content)) - if _check_response(content): - table = Table.read(BytesIO(content), format="ascii.csv", - comment="^#") - return table - else: - warnings.warn("Query returned no results", NoResultsWarning) - - def query_main(self, *, column_filters={}, columns=[], - open_form=False, help=False, cache=True, **kwargs): + _ = open_form, cache # make explicit that we are aware these arguments are unused + column_filters = column_filters if column_filters else {} + up = _UserParams(table_name=_EsoNames.phase3_table, + column_name=_EsoNames.phase3_surveys_column, + allowed_values=surveys, + cone_ra=cone_ra, + cone_dec=cone_dec, + cone_radius=cone_radius, + columns=columns, + column_filters=column_filters, + top=top, + count_only=count_only, + query_str_only=query_str_only, + print_help=help, + authenticated=authenticated, + ) + t = self._query_on_allowed_values(user_params=up) + t = reorder_columns(t, DEFAULT_LEAD_COLS_PHASE3) + return t + + @deprecated_renamed_argument(('open_form', 'cache'), (None, None), + since=['0.4.11', '0.4.11']) + def query_main( + self, + instruments: Union[List[str], str] = None, *, + cone_ra: float = None, cone_dec: float = None, cone_radius: float = None, + columns: Union[List, str] = None, + column_filters: Optional[dict] = None, + top: int = None, + count_only: bool = False, + query_str_only: bool = False, + help: bool = False, + authenticated: bool = False, + open_form: bool = False, cache: bool = False, + ) -> Union[astropy.table.Table, int, str]: """ - Query raw data contained in the ESO archive. + Query raw data from all instruments contained in the ESO archive. Parameters ---------- - column_filters : dict - Constraints applied to the query. - columns : list of strings - Columns returned by the query. - open_form : bool - If `True`, opens in your default browser the query form - for the requested instrument. - help : bool - If `True`, prints all the parameters accepted in - ``column_filters`` and ``columns`` for the requested - ``instrument``. - cache : bool - Defaults to True. If set overrides global caching behavior. - See :ref:`caching documentation `. + instruments : str or list, optional + Name of the instruments to filter. Should be one or more of the + names returned by :meth:`~astroquery.eso.EsoClass.list_instruments`. If specified + as a string, it should be a comma-separated list of instrument names. + If not specified, returns records relative to all instruments. Default is ``None``. + cone_ra : float, optional + Cone Search Center - Right Ascension in degrees. + cone_dec : float, optional + Cone Search Center - Declination in degrees. + cone_radius : float, optional + Cone Search Radius in degrees. + columns : str or list of str, optional + Name of the columns the query should return. If specified as a string, + it should be a comma-separated list of column names. + top : int, optional + When set to ``N``, returns only the top ``N`` records. + count_only : bool, optional + If ``True``, returns only an ``int``: the count of the records + the query would return when set to ``False``. Default is ``False``. + query_str_only : bool, optional + If ``True``, returns only a ``str``: the query string that + would be issued to the TAP service. Default is ``False``. + help : bool, optional + If ``True``, prints all the parameters accepted in ``column_filters`` + and ``columns``. Default is ``False``. + authenticated : bool, optional + If ``True``, runs the query as an authenticated user. + Authentication must be done beforehand via + :meth:`~astroquery.eso.EsoClass.login`. Authenticated queries may be slower. + Default is ``False``. + column_filters : dict or None, optional + Constraints applied to the query in ADQL syntax, + e.g., ``{"exp_start": "between '2024-12-31' and '2025-12-31'"}``. + Default is ``None``. + open_form : bool, optional + **Deprecated** - unused. + cache : bool, optional + **Deprecated** - unused. Returns ------- - table : `~astropy.table.Table` - A table representing the data available in the archive for the - specified instrument, matching the constraints specified in - ``kwargs``. The number of rows returned is capped by the - ROW_LIMIT configuration item. - + astropy.table.Table, str, int or None + - By default, returns an :class:`~astropy.table.Table` containing records + based on the specified columns and constraints. + Returns ``None`` if the query has no results. + - When ``count_only`` is ``True``, returns an ``int`` representing the + record count for the specified filters. + - When ``query_str_only`` is ``True``, returns the query string that + would be issued to the TAP service given the specified arguments. """ - url = self.QUERY_INSTRUMENT_URL + "/eso_archive_main/form" - return self._query(url, column_filters=column_filters, columns=columns, - open_form=open_form, help=help, cache=cache, **kwargs) - - def query_instrument(self, instrument, *, column_filters={}, columns=[], - open_form=False, help=False, cache=True, **kwargs): + _ = open_form, cache # make explicit that we are aware these arguments are unused + column_filters = column_filters if column_filters else {} + up = _UserParams(table_name=_EsoNames.raw_table, + column_name=_EsoNames.raw_instruments_column, + allowed_values=instruments, + cone_ra=cone_ra, + cone_dec=cone_dec, + cone_radius=cone_radius, + columns=columns, + column_filters=column_filters, + top=top, + count_only=count_only, + query_str_only=query_str_only, + print_help=help, + authenticated=authenticated, + ) + t = self._query_on_allowed_values(up) + t = reorder_columns(t, DEFAULT_LEAD_COLS_RAW) + return t + + @deprecated_renamed_argument(('open_form', 'cache'), (None, None), + since=['0.4.11', '0.4.11']) + def query_instrument( + self, + instrument: str, *, + cone_ra: float = None, cone_dec: float = None, cone_radius: float = None, + columns: Union[List, str] = None, + column_filters: Optional[dict] = None, + top: int = None, + count_only: bool = False, + query_str_only: bool = False, + help: bool = False, + authenticated: bool = False, + open_form: bool = False, cache: bool = False, + ) -> Union[astropy.table.Table, int, str]: """ Query instrument-specific raw data contained in the ESO archive. Parameters ---------- - instrument : string - Name of the instrument to query, one of the names returned by - `~astroquery.eso.EsoClass.list_instruments`. - column_filters : dict - Constraints applied to the query. - columns : list of strings - Columns returned by the query. - open_form : bool - If `True`, opens in your default browser the query form - for the requested instrument. - help : bool - If `True`, prints all the parameters accepted in - ``column_filters`` and ``columns`` for the requested - ``instrument``. - cache : bool - Defaults to True. If set overrides global caching behavior. - See :ref:`caching documentation `. + instrument : str + Name of the instrument from which raw data is to be queried. + Should be ONLY ONE of the names returned by + :meth:`~astroquery.eso.EsoClass.list_instruments`. + cone_ra : float, optional + Cone Search Center - Right Ascension in degrees. + cone_dec : float, optional + Cone Search Center - Declination in degrees. + cone_radius : float, optional + Cone Search Radius in degrees. + columns : str or list of str, optional + Name of the columns the query should return. If specified as a string, + it should be a comma-separated list of column names. + top : int, optional + When set to ``N``, returns only the top ``N`` records. + count_only : bool, optional + If ``True``, returns only an ``int``: the count of the records + the query would return when set to ``False``. Default is ``False``. + query_str_only : bool, optional + If ``True``, returns only a ``str``: the query string that + would be issued to the TAP service. Default is ``False``. + help : bool, optional + If ``True``, prints all the parameters accepted in ``column_filters`` + and ``columns``. Default is ``False``. + authenticated : bool, optional + If ``True``, runs the query as an authenticated user. + Authentication must be done beforehand via + :meth:`~astroquery.eso.EsoClass.login`. Note that authenticated queries are slower. + Default is ``False``. + column_filters : dict or None, optional + Constraints applied to the query in ADQL syntax, + e.g., ``{"exp_start": "between '2024-12-31' and '2025-12-31'"}``. + Default is ``None``. + open_form : bool, optional + **Deprecated** - unused. + cache : bool, optional + **Deprecated** - unused. Returns ------- - table : `~astropy.table.Table` - A table representing the data available in the archive for the - specified instrument, matching the constraints specified in - ``kwargs``. The number of rows returned is capped by the - ROW_LIMIT configuration item. - + astropy.table.Table, str, int, or None + - By default, returns an :class:`~astropy.table.Table` containing records + based on the specified columns and constraints. Returns ``None`` if no results. + - When ``count_only`` is ``True``, returns an ``int`` representing the + record count for the specified filters. + - When ``query_str_only`` is ``True``, returns the query string that + would be issued to the TAP service given the specified arguments. """ - - url = self.QUERY_INSTRUMENT_URL + '/{0}/form'.format(instrument.lower()) - return self._query(url, column_filters=column_filters, columns=columns, - open_form=open_form, help=help, cache=cache, **kwargs) - - def _query(self, url, *, column_filters={}, columns=[], - open_form=False, help=False, cache=True, **kwargs): - - table = None - if open_form: - webbrowser.open(url) - elif help: - self._print_query_help(url) - else: - instrument_form = self._request("GET", url, cache=cache) - query_dict = {} - query_dict.update(column_filters) - # TODO: replace this with individually parsed kwargs - query_dict.update(kwargs) - query_dict["wdbo"] = "csv/download" - - # Default to returning the DP.ID since it is needed for header - # acquisition - query_dict['tab_dp_id'] = kwargs.pop('tab_dp_id', 'on') - - for k in columns: - query_dict["tab_" + k] = True - if self.ROW_LIMIT >= 0: - query_dict["max_rows_returned"] = int(self.ROW_LIMIT) - else: - query_dict["max_rows_returned"] = 10000 - # used to be form 0, but now there's a new 'logout' form at the top - # (form_index = -1 and 0 both work now that form_id is included) - instrument_response = self._activate_form(instrument_form, - form_index=-1, - form_id='queryform', - inputs=query_dict, - cache=cache) - - content = instrument_response.content - # First line is always garbage - content = content.split(b'\n', 1)[1] - log.debug("Response content:\n{0}".format(content)) - if _check_response(content): - table = Table.read(BytesIO(content), format="ascii.csv", - comment='^#') - return table - else: - warnings.warn("Query returned no results", NoResultsWarning) + _ = open_form, cache # make explicit that we are aware these arguments are unused + column_filters = column_filters if column_filters else {} + up = _UserParams(table_name=_EsoNames.ist_table(instrument), + column_name=None, + allowed_values=None, + cone_ra=cone_ra, + cone_dec=cone_dec, + cone_radius=cone_radius, + columns=columns, + column_filters=column_filters, + top=top, + count_only=count_only, + query_str_only=query_str_only, + print_help=help, + authenticated=authenticated) + t = self._query_on_allowed_values(up) + t = reorder_columns(t, DEFAULT_LEAD_COLS_RAW) + return t def get_headers(self, product_ids, *, cache=True): """ @@ -571,7 +717,7 @@ def get_headers(self, product_ids, *, cache=True): result = [] for dp_id in product_ids: response = self._request( - "GET", "http://archive.eso.org/hdr?DpId={0}".format(dp_id), + "GET", f"https://archive.eso.org/hdr?DpId={dp_id}", cache=cache) root = BeautifulSoup(response.content, 'html5lib') hdr = root.select('pre')[0].text @@ -606,10 +752,10 @@ def get_headers(self, product_ids, *, cache=True): columns.append(key) column_types.append(type(header[key])) # Add all missing elements - for i in range(len(result)): + for r in result: for (column, column_type) in zip(columns, column_types): - if column not in result[i]: - result[i][column] = column_type() + if column not in r: + r[column] = column_type() # Return as Table return Table(result) @@ -667,14 +813,13 @@ def _download_eso_files(self, file_ids: List[str], destination: Optional[str], filename, downloaded = self._download_eso_file(file_link, destination, overwrite) downloaded_files.append(filename) if downloaded: - log.info(f"Successfully downloaded dataset" - f" {file_id} to {filename}") + log.info(f"Successfully downloaded dataset {file_id} to {filename}") except requests.HTTPError as http_error: if http_error.response.status_code == 401: log.error(f"Access denied to {file_link}") else: log.error(f"Failed to download {file_link}. {http_error}") - except Exception as ex: + except RuntimeError as ex: log.error(f"Failed to download {file_link}. {ex}") return downloaded_files @@ -756,7 +901,8 @@ def get_associated_files(self, datasets: List[str], *, mode: str = "raw", self._save_xml(xml, filename, destination) # For multiple datasets it returns a multipart message elif 'multipart/form-data' in content_type: - msg = email.message_from_string(f'Content-Type: {content_type}\r\n' + response.content.decode()) + msg = email.message_from_string( + f'Content-Type: {content_type}\r\n' + response.content.decode()) for part in msg.get_payload(): filename = part.get_filename() xml = part.get_payload(decode=True) @@ -769,9 +915,11 @@ def get_associated_files(self, datasets: List[str], *, mode: str = "raw", # remove input datasets from calselector results return list(associated_files.difference(set(datasets))) - @deprecated_renamed_argument(('request_all_objects', 'request_id'), (None, None), since=['0.4.7', '0.4.7']) - def retrieve_data(self, datasets, *, continuation=False, destination=None, with_calib=None, - request_all_objects=False, unzip=True, request_id=None): + @deprecated_renamed_argument(('request_all_objects', 'request_id'), (None, None), + since=['0.4.7', '0.4.7']) + def retrieve_data(self, datasets, *, continuation=False, destination=None, + with_calib=None, unzip=True, + request_all_objects=None, request_id=None): """ Retrieve a list of datasets form the ESO archive. @@ -806,10 +954,13 @@ def retrieve_data(self, datasets, *, continuation=False, destination=None, with_ >>> files = Eso.retrieve_data(dpids) """ + _ = request_all_objects, request_id return_string = False if isinstance(datasets, str): return_string = True datasets = [datasets] + if isinstance(datasets, astropy.table.column.Column): + datasets = list(datasets) if with_calib and with_calib not in ('raw', 'processed'): raise ValueError("Invalid value for 'with_calib'. " @@ -820,10 +971,11 @@ def retrieve_data(self, datasets, *, continuation=False, destination=None, with_ log.info(f"Retrieving associated '{with_calib}' calibration files ...") try: # batch calselector requests to avoid possible issues on the ESO server - BATCH_SIZE = 100 + batch_size = 100 sorted_datasets = sorted(datasets) - for i in range(0, len(sorted_datasets), BATCH_SIZE): - associated_files += self.get_associated_files(sorted_datasets[i:i + BATCH_SIZE], mode=with_calib) + for i in range(0, len(sorted_datasets), batch_size): + associated_files += self.get_associated_files( + sorted_datasets[i:i + batch_size], mode=with_calib) associated_files = list(set(associated_files)) log.info(f"Found {len(associated_files)} associated files") except Exception as ex: @@ -837,191 +989,80 @@ def retrieve_data(self, datasets, *, continuation=False, destination=None, with_ log.info("Done!") return files[0] if files and len(files) == 1 and return_string else files - def query_apex_quicklooks(self, *, project_id=None, help=False, - open_form=False, cache=True, **kwargs): + @deprecated_renamed_argument(('open_form', 'cache'), (None, None), + since=['0.4.11', '0.4.11']) + def query_apex_quicklooks(self, + project_id: Union[List[str], str] = None, *, + columns: Union[List, str] = None, + column_filters: Optional[dict] = None, + top: int = None, + count_only: bool = False, + query_str_only: bool = False, + help: bool = False, + authenticated: bool = False, + open_form: bool = False, cache: bool = False, + ) -> Union[astropy.table.Table, int, str]: """ APEX data are distributed with quicklook products identified with a - different name than other ESO products. This query tool searches by + different name than other ESO products. This query tool searches by project ID or any other supported keywords. - Examples - -------- - >>> tbl = Eso.query_apex_quicklooks(project_id='093.C-0144') - >>> files = Eso.retrieve_data(tbl['Product ID']) - """ - - apex_query_url = 'http://archive.eso.org/wdb/wdb/eso/apex_product/form' - - table = None - if open_form: - webbrowser.open(apex_query_url) - elif help: - return self._print_instrument_help(apex_query_url, 'apex') - else: - - payload = {'wdbo': 'csv/download'} - if project_id is not None: - payload['prog_id'] = project_id - payload.update(kwargs) - - apex_form = self._request("GET", apex_query_url, cache=cache) - apex_response = self._activate_form( - apex_form, form_id='queryform', form_index=0, inputs=payload, - cache=cache, method='application/x-www-form-urlencoded') - - content = apex_response.content - if _check_response(content): - # First line is always garbage - content = content.split(b'\n', 1)[1] - try: - table = Table.read(BytesIO(content), format="ascii.csv", - guess=False, # header_start=1, - comment="#", encoding='utf-8') - except ValueError as ex: - if 'the encoding parameter is not supported on Python 2' in str(ex): - # astropy python2 does not accept the encoding parameter - table = Table.read(BytesIO(content), format="ascii.csv", - guess=False, - comment="#") - else: - raise ex - else: - raise RemoteServiceError("Query returned no results") - - return table - - def _print_query_help(self, url, *, cache=True): - """ - Download a form and print it in a quasi-human-readable way - """ - log.info("List of accepted column_filters parameters.") - log.info("The presence of a column in the result table can be " - "controlled if prefixed with a [ ] checkbox.") - log.info("The default columns in the result table are shown as " - "already ticked: [x].") - - result_string = [] - - resp = self._request("GET", url, cache=cache) - doc = BeautifulSoup(resp.content, 'html5lib') - form = doc.select("html body form pre")[0] - # Unwrap all paragraphs - paragraph = form.find('p') - while paragraph: - paragraph.unwrap() - paragraph = form.find('p') - # For all sections - for section in form.select("table"): - section_title = "".join(section.stripped_strings) - section_title = "\n".join(["", section_title, - "-" * len(section_title)]) - result_string.append(section_title) - checkbox_name = "" - checkbox_value = "" - for tag in section.next_siblings: - if tag.name == u"table": - break - elif tag.name == u"input": - if tag.get(u'type') == u"checkbox": - checkbox_name = tag['name'] - checkbox_value = u"[x]" if ('checked' in tag.attrs) else u"[ ]" - name = "" - value = "" - else: - name = tag['name'] - value = "" - elif tag.name == u"select": - options = [] - for option in tag.select("option"): - options += ["{0} ({1})".format(option['value'], "".join(option.stripped_strings))] - name = tag[u"name"] - value = ", ".join(options) - else: - name = "" - value = "" - if u"tab_" + name == checkbox_name: - checkbox = checkbox_value - else: - checkbox = " " - if name != u"": - result_string.append("{0} {1}: {2}" - .format(checkbox, name, value)) - - log.info("\n".join(result_string)) - return result_string + Parameters + ---------- + project_id : str + ID of the project from which APEX quicklook data is to be queried. + columns : str or list of str, optional + Name of the columns the query should return. If specified as a string, + it should be a comma-separated list of column names. + top : int, optional + When set to ``N``, returns only the top ``N`` records. + count_only : bool, optional + If ``True``, returns only an ``int``: the count of the records + the query would return when set to ``False``. Default is ``False``. + query_str_only : bool, optional + If ``True``, returns only a ``str``: the query string that + would be issued to the TAP service. Default is ``False``. + help : bool, optional + If ``True``, prints all the parameters accepted in ``column_filters`` + and ``columns``. Default is ``False``. + authenticated : bool, optional + If ``True``, runs the query as an authenticated user. + Authentication must be done beforehand via + :meth:`~astroquery.eso.EsoClass.login`. Note that authenticated queries + are slower. Default is ``False``. + column_filters : dict or None, optional + Constraints applied to the query in ADQL syntax, + e.g., ``{"exp_start": "between '2024-12-31' and '2025-12-31'"}``. + Default is ``None``. + open_form : bool, optional + **Deprecated** - unused. + cache : bool, optional + **Deprecated** - unused. - def _print_surveys_help(self, url, *, cache=True): - """ - Download a form and print it in a quasi-human-readable way + Returns + ------- + astropy.table.Table, str, int, or None + - By default, returns an :class:`~astropy.table.Table` containing records + based on the specified columns and constraints. Returns ``None`` if no results. + - When ``count_only`` is ``True``, returns an ``int`` representing the + record count for the specified filters. + - When ``query_str_only`` is ``True``, returns the query string that + would be issued to the TAP service given the specified arguments. """ - log.info("List of the parameters accepted by the " - "surveys query.") - log.info("The presence of a column in the result table can be " - "controlled if prefixed with a [ ] checkbox.") - log.info("The default columns in the result table are shown as " - "already ticked: [x].") - - result_string = [] - - resp = self._request("GET", url, cache=cache) - doc = BeautifulSoup(resp.content, 'html5lib') - form = doc.select("html body form")[0] - - # hovertext from different labels are used to give more info on forms - helptext_dict = {abbr['title'].split(":")[0].strip(): ":".join(abbr['title'].split(":")[1:]) - for abbr in form.find_all('abbr') - if 'title' in abbr.attrs and ":" in abbr['title']} - - for fieldset in form.select('fieldset'): - legend = fieldset.select('legend') - if len(legend) > 1: - raise ValueError("Form parsing error: too many legends.") - elif len(legend) == 0: - continue - section_title = "\n\n" + "".join(legend[0].stripped_strings) + "\n" - - result_string.append(section_title) - - for section in fieldset.select('table'): - - checkbox_name = "" - checkbox_value = "" - for tag in section.next_elements: - if tag.name == u"table": - break - elif tag.name == u"input": - if tag.get(u'type') == u"checkbox": - checkbox_name = tag['name'] - checkbox_value = (u"[x]" - if ('checked' in tag.attrs) - else u"[ ]") - name = "" - value = "" - else: - name = tag['name'] - value = "" - elif tag.name == u"select": - options = [] - for option in tag.select("option"): - options += ["{0} ({1})".format(option['value'] if 'value' in option else "", - "".join(option.stripped_strings))] - name = tag[u"name"] - value = ", ".join(options) - else: - name = "" - value = "" - if u"tab_" + name == checkbox_name: - checkbox = checkbox_value - else: - checkbox = " " - if name != u"": - result_string.append("{0} {1}: {2}" - .format(checkbox, name, value)) - if name.strip() in helptext_dict: - result_string.append(helptext_dict[name.strip()]) - - log.info("\n".join(result_string)) - return result_string + _ = open_form, cache # make explicit that we are aware these arguments are unused + column_filters = column_filters if column_filters else {} + up = _UserParams(table_name=_EsoNames.apex_quicklooks_table, + column_name=_EsoNames.apex_quicklooks_pid_column, + allowed_values=project_id, + cone_ra=None, cone_dec=None, cone_radius=None, + columns=columns, + column_filters=column_filters, + top=top, + count_only=count_only, + query_str_only=query_str_only, + print_help=help, + authenticated=authenticated) + return self._query_on_allowed_values(up) Eso = EsoClass() diff --git a/astroquery/eso/tests/data/2031769bb0e68fb2816bf5680203e586eea71ca58b2694a71a428605.pickle b/astroquery/eso/tests/data/2031769bb0e68fb2816bf5680203e586eea71ca58b2694a71a428605.pickle new file mode 100644 index 0000000000..9a0a2cb98b --- /dev/null +++ b/astroquery/eso/tests/data/2031769bb0e68fb2816bf5680203e586eea71ca58b2694a71a428605.pickle @@ -0,0 +1 @@ +€K. \ No newline at end of file diff --git a/astroquery/eso/tests/data/amber_query_form.html b/astroquery/eso/tests/data/amber_query_form.html deleted file mode 100644 index 1be90fe1d6..0000000000 --- a/astroquery/eso/tests/data/amber_query_form.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - -ESO Science Archive - AMBER Data Products - - - - - - - -
- - - - - - - - - - -
ESO ESOSPECIAL ACCESS
SCIENCE ARCHIVE FACILITY
AMBER Raw Data
Query Form
- - - - - - - - -
How to use? -Other Instruments -Other Instruments -Archive FAQArchive Facility HOMEESO HOME
-
-
- - -
-Description -
- This form provides access to observations (raw data) performed with -AMBER -since 2004 that are stored on-line in the -Science Archive Facility in Garching. -Find more information about AMBER data on the -Quality Control web pages. -Paranal ambient conditions can be queried separately from here.
-
-
- -
- - - -
-
Special Access Info [open]
- -
-
- -
-
-
-
- -
-
-
- - -
-
Output preferences: -
-
Return max rows.

-

Target Information
    Target name.......................:  -    Coordinate System.................:      RA:      DEC:  RA: sexagesimal=hours,decimal=degrees -    Search Box........................:      Equatorial Output Format:  - Input Target List.................:  -
Observation and proposal parameters
 DATE OBS..........................:  (YYYY MM(M) DD of night begin [12:00 UT], DD MM(M) YYYY also acceptable) -  OR give a query range using the following two fields (start/end dates)
    Start.............................:      End:  - ProgId............................:  PPP.C-NNNN   (e.g. 080.A-0123*) - Program Type......................:       SV Mode:  - PI/CoI............................:  - Proposal Title....................:  -
Generic File Information
 DP.ID.............................:  archive filename of FITS file (e.g. AMBER.2010-09-04T09:40:45.174) - OB.ID.............................:  identification number of OB within ESO system - OBS.TARG.NAME.....................:  Observation block target name -

 DPR.CATG..........................:  Data category (e.g. SCIENCE) - DPR.TYPE..........................:  Observation type    User defined input:  (e.g. 2P2V or 3P2V) - DPR.TECH..........................:  Observation technique    Request all interferometry files  -

 TPL.NAME..........................:  AMBER template name - TPL.NEXP..........................:  total number of exposures within the template - TPL.START.........................:  starting time of template (UT) -
Instrument Specific Information
 DEL.FT.SENSOR.....................:  Fringe Tracker Sensor Name - DEL.FT.STATUS.....................:  Fringe Tracker Status (could be ON or OFF) - DET.NTEL..........................:  Number of telescopes - ISS.CONF.STATION1.................:  Station of telescope 1 - ISS.CONF.STATION2.................:  Station of telescope 2 - ISS.CONF.STATION3.................:  Station of telescope 3 - OCS.OBS.MODE......................:  Observation mode - OCS.OBS.SPECCONF..................:  Spectral Configuration - OCS.OBS.TYPE......................:  Observation type - INS.GRAT1.WLEN....................:  Grating central wavelength [nm] -
Ambient Parameters
 DIMM S-avg........................:  [arcsec] DIMM Seeing average over the exposure (FWHM at 0.5mue) - Airmass...........................:  +/- 0.1 - Night?............................:  Night Exposure ? - Moon Illumination.................:  Moon illumination during the exposure (percentage, negative when moon below the horizon) -
Result set
    Sort by...........................: 

Extra Columns on Tabular Output
-
-
- - Use tabular output even if only one row is returned.
- - Use full-screen output even if more than one row is returned.
-
- -
-
- - - - - - - - - - -
- - ESO HOME - - ARCHIVE HOME - - ARCHIVE FAQ
- wdb 3.0h - 21-JUL-2017 ...... - - Send comments to archive@eso.org -
-
-
- - diff --git a/astroquery/eso/tests/data/amber_sgra_query.tbl b/astroquery/eso/tests/data/amber_sgra_query.tbl deleted file mode 100644 index e7efc35cfd..0000000000 --- a/astroquery/eso/tests/data/amber_sgra_query.tbl +++ /dev/null @@ -1,60 +0,0 @@ - -# SIMBAD coordinates for Sgr A* : 17 45 40.0, -29 00 28.1. -# -Object,RA,DEC,Target Ra Dec,Target l b,ProgId,DP.ID,OB.ID,DPR.CATG,DPR.TYPE,DPR.TECH,ISS.CONF.STATION1,ISS.CONF.STATION2,ISS.CONF.STATION3,INS.GRAT1.WLEN,DIMM S-avg -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:40:03.741,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.64 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:40:19.830,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.64 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:40:35.374,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.64 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:40:50.932,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.68 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:41:07.444,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.68 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:41:24.179,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.68 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:41:39.523,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.68 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:41:55.312,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.69 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:42:12.060,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.69 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:42:29.119,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.69 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:42:44.370,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.69 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:42:59.649,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.69 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:43:16.399,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.69 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:43:32.910,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.69 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:43:48.941,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.69 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:44:04.843,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:44:21.541,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:44:38.309,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:44:53.798,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.81 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:45:10.049,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.80 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:45:26.987,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.80 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:45:43.433,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.80 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:45:58.674,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.78 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:46:14.474,200156177,SCIENCE,"CPTPIST,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.79 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:46:37.269,200156177,SCIENCE,"CPTPIST,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.79 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:47:01.474,200156177,SCIENCE,"FRNSRC,BASE31",INTERFEROMETRY,U1,U3,U4,-1.000,0.80 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:50:20.362,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.74 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:50:33.223,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.74 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:50:46.632,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.74 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:50:59.556,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.74 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:51:14.547,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.78 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:51:27.935,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:51:41.670,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:51:54.480,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:52:07.271,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:52:21.824,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.76 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:52:35.051,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.76 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:52:48.928,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.76 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:53:02.492,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.76 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:53:24.007,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.76 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:53:37.858,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.76 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:53:51.137,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.76 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:54:05.106,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.76 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:54:26.021,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:54:39.202,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:54:52.656,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:55:06.685,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.77 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:55:26.262,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.78 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:55:39.382,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.80 [0.01] -GC_IRS7,266.417056,-29.006140,17:45:40.09 -29:00:22.1,359.945774 -0.045458,076.B-0863(A),AMBER.2006-03-14T07:55:52.259,200156177,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,U1,U3,U4,-1.000,0.80 [0.01] - -# A maximum of 50 records were found matching the provided criteria - any remaining rows were ignored. -# -# -# -# \ No newline at end of file diff --git a/astroquery/eso/tests/data/fd303fa27993048bd2393af067fe5ceccf4817c288ce5c0b4343386f.pickle b/astroquery/eso/tests/data/fd303fa27993048bd2393af067fe5ceccf4817c288ce5c0b4343386f.pickle new file mode 100644 index 0000000000..4942655450 Binary files /dev/null and b/astroquery/eso/tests/data/fd303fa27993048bd2393af067fe5ceccf4817c288ce5c0b4343386f.pickle differ diff --git a/astroquery/eso/tests/data/main_query_form.html b/astroquery/eso/tests/data/main_query_form.html deleted file mode 100644 index 766c641da5..0000000000 --- a/astroquery/eso/tests/data/main_query_form.html +++ /dev/null @@ -1,341 +0,0 @@ - - - - -ESO Archive Raw Data - - - - - - - -
- - - - - - - - - -
ESOSPECIAL ACCESS
SCIENCE ARCHIVE FACILITY
Observational Raw Data
Query Form
- - - - - - - - - -
How to use? -Instrument-specific Interfaces -Instruments-specific Interfaces -ESO Archive OverviewArchive FAQArchive Facility HOMEESO HOME
-
-
-
-
-Description -

-To request data you have to register as an -ESO/ST-ECF Archive user. A request can be submitted -following the instructions in the results table.
-

-
- - -
-
Output preferences: -
-
Return max rows.

-

 Input File..........:  
- Export: 
- HDR: 
-    Note................:  
-
Target Information

    Target..............:  -    Search Box..........:  If Simbad/Ned name or coordinates given -    RA..................:      Format:  J2000 (RA 05 34;Dec +22) -    DEC.................:  (J2000) - Target Ra, Dec:  -    Output Format.......:  - Stat PLOT:  -    Export File Format..:  - Night...............:  (YYYY MM(M) DD of night begin [12:00 UT], DD MM(M) YYYY also acceptable) -    nightlog............:  -   OR give a query range using the following start/end dates:
    Start...............:      End:  -
Program Information
 Program_ID..........:  -    survey..............:  - PI/CoI..............:  - s/v.................:  - Title...............:  - Prog_Type...........:  -
Observing Information
 Instrument..........:  - Stat Ins:  - Category............:  - Type................:  - Mode................:  - Dataset ID..........:  - Orig Name...........:  - Release_Date........:  - OB_Name.............:  - OB_ID...............:  - TPL ID..............:  - TPL START...........:  -
Instrumental Setup
 Exptime.............:  (seconds) - Stat Exp:  - Filter..............:  (e.g. R*) - Grism...............:  (e.g. GRIS_600*) - Grating.............:  (e.g. CD*) - Slit................:  (e.g. ~lslit1* [see also the help button]) -
Extra Columns
 MJD-OBS:  - Airmass:  - Ambient:  - INFO................:  -
Result Set

    Sort by.............:  -    aladin_colour.......: 

Extra Columns on Tabular Output
-
-
- - Use tabular output even if only one row is returned.
- - Use full-screen output even if more than one row is returned.
-
- -
-
- - - - - - - - - - -
- - ESO HOME - - ARCHIVE HOME - - ARCHIVE FAQ
- wdb 3.0h - 21-JUL-2017 ...... - - Send comments to archive@eso.org -
-
-
- - diff --git a/astroquery/eso/tests/data/main_sgra_query.tbl b/astroquery/eso/tests/data/main_sgra_query.tbl deleted file mode 100644 index 41b0428a50..0000000000 --- a/astroquery/eso/tests/data/main_sgra_query.tbl +++ /dev/null @@ -1,60 +0,0 @@ - -# SIMBAD coordinates for Sgr A* : 17 45 40.0, -29 00 28.1. -# -OBJECT,RA,DEC,Program_ID,Instrument,Category,Type,Mode,Dataset ID,Release_Date,TPL ID,TPL START,Exptime,Filter,MJD-OBS,Airmass -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:40:03.741,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.319488, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:40:19.830,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.319674, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:40:35.374,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.319854, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:40:50.932,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.320034, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:41:07.444,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.320225, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:41:24.179,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.320419, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:41:39.523,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.320596, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:41:55.312,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.320779, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:42:12.060,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.320973, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:42:29.119,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.321170, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:42:44.370,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.321347, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:42:59.649,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.321524, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:43:16.399,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.321718, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:43:32.910,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.321909, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:43:48.941,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.322094, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:44:04.843,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.322278, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:44:21.541,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.322472, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:44:38.309,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.322666, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:44:53.798,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.322845, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:45:10.049,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.323033, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:45:26.987,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.323229, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:45:43.433,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.323419, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:45:58.674,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.323596, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"CPTPIST,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:46:14.474,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.323779, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"CPTPIST,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:46:37.269,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.324042, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE31",INTERFEROMETRY,AMBER.2006-03-14T07:47:01.474,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:21:16, 0.200,,53808.324323, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:50:20.362,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.326625, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:50:33.223,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.326773, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:50:46.632,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.326929, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:50:59.556,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.327078, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:51:14.547,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.327252, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:51:27.935,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.327407, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:51:41.670,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.327566, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:51:54.480,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.327714, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:52:07.271,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.327862, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:52:21.824,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.328030, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:52:35.051,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.328183, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:52:48.928,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.328344, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:53:02.492,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.328501, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:53:24.007,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.328750, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:53:37.858,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.328910, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:53:51.137,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.329064, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:54:05.106,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.329226, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:54:26.021,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.329468, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:54:39.202,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.329620, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:54:52.656,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.329776, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:55:06.685,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.329938, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:55:26.262,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.330165, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:55:39.382,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.330317, -GC_IRS7,17:45:40.09,-29:00:22.1,076.B-0863(A),AMBER,SCIENCE,"FRNSRC,BASE12",INTERFEROMETRY,AMBER.2006-03-14T07:55:52.259,Mar 14 2007,AMBER_3Tstd_acq,2006-03-14T07:48:12, 0.100,,53808.330466, - -# A maximum of 50 records were found matching the provided criteria - any remaining rows were ignored. -# -# -# -# \ No newline at end of file diff --git a/astroquery/eso/tests/data/query_apex_ql_5.pickle b/astroquery/eso/tests/data/query_apex_ql_5.pickle new file mode 100644 index 0000000000..4942655450 Binary files /dev/null and b/astroquery/eso/tests/data/query_apex_ql_5.pickle differ diff --git a/astroquery/eso/tests/data/query_coll_vvv_sgra.pickle b/astroquery/eso/tests/data/query_coll_vvv_sgra.pickle new file mode 100644 index 0000000000..a86325f055 Binary files /dev/null and b/astroquery/eso/tests/data/query_coll_vvv_sgra.pickle differ diff --git a/astroquery/eso/tests/data/query_inst_sinfoni_sgra.pickle b/astroquery/eso/tests/data/query_inst_sinfoni_sgra.pickle new file mode 100644 index 0000000000..a18b5f1a1b Binary files /dev/null and b/astroquery/eso/tests/data/query_inst_sinfoni_sgra.pickle differ diff --git a/astroquery/eso/tests/data/query_list_collections.pickle b/astroquery/eso/tests/data/query_list_collections.pickle new file mode 100644 index 0000000000..d1c14d43c5 Binary files /dev/null and b/astroquery/eso/tests/data/query_list_collections.pickle differ diff --git a/astroquery/eso/tests/data/query_list_instruments.pickle b/astroquery/eso/tests/data/query_list_instruments.pickle new file mode 100644 index 0000000000..096b11a815 Binary files /dev/null and b/astroquery/eso/tests/data/query_list_instruments.pickle differ diff --git a/astroquery/eso/tests/data/query_main_sgra.pickle b/astroquery/eso/tests/data/query_main_sgra.pickle new file mode 100644 index 0000000000..7a2767f64e Binary files /dev/null and b/astroquery/eso/tests/data/query_main_sgra.pickle differ diff --git a/astroquery/eso/tests/data/vvv_sgra_form.html b/astroquery/eso/tests/data/vvv_sgra_form.html deleted file mode 100644 index d469a145b6..0000000000 --- a/astroquery/eso/tests/data/vvv_sgra_form.html +++ /dev/null @@ -1,822 +0,0 @@ - - - - -ESO Science Archive - Data Products - - - - - - - - - - - - - - - - - - - - - - - - -
ESO - - - - - - - - - -
- GENERIC  - - SPECTRAL  - - IMAGING  - - VISTA  -
PHASE3 ARCHIVE INTERFACES
- - - - - - - -
-HELP -REDUCED DATA TYPES DESCRIPTION -FAQ -DATA RELEASES
-
-
Generic Data Products
Query Form
-
-Please be aware of an important announcement about the flux calibration of XSHOOTER UVB data products.
-This form provides access to reduced or fully calibrated data sets, and derived catalogs, -that were contributed by PIs of ESO programmes or produced by ESO (using ESO calibration pipelines with the best available calibration data), and then -integrated into the ESO Science Archive Facility starting April 2011, through the -Phase 3 process. Included are optical, infrared, and APEX (millimetre, submillimetre) data products. -Each available data set is fully described; please see the list of contributed data releases and pipeline-processed data streams including their corresponding descriptions. -This form allows generic query constraints for all types of data products. -More specific forms, customised for each particular data type, are available for optical and infrared imaging, -for spectra, -and for VISTA data products. -Other data not yet migrated to the Phase 3 infrastructure are available via different user interfaces; please check the archive home page. -

Note: The FITS format of the spectra retrievable via this query form complies to the ESO Science Data Product standard [PDF]. The 1d spectra help page provides a list of tools that support this format and a quick guide to read and display these spectra in IDL and IRAF.

-
-