From 78b3e8d4e55ee8411d771ffa4f628f8e4b7f6bc7 Mon Sep 17 00:00:00 2001 From: "Juan M. Carmona Loaiza" Date: Fri, 12 Sep 2025 09:42:38 +0200 Subject: [PATCH 01/30] Setup auto sync fork for main branch --- .github/workflows/sync_fork.yml | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/sync_fork.yml diff --git a/.github/workflows/sync_fork.yml b/.github/workflows/sync_fork.yml new file mode 100644 index 0000000000..18abb115e6 --- /dev/null +++ b/.github/workflows/sync_fork.yml @@ -0,0 +1,45 @@ +name: Sync Fork +run-name: Sync Fork +on: + schedule: + - cron: '58 23 * * *' # run every day - two minutes to midnight + workflow_dispatch: # to enable manual runs of the workflow + +jobs: + Get-Timestamp: + runs-on: ubuntu-latest + steps: + - run: date + + Sync-With-Upstream: + runs-on: ubuntu-latest + steps: + - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub" + - run: echo "Running on branch ${{ github.ref }}, repository ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: echo "The ${{ github.repository }} repository has been cloned to the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - name: Sync repository with upstream + run: | + cd ${{ github.workspace }} + git config --global user.email "jcarmona@eso.org" + git config --global user.name "Nightly Sync" + git remote add upstream https://github.com/astropy/astroquery.git + git remote -v + git fetch upstream main + echo "--- upstream log: " + git log upstream/main --oneline -10 + echo "--- current branch log before merge: " + git log --oneline -10 + git merge upstream/main + echo "--- current branch log after merge: " + git log --oneline -10 + echo "--- push force with lease" + git push --force-with-lease + - run: echo "The job finished with status ${{ job.status }}." From f03b75f72a9986192cbda54cc042115c680a6df2 Mon Sep 17 00:00:00 2001 From: "Juan M. Carmona Loaiza" Date: Thu, 11 Sep 2025 16:19:21 +0200 Subject: [PATCH 02/30] Setup custom CI/CD for ESO submodule --- .github/workflows/ci_devtests.yml | 2 ++ .github/workflows/ci_tests.yml | 2 ++ setup.cfg | 4 +++- tox.ini | 6 +++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_devtests.yml b/.github/workflows/ci_devtests.yml index cfb68e4b1c..509fc3e7ea 100644 --- a/.github/workflows/ci_devtests.yml +++ b/.github/workflows/ci_devtests.yml @@ -5,11 +5,13 @@ on: push: branches: - main + - develop tags: - '*' pull_request: branches: - main + - develop schedule: # run every Monday at 5am UTC - cron: '0 5 * * 1' diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index d0db0f48cc..0135d90b1e 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -5,11 +5,13 @@ on: push: branches: - main + - develop tags: - '*' pull_request: branches: - main + - develop schedule: # run every Monday at 5am UTC - cron: '0 5 * * 1' diff --git a/setup.cfg b/setup.cfg index ecdc423640..9d128fac73 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,9 @@ show-response = 1 [tool:pytest] minversion = 7.4 norecursedirs = build docs/_build astroquery/irsa astroquery/nasa_exoplanet_archive astroquery/ned astroquery/ibe astroquery/irsa_dust astroquery/cds astroquery/sha astroquery/dace -testpaths = astroquery docs +testpaths = + docs/eso + astroquery/eso doctest_plus = enabled astropy_header = true text_file_format = rst diff --git a/tox.ini b/tox.ini index 5c19109f91..896c0f8341 100644 --- a/tox.ini +++ b/tox.ini @@ -68,12 +68,12 @@ commands = devdeps: pip install -U --pre --no-deps --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy python -m pip freeze - !cov: pytest --pyargs astroquery {toxinidir}/docs {env:PYTEST_ARGS} {posargs} - cov: pytest --pyargs astroquery {toxinidir}/docs --cov astroquery --cov-config={toxinidir}/setup.cfg {env:PYTEST_ARGS} {posargs} + !cov: pytest --pyargs astroquery.eso {toxinidir}/docs/eso {env:PYTEST_ARGS} {posargs} + cov: pytest --pyargs astroquery.eso {toxinidir}/docs/eso --cov astroquery.eso --cov-config={toxinidir}/setup.cfg {env:PYTEST_ARGS} {posargs} # For remote tests, we re-run the failures to filter out at least some of the flaky ones. # We use a second pytest run with --last-failed as opposed to --rerun in order to rerun the # failed ones at the end rather than right away. - online: pytest --pyargs astroquery {toxinidir}/docs {env:PYTEST_ARGS_2} {posargs} + online: pytest --pyargs astroquery.eso {toxinidir}/docs/eso {env:PYTEST_ARGS_2} {posargs} cov: coverage xml -o {toxinidir}/coverage.xml pip_pre = From 591b493b94488b0a3b4d6e49900ead19ba9738bd Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:58:48 +0100 Subject: [PATCH 03/30] update eso for initial catalogue testing --- astroquery/eso/__init__.py | 4 +- astroquery/eso/core.py | 395 ++++++++++++++++++- astroquery/eso/testing/test_catalogues.ipynb | 337 ++++++++++++++++ astroquery/eso/utils.py | 194 ++++++++- 4 files changed, 926 insertions(+), 4 deletions(-) create mode 100644 astroquery/eso/testing/test_catalogues.ipynb diff --git a/astroquery/eso/__init__.py b/astroquery/eso/__init__.py index 25b588981a..9b9b84a0e8 100644 --- a/astroquery/eso/__init__.py +++ b/astroquery/eso/__init__.py @@ -19,7 +19,9 @@ class Conf(_config.ConfigNamespace): tap_url = _config.ConfigItem( "https://archive.eso.org/tap_obs", 'URL for TAP queries.') - + tap_cat_url = _config.ConfigItem( + "https://archive.eso.org/tap_cat", + 'URL for TAP catalogue queries.') conf = Conf() diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 30c473b60d..a8714c106e 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -37,8 +37,10 @@ from ..query import QueryWithLogin from ..utils import schema from .utils import _UserParams, raise_if_coords_not_valid, _reorder_columns, \ - _raise_if_has_deprecated_keys, _build_adql_string, \ - DEFAULT_LEAD_COLS_PHASE3, DEFAULT_LEAD_COLS_RAW + _raise_if_has_deprecated_keys, _build_adql_string, _split_str_as_list_of_str, \ + _normalize_catalogue_list, _build_catalogue_metadata_query, \ + _build_catalogue_columns_query, _build_catalogue_table_query, \ + _set_last_version, DEFAULT_LEAD_COLS_PHASE3, DEFAULT_LEAD_COLS_RAW __all__ = ['Eso', 'EsoClass'] @@ -1052,5 +1054,394 @@ def query_apex_quicklooks(self, authenticated=authenticated) return self._query_on_allowed_values(user_params) + def _tap_catalogues(self, authenticated: bool = False) -> TAPService: + """ + Return a TAPService connected to the catalogue TAP endpoint. + """ + 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 {conf.tap_cat_url}") + if authenticated: + h = self._get_auth_header() + self._session.headers = {**self._session.headers, **h} + return TAPService(conf.tap_cat_url, session=self._session) + return TAPService(conf.tap_cat_url) + + def _run_catalogue_tap_query(self, + query: str, *, + maxrec: Optional[int] = None, + type_of_query: str = "sync", + authenticated: bool = False) -> Table: + """ + Execute a TAP query against the catalogue service. + + Parameters + ---------- + query : str + The ADQL query string to be executed. + maxrec : int, optional + The maximum number of records to retrieve. If not provided, the + current ROW_LIMIT value is used. + type_of_query : str, optional + The TAP query mode, either 'sync' or 'async'. Default is 'sync'. + authenticated : bool, optional + If ``True``, performs the query with an authenticated session. + + Returns + ------- + astropy.table.Table + Table with the query results. + """ + type_of_query = type_of_query.lower() + if type_of_query not in ("sync", "async"): + raise ValueError("`type_of_query` must be 'sync' or 'async'.") + + row_limit = maxrec if maxrec is not None else self.ROW_LIMIT + if row_limit is None or row_limit < 1: + row_limit = sys.maxsize + row_limit_plus_one = row_limit if row_limit >= sys.maxsize else row_limit + 1 + + def message(query_str): + return ( + "Error executing the following catalogue query:\n\n" + f"{query_str}\n\n" + ) + + table_with_extra = Table() + tap_service = self._tap_catalogues(authenticated=authenticated) + tmp_limit = self.ROW_LIMIT + try: + self.ROW_LIMIT = row_limit + if type_of_query == "sync": + table_with_extra = tap_service.search( + query=query, maxrec=row_limit_plus_one + ).to_table() + else: + tap_job = tap_service.submit_job(query=query, maxrec=row_limit_plus_one) + tap_job.run() + tap_job.wait(phases=["EXECUTING", "COMPLETED", "ERROR", "ABORTED"], timeout=10.0) + tap_job.raise_if_error() + table_with_extra = tap_job.fetch_result().to_table() + self._maybe_warn_about_table_length(table_with_extra, row_limit_plus_one) + except DALQueryError: + log.error(message(query)) + except DALFormatError as e: + raise DALFormatError(message(query) + f"cause: {e.cause}") from e + except Exception as e: + raise type(e)(f"{e}\n" + message(query)) from e + finally: + self.ROW_LIMIT = tmp_limit + + return table_with_extra[:row_limit] + + def list_catalogues(self, all_versions: bool = False, + collections: Union[str, List[str]] = None, + tables: Union[str, List[str]] = None, + verbose: bool = False) -> Table: + """ + Retrieve metadata for ESO catalogues. + + Parameters + ---------- + all_versions : bool, optional + If ``True``, includes all versions of the catalogues. Default is ``False``. + collections : str or list of str, optional + Catalogue collection name(s) to filter by. + tables : str or list of str, optional + Catalogue table name(s) to filter by. + verbose : bool, optional + If ``True``, logs the generated ADQL query. + + Returns + ------- + astropy.table.Table + Metadata table for the selected catalogues. The table includes + ``table_RA``, ``table_Dec``, and ``table_ID`` columns when available. + + Raises + ------ + TypeError + If ``collections`` or ``tables`` are not strings or lists of strings. + DALFormatError + If the TAP response is malformed. + """ + clean_collections = _normalize_catalogue_list(collections, "collections") + clean_tables = _normalize_catalogue_list(tables, "tables") + query = _build_catalogue_metadata_query(all_versions, clean_collections, clean_tables) + if verbose: + log.info("Query:\n%s", query) + table = self._run_catalogue_tap_query(query, maxrec=self.ROW_LIMIT, type_of_query="sync") + if len(table) == 0: + return table + + table.sort(["collection", "table_name", "version"]) + _set_last_version(table, update=True) + + ra_id = [None] * len(table) + dec_id = [None] * len(table) + source_id = [None] * len(table) + columns_table = self.list_catalogues_info( + tables=table["table_name"].tolist(), verbose=False + ) + if isinstance(columns_table, Table) and len(columns_table) > 0: + if {"table_name", "column_name", "ucd"}.issubset(columns_table.colnames): + lookup = { + table_name: {"id": [], "ra": [], "dec": []} + for table_name in table["table_name"] + } + for row in columns_table: + table_name = row["table_name"] + ucd = row["ucd"] + if table_name not in lookup: + continue + if ucd == "meta.id;meta.main": + lookup[table_name]["id"].append(row["column_name"]) + elif ucd == "pos.eq.ra;meta.main": + lookup[table_name]["ra"].append(row["column_name"]) + elif ucd == "pos.eq.dec;meta.main": + lookup[table_name]["dec"].append(row["column_name"]) + for idx, table_name in enumerate(table["table_name"]): + entry = lookup.get(table_name, {}) + ids = entry.get("id", []) + ras = entry.get("ra", []) + decs = entry.get("dec", []) + source_id[idx] = ids[0] if len(ids) == 1 else None + ra_id[idx] = ras[0] if len(ras) == 1 else None + dec_id[idx] = decs[0] if len(decs) == 1 else None + + table.add_column( + Column( + data=ra_id, + name="table_RA", + dtype=str, + description="Identifier for RA in the catalog", + ) + ) + table.add_column( + Column( + data=dec_id, + name="table_Dec", + dtype=str, + description="Identifier for Dec in the catalog", + ) + ) + table.add_column( + Column( + data=source_id, + name="table_ID", + dtype=str, + description="Identifier for Source ID in the catalog", + ) + ) + return table + + def list_catalogues_info(self, + collections: Union[str, List[str]] = None, + tables: Union[str, List[str]] = None, + verbose: bool = False) -> Table: + """ + Retrieve column metadata for ESO catalogues. + + Parameters + ---------- + collections : str or list of str, optional + Catalogue collection name(s) to filter by. + tables : str or list of str, optional + Catalogue table name(s) to filter by. + verbose : bool, optional + If ``True``, logs the generated ADQL query. + + Returns + ------- + astropy.table.Table + Table of column metadata (name, UCD, datatype, description, unit). + + Raises + ------ + TypeError + If ``collections`` or ``tables`` are not strings or lists of strings. + DALFormatError + If the TAP response is malformed. + """ + clean_collections = _normalize_catalogue_list(collections, "collections") + clean_tables = _normalize_catalogue_list(tables, "tables") + query = _build_catalogue_columns_query(clean_collections, clean_tables) + if verbose: + log.info("Query:\n%s", query) + return self._run_catalogue_tap_query(query, maxrec=self.ROW_LIMIT, type_of_query="sync") + + def query_catalogues(self, + collections: Union[List[str], str] = None, + tables: Union[List[str], str] = None, + columns: Union[List[str], str] = None, + type_of_query: str = "sync", + all_versions: bool = False, + maxrec: Optional[int] = None, + verbose: bool = False, + conditions_dict: Optional[Dict[str, str]] = None, + top: Optional[int] = None, + order_by: Optional[str] = None, + order: str = "ascending") -> Union[Table, List[Table], None]: + """ + Query ESO catalogues with collection/table filters and custom constraints. + + Parameters + ---------- + collections : str or list of str, optional + Catalogue collection name(s) to query. + tables : str or list of str, optional + Catalogue table name(s) to query. + columns : str or list of str, optional + Column name(s) to retrieve. If not provided, selects all columns. + type_of_query : str, optional + The TAP query mode, either 'sync' or 'async'. Default is 'sync'. + all_versions : bool, optional + If ``True``, includes obsolete catalogue versions when expanding collections. + Default is ``False``. + maxrec : int, optional + Maximum number of rows to retrieve per catalogue. Defaults to ROW_LIMIT. + verbose : bool, optional + If ``True``, logs the generated ADQL query for each catalogue. + conditions_dict : dict, optional + Additional query constraints in ADQL syntax, e.g., + ``{"mag": "< 20", "flag": "= 0"}``. + top : int, optional + When set, selects only the top N rows. + order_by : str, optional + Column name to order by. + order : str, optional + Sort order: 'ascending' or 'descending'. Default is 'ascending'. + + Returns + ------- + astropy.table.Table or list of astropy.table.Table or None + If only one catalogue is queried, returns a single table. Otherwise, + returns a list of tables. Returns ``None`` if no catalogues match. + + Raises + ------ + TypeError + If ``columns`` or ``conditions_dict`` types are invalid. + ValueError + If ``type_of_query`` or ``order`` are invalid. + DALFormatError + If the TAP response is malformed. + """ + clean_collections = _normalize_catalogue_list(collections, "collections") + clean_tables = _normalize_catalogue_list(tables, "tables") + + table_names = list(clean_tables or []) + if clean_collections: + collections_table = self.list_catalogues( + all_versions=all_versions, + collections=clean_collections, + tables=None, + verbose=False, + ) + if isinstance(collections_table, Table) and len(collections_table) > 0: + table_names += collections_table["table_name"].tolist() + + # De-duplicate tables while preserving order. + table_names = list(dict.fromkeys(table_names)) + if not table_names: + return None + + if conditions_dict is not None and not isinstance(conditions_dict, dict): + raise TypeError("`conditions_dict` must be a dictionary.") + + requested_columns = None + if columns is not None: + if isinstance(columns, str): + requested_columns = _split_str_as_list_of_str(columns) + else: + if hasattr(columns, "tolist"): + columns = columns.tolist() + if not isinstance(columns, (list, tuple, set)): + raise TypeError("`columns` must be a string or list of strings.") + requested_columns = [] + for col in columns: + if not isinstance(col, str): + raise TypeError("All `columns` entries must be strings.") + requested_columns.append(col.strip()) + + columns_table = None + if requested_columns is not None: + columns_table = self.list_catalogues_info(tables=table_names, verbose=False) + + column_lookup = {} + if isinstance(columns_table, Table) and len(columns_table) > 0: + if {"table_name", "column_name"}.issubset(columns_table.colnames): + for row in columns_table: + column_lookup.setdefault(row["table_name"], set()).add(row["column_name"]) + + totals_lookup = {} + totals_table = self.list_catalogues( + all_versions=all_versions, + collections=None, + tables=table_names, + verbose=False, + ) + if isinstance(totals_table, Table) and "number_rows" in totals_table.colnames: + for row in totals_table: + try: + totals_lookup[row["table_name"]] = int(row["number_rows"]) + except Exception: + totals_lookup[row["table_name"]] = None + + results = [] + for table_name in table_names: + valid_columns = requested_columns + if requested_columns is not None and column_lookup: + valid_columns = [ + col for col in requested_columns + if col in column_lookup.get(table_name, set()) + ] + + query = _build_catalogue_table_query( + table_name, + valid_columns, + conditions_dict, + order_by, + order, + top, + ) + if verbose: + log.info("Query:\n%s", query) + + effective_maxrec = maxrec if maxrec is not None else self.ROW_LIMIT + result_table = self._run_catalogue_tap_query( + query, + maxrec=effective_maxrec, + type_of_query=type_of_query, + ) + results.append(result_table) + + total_rows = totals_lookup.get(table_name) + if total_rows is not None: + log.info( + "The query to %s returned %d entries out of %d (with a limit set to maxrec=%s)", + table_name, + len(result_table), + total_rows, + effective_maxrec, + ) + else: + log.info( + "The query to %s returned %d entries (with a limit set to maxrec=%s)", + table_name, + len(result_table), + effective_maxrec, + ) + + return results[0] if len(results) == 1 else results + Eso = EsoClass() diff --git a/astroquery/eso/testing/test_catalogues.ipynb b/astroquery/eso/testing/test_catalogues.ipynb new file mode 100644 index 0000000000..c465f9308e --- /dev/null +++ b/astroquery/eso/testing/test_catalogues.ipynb @@ -0,0 +1,337 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.4.12.dev10525\n", + "/opt/anaconda3/envs/astroquery_testing/lib/python3.9/site-packages/astroquery/__init__.py\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING: MaxResultsWarning: Results truncated to 1000. To retrieve all the records set to None the ROW_LIMIT attribute [astroquery.eso.core]\n" + ] + } + ], + "source": [ + "import astroquery\n", + "print(astroquery.__version__) # Print the version of astroquery\n", + "print(astroquery.__file__) # Print the file path of astroquery\n", + "from astroquery.eso import Eso # Import the ESO module\n", + "\n", + "eso = Eso()\n", + "all_catalogues = eso.list_catalogues(all_versions=False) " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Table length=86\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
collectioninstrumenttable_nametitleversionnumber_rows
objectobjectobjectobjectint32int64
1101.A-0127MUSEAMUSED_MAIN_SOURCE_CAT_V1AMUSED: the MUSE Hubble Ultra-Deep Field surveys12221
195.B-0283HAWKIGNS_catalogue_V1GALACTICNUCLEUS Survey13277646
196.D-0214FORS2EREBOS_RV_cat_fits_V1EREBOS_RV_cat.fits1359
196.D-0214FORS2EREBOS_cat_fits_V1EREBOS_cat.fits19
AMBREHARPSAMBRE_HARPS_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - HARPS1126688
AMBREUVESAMBRE_UVES_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - UVES151897
AMBREFEROSAMBRE_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra118618
ATLASGALAPEXBOLATLASGAL_V1ATLASGAL - APEX Large Area Survey of the Galaxy110861
FDSOMEGACAMFDS_SourceCatalogue_V1Fornax Deep Survey Source Catalogue13112605
GAIAESOMULTIGES_2021_VRADGAIAESO catalogue of radial velocities1110762
..................
VVVVIRCAMVVV_bandMergedSourceCat_V3VVV: ZYJHKs Catalogue in the Via Lactea3590682953
VVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
VVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
VVVXVIRCAMVVVX_VIRAC_V2_OBSVIRAC2 observation details1197423
VVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
VVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
VVVXVIRCAMVVVX_VIRAC_V2_REJECTED_SOURCESVIRAC2 source catalogue - Rejected Sources1844909545
VVVXVIRCAMVVVX_VIRAC_V2_SOURCESVIRAC2 source catalogue1545346533
XQ-100XSHOOTERXQ_100_summary_fits_V1Quasars and their absorption lines: a legacy survey of the high-redshift universe (XQ-100)1100
ZCOSMOSVIMOSZCOSMOS_V2zCOSMOS Spectroscopic Redshift Survey220689
" + ], + "text/plain": [ + "\n", + " collection instrument table_name ... version number_rows\n", + " object object object ... int32 int64 \n", + "----------- ---------- ------------------------------ ... ------- -----------\n", + "1101.A-0127 MUSE AMUSED_MAIN_SOURCE_CAT_V1 ... 1 2221\n", + " 195.B-0283 HAWKI GNS_catalogue_V1 ... 1 3277646\n", + " 196.D-0214 FORS2 EREBOS_RV_cat_fits_V1 ... 1 359\n", + " 196.D-0214 FORS2 EREBOS_cat_fits_V1 ... 1 9\n", + " AMBRE HARPS AMBRE_HARPS_V1 ... 1 126688\n", + " AMBRE UVES AMBRE_UVES_V1 ... 1 51897\n", + " AMBRE FEROS AMBRE_V1 ... 1 18618\n", + " ATLASGAL APEXBOL ATLASGAL_V1 ... 1 10861\n", + " FDS OMEGACAM FDS_SourceCatalogue_V1 ... 1 3112605\n", + " GAIAESO MULTI GES_2021_VRAD ... 1 110762\n", + " ... ... ... ... ... ...\n", + " VVV VIRCAM VVV_bandMergedSourceCat_V3 ... 3 590682953\n", + " VVVX VIRCAM VVVX_VIRAC_V2_LC ... 1 95768366366\n", + " VVVX VIRCAM VVVX_VIRAC_V2_LC ... 1 95768366366\n", + " VVVX VIRCAM VVVX_VIRAC_V2_OBS ... 1 197423\n", + " VVVX VIRCAM VVVX_VIRAC_V2_REJECTED_LC ... 1 27419652812\n", + " VVVX VIRCAM VVVX_VIRAC_V2_REJECTED_LC ... 1 27419652812\n", + " VVVX VIRCAM VVVX_VIRAC_V2_REJECTED_SOURCES ... 1 844909545\n", + " VVVX VIRCAM VVVX_VIRAC_V2_SOURCES ... 1 545346533\n", + " XQ-100 XSHOOTER XQ_100_summary_fits_V1 ... 1 100\n", + " ZCOSMOS VIMOS ZCOSMOS_V2 ... 2 20689" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "all_catalogues = eso.list_catalogues(all_versions=False) # Get all the available catalogues (only most recent version)\n", + "all_catalogues['collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Table length=4\n", + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
collectioninstrumenttable_nametitleversionnumber_rows
objectobjectobjectobjectint32int64
KIDSOMEGACAMKiDS_DR3_0_ugri_src_fits_V2The Kilo-Degree Survey248736590
KIDSOMEGACAMKiDS_DR3_1_ugri_shear_fits_V1The Kilo-Degree Survey: Weak lensing shear mesurements114650348
KIDSOMEGACAM, VIRCAMKiDS_DR4_1_ugriZYJHKs_cat_fitsThe Kilo-Degree Survey 9-band ugriZYJHKs source catalogue4100350804
KIDSMULTIKiDS_DR5_0_ugriZYJHKs_cat_fitsThe Kilo-Degree Survey 10-band ugri1i2ZYJHKs source catalogue5138812117
" + ], + "text/plain": [ + "\n", + "collection instrument ... version number_rows\n", + " object object ... int32 int64 \n", + "---------- ---------------- ... ------- -----------\n", + " KIDS OMEGACAM ... 2 48736590\n", + " KIDS OMEGACAM ... 1 14650348\n", + " KIDS OMEGACAM, VIRCAM ... 4 100350804\n", + " KIDS MULTI ... 5 138812117" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "kids_catalogues = eso.list_catalogues(all_versions=False, collections='KIDS') # only most recent versions of KIDS catalogues\n", + "kids_catalogues['collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Table length=5\n", + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
collectioninstrumenttable_nametitleversionnumber_rows
objectobjectobjectobjectint32int64
KIDSOMEGACAMKiDS_DR3_0_ugri_src_fits_V2The Kilo-Degree Survey248736590
KIDSOMEGACAMKiDS_DR3_1_ugri_shear_fits_V1The Kilo-Degree Survey: Weak lensing shear mesurements114650348
KIDSOMEGACAMKiDS_DR4_0_ugriZYJHKs_cat_fits_V3The Kilo-Degree Survey 9-band ugriZYJHKs source catalogue3100350871
KIDSOMEGACAM, VIRCAMKiDS_DR4_1_ugriZYJHKs_cat_fitsThe Kilo-Degree Survey 9-band ugriZYJHKs source catalogue4100350804
KIDSMULTIKiDS_DR5_0_ugriZYJHKs_cat_fitsThe Kilo-Degree Survey 10-band ugri1i2ZYJHKs source catalogue5138812117
" + ], + "text/plain": [ + "\n", + "collection instrument ... version number_rows\n", + " object object ... int32 int64 \n", + "---------- ---------------- ... ------- -----------\n", + " KIDS OMEGACAM ... 2 48736590\n", + " KIDS OMEGACAM ... 1 14650348\n", + " KIDS OMEGACAM ... 3 100350871\n", + " KIDS OMEGACAM, VIRCAM ... 4 100350804\n", + " KIDS MULTI ... 5 138812117" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "kids_catalogues = eso.list_catalogues(all_versions=True, collections='KIDS') # get all versions of KIDS catalogues\n", + "kids_catalogues['collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Table length=10\n", + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
table_namecolumn_nameucddatatypedescriptionunit
objectobjectobjectobjectobjectobject
KiDS_DR3_0_ugri_src_fits_V2IDmeta.id;meta.mainCHARSource identifier
KiDS_DR3_0_ugri_src_fits_V2SCIDmeta.idBIGINTAstro-WISE SourceCollection identifier
KiDS_DR3_0_ugri_src_fits_V2SLIDmeta.idBIGINTAstro-WISE SourceList identifier
KiDS_DR3_0_ugri_src_fits_V2SIDmeta.idBIGINTAstro-WISE Source identifier
KiDS_DR3_0_ugri_src_fits_V2RAJ2000pos.eq.ra;meta.mainDOUBLERight ascensiondeg
KiDS_DR3_0_ugri_src_fits_V2DECJ2000pos.eq.dec;meta.mainDOUBLEDeclinationdeg
KiDS_DR3_0_ugri_src_fits_V2SG2DPHOTsrc.class.starGalaxyBIGINTStar/galaxy separation
KiDS_DR3_0_ugri_src_fits_V2Aphys.angSize.smajAxisDOUBLELinear semi major axispixel
KiDS_DR3_0_ugri_src_fits_V2Bphys.angSize.sminAxisDOUBLELinear semi minor axispixel
KiDS_DR3_0_ugri_src_fits_V2CLASS_STARsrc.class.starGalaxyREALSExtractor star/galaxy classifier
" + ], + "text/plain": [ + "\n", + " table_name column_name ... unit \n", + " object object ... object\n", + "--------------------------- ----------- ... ------\n", + "KiDS_DR3_0_ugri_src_fits_V2 ID ... \n", + "KiDS_DR3_0_ugri_src_fits_V2 SCID ... \n", + "KiDS_DR3_0_ugri_src_fits_V2 SLID ... \n", + "KiDS_DR3_0_ugri_src_fits_V2 SID ... \n", + "KiDS_DR3_0_ugri_src_fits_V2 RAJ2000 ... deg\n", + "KiDS_DR3_0_ugri_src_fits_V2 DECJ2000 ... deg\n", + "KiDS_DR3_0_ugri_src_fits_V2 SG2DPHOT ... \n", + "KiDS_DR3_0_ugri_src_fits_V2 A ... pixel\n", + "KiDS_DR3_0_ugri_src_fits_V2 B ... pixel\n", + "KiDS_DR3_0_ugri_src_fits_V2 CLASS_STAR ... " + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "kids_columns = eso.list_catalogues_info(collections='KIDS') \n", + "kids_columns[:10]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "INFO: The query to %s returned %d entries out of %d (with a limit set to maxrec=%s) [astroquery.eso.core]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING: MaxResultsWarning: Results truncated to 10. To retrieve all the records set to None the ROW_LIMIT attribute [astroquery.eso.core]\n" + ] + } + ], + "source": [ + "table_name = 'KiDS_DR4_1_ugriZYJHKs_cat_fits' \n", + "kids_catalogue = eso.query_catalogues(tables=table_name, maxrec=10) # Get the KIDS catalogues" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Table length=10\n", + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
LevelALPHA_J2000A_IMAGEA_WORLDAgaperAgaper_0p7Agaper_1p0BPZ_FILTBPZ_FLAGFILTBPZ_NONDETFILTB_IMAGEB_WORLDBackGrBgaperBgaper_0p7Bgaper_1p0CHI_SQUARED_BPZCLASS_STARCOLOUR_GAAP_H_KsCOLOUR_GAAP_J_HCOLOUR_GAAP_Y_JCOLOUR_GAAP_Z_YCOLOUR_GAAP_g_rCOLOUR_GAAP_i_ZCOLOUR_GAAP_r_iCOLOUR_GAAP_u_gCXX_WORLDCXY_WORLDCYY_WORLDDECJ2000DELTA_J2000ERRA_IMAGEERRA_WORLDERRB_IMAGEERRB_WORLDERRCXX_WORLDERRCXY_WORLDERRCYY_WORLDERRTHETA_J2000ERRTHETA_WORLDERRX2_WORLDERRXY_WORLDERRY2_WORLDEXTINCTION_HEXTINCTION_JEXTINCTION_KsEXTINCTION_YEXTINCTION_ZEXTINCTION_gEXTINCTION_iEXTINCTION_rEXTINCTION_uFIELD_POSFLAG_GAAP_0p7_HFLAG_GAAP_0p7_JFLAG_GAAP_0p7_KsFLAG_GAAP_0p7_YFLAG_GAAP_0p7_ZFLAG_GAAP_0p7_gFLAG_GAAP_0p7_iFLAG_GAAP_0p7_rFLAG_GAAP_0p7_uFLAG_GAAP_1p0_HFLAG_GAAP_1p0_JFLAG_GAAP_1p0_KsFLAG_GAAP_1p0_YFLAG_GAAP_1p0_ZFLAG_GAAP_1p0_gFLAG_GAAP_1p0_iFLAG_GAAP_1p0_rFLAG_GAAP_1p0_uFLAG_GAAP_HFLAG_GAAP_JFLAG_GAAP_KsFLAG_GAAP_YFLAG_GAAP_ZFLAG_GAAP_gFLAG_GAAP_iFLAG_GAAP_rFLAG_GAAP_uFLUXERR_APER_10FLUXERR_APER_100FLUXERR_APER_14FLUXERR_APER_20FLUXERR_APER_30FLUXERR_APER_4FLUXERR_APER_40FLUXERR_APER_6FLUXERR_APER_60FLUXERR_APER_8FLUXERR_AUTOFLUXERR_GAAP_0p7_HFLUXERR_GAAP_0p7_JFLUXERR_GAAP_0p7_KsFLUXERR_GAAP_0p7_YFLUXERR_GAAP_0p7_ZFLUXERR_GAAP_0p7_gFLUXERR_GAAP_0p7_iFLUXERR_GAAP_0p7_rFLUXERR_GAAP_0p7_uFLUXERR_GAAP_1p0_HFLUXERR_GAAP_1p0_JFLUXERR_GAAP_1p0_KsFLUXERR_GAAP_1p0_YFLUXERR_GAAP_1p0_ZFLUXERR_GAAP_1p0_gFLUXERR_GAAP_1p0_iFLUXERR_GAAP_1p0_rFLUXERR_GAAP_1p0_uFLUXERR_GAAP_HFLUXERR_GAAP_JFLUXERR_GAAP_KsFLUXERR_GAAP_YFLUXERR_GAAP_ZFLUXERR_GAAP_gFLUXERR_GAAP_iFLUXERR_GAAP_rFLUXERR_GAAP_uFLUXERR_ISOFLUXERR_ISOCORFLUX_APER_10FLUX_APER_100FLUX_APER_14FLUX_APER_20FLUX_APER_30FLUX_APER_4FLUX_APER_40FLUX_APER_6FLUX_APER_60FLUX_APER_8FLUX_AUTOFLUX_GAAP_0p7_HFLUX_GAAP_0p7_JFLUX_GAAP_0p7_KsFLUX_GAAP_0p7_YFLUX_GAAP_0p7_ZFLUX_GAAP_0p7_gFLUX_GAAP_0p7_iFLUX_GAAP_0p7_rFLUX_GAAP_0p7_uFLUX_GAAP_1p0_HFLUX_GAAP_1p0_JFLUX_GAAP_1p0_KsFLUX_GAAP_1p0_YFLUX_GAAP_1p0_ZFLUX_GAAP_1p0_gFLUX_GAAP_1p0_iFLUX_GAAP_1p0_rFLUX_GAAP_1p0_uFLUX_GAAP_HFLUX_GAAP_JFLUX_GAAP_KsFLUX_GAAP_YFLUX_GAAP_ZFLUX_GAAP_gFLUX_GAAP_iFLUX_GAAP_rFLUX_GAAP_uFLUX_ISOFLUX_ISOCORFLUX_RADIUSFWHM_IMAGEFWHM_WORLDFlagHTMIDIMAFLAGS_ISOISO0ISO1ISO2ISO3ISO4ISO5ISO6ISO7ISOAREA_WORLDKIDS_TILEKRON_RADIUSMAGERR_APER_10MAGERR_APER_100MAGERR_APER_14MAGERR_APER_20MAGERR_APER_4MAGERR_APER_40MAGERR_APER_6MAGERR_APER_60MAGERR_APER_8MAGERR_AUTOMAGERR_GAAP_0p7_HMAGERR_GAAP_0p7_JMAGERR_GAAP_0p7_KsMAGERR_GAAP_0p7_YMAGERR_GAAP_0p7_ZMAGERR_GAAP_0p7_gMAGERR_GAAP_0p7_iMAGERR_GAAP_0p7_rMAGERR_GAAP_0p7_uMAGERR_GAAP_1p0_HMAGERR_GAAP_1p0_JMAGERR_GAAP_1p0_KsMAGERR_GAAP_1p0_YMAGERR_GAAP_1p0_ZMAGERR_GAAP_1p0_gMAGERR_GAAP_1p0_iMAGERR_GAAP_1p0_rMAGERR_GAAP_1p0_uMAGERR_GAAP_HMAGERR_GAAP_JMAGERR_GAAP_KsMAGERR_GAAP_YMAGERR_GAAP_ZMAGERR_GAAP_gMAGERR_GAAP_iMAGERR_GAAP_rMAGERR_GAAP_uMAGERR_ISOMAGERR_ISOCORMAGGERR_APER_30MAG_APER_10MAG_APER_100MAG_APER_14MAG_APER_20MAG_APER_30MAG_APER_4MAG_APER_40MAG_APER_6MAG_APER_60MAG_APER_8MAG_AUTOMAG_GAAP_0p7_HMAG_GAAP_0p7_JMAG_GAAP_0p7_KsMAG_GAAP_0p7_YMAG_GAAP_0p7_ZMAG_GAAP_0p7_gMAG_GAAP_0p7_iMAG_GAAP_0p7_rMAG_GAAP_0p7_uMAG_GAAP_1p0_HMAG_GAAP_1p0_JMAG_GAAP_1p0_KsMAG_GAAP_1p0_YMAG_GAAP_1p0_ZMAG_GAAP_1p0_gMAG_GAAP_1p0_iMAG_GAAP_1p0_rMAG_GAAP_1p0_uMAG_GAAP_HMAG_GAAP_JMAG_GAAP_KsMAG_GAAP_YMAG_GAAP_ZMAG_GAAP_gMAG_GAAP_iMAG_GAAP_rMAG_GAAP_uMAG_ISOMAG_ISOCORMAG_LIM_HMAG_LIM_JMAG_LIM_KsMAG_LIM_YMAG_LIM_ZMAG_LIM_gMAG_LIM_iMAG_LIM_rMAG_LIM_uMASKMU_MAXMU_THRESHOLDM_0MaxValNBPZ_FILTNBPZ_FLAGFILTNBPZ_NONDETFILTNIMAFLAGS_ISOODDSPAgaapRAJ2000SG2DPHOTSG_FLAGSIDSLIDS_ELLIPTICITYS_ELONGATIONSeqNrTHELI_NAMETHETA_J2000THETA_WORLDT_BT_MLX2_WORLDXMAX_IMAGEXMIN_IMAGEXY_WORLDX_WORLDXposY2_WORLDYMAX_IMAGEYMIN_IMAGEY_WORLDYposZ_BZ_B_MAXZ_B_MINZ_ML
countdegpixeldegarcsecarcsecarcsecpixeldegcountarcsecarcsecarcsecmagmagmagmagmagmagmagmagdeg**(-2)deg**(-2)deg**(-2)degdegpixeldegpixeldegdeg**(-2)deg**(-2)deg**(-2)degdegdeg**2deg**2deg**2magmagmagmagmagmagmagmagmagcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountpixelpixeldegpixel**2pixel**2pixel**2pixel**2pixel**2pixel**2pixel**2pixel**2deg**2pixelmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmag.arcsec**(-2)mag.arcsec**(-2)magcountdegdegdegdegdeg**2pixelpixeldeg**2degpixeldeg**2pixelpixeldegpixel
float32float64float64float32float32float32float32int32int32int32float64float32float32float32float32float32float64float32float32float32float32float32float32float32float32float32float32float32float32float64float64float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32int16int16int16int16int16int16int32int32int32int32int16int16int16int16int16int32int32int32int32int16int16int16int16int16int16int16int16int16float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32int16int32objectint16int16int16int16int16int16int16int16int16float32objectfloat32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32int32float32float32float64float32int32int32int32int16float64float32float64int16float32int32int32float32float32int32objectfloat32float32float64float64float32int16int16float32float64float32float32int16int16float64float32float64float64float64float64
0.033165265.0790351.0235426.084906e-050.730.731.02511000.75228299999999994.469738e-05-0.0017154590.720.721.010.7290.46484760.29991530.49968910.146846770.40676881.32960890.952152250.3874302-0.62006190.003612689-0.00076210870.002087776-28.686515-28.6865150.15672519.317543e-060.11101976.595674e-068.399833e-05-2.136587e-054.632119e-0514.7784375.221574.632119e-111.068304e-118.399833e-110.0078360370.0123454550.00524866630.0189986940.0220296140.057601770.029611810.039848640.0739248810000000000000000000000000000.19809811.9727470.27665760.39451150.59137990.080621470.78793330.11983471.1810960.15883160.2735538196.62798124.66181238.99669158.690569.5472.7e-111.71e-104.11e-116.48e-11251.6214156.75671308.5334190.8169485.86073.06e-112.07e-104.61e-117.23e-11196.62798124.66181238.99669158.690569.5472.7e-111.71e-104.11e-116.48e-110.074607720.17720881.596522.4921692.03042.7329234.3372950.54272714.3494090.90840273.3192411.2815951.8628962737.44021720.62123617.13571493.72961024.12837.9394e-114.5041e-103.0745e-101.2166e-103256.9052114.56034415.32231885.77691198.38679.304e-113.9883e-103.5764e-109.2285e-112737.44021720.62123617.13571493.72961024.12837.9394e-114.5041e-103.0745e-101.2166e-100.4936681.1097663.0711524.069960.000241936521405256194KiDSDR4 J002018.968-284111.450877654432.826914e-08KIDS_5.6_-28.27.957740.13475220.85965420.14797580.15676970.1613240.19673840.1432630.38643490.1345910.15947190.07798750.07866340.07173840.1153460.07373070.36923290.41220420.14514150.578297730.08388160.08048790.07586890.1098630.07778960.357088660.563516740.139952020.8506120.07798750.07866340.07173840.1153460.07373070.36923290.41220420.14514150.578297730.16412640.17341390.148073524.1520623.6685623.8910523.5684323.0669525.3235523.0639224.764323.357424.3906223.9845321.406621.910821.104122.064322.474125.17886423.43383423.83150124.57512521.21821.686920.887621.811322.303525.0074823.57097223.66997124.8820321.39876621.89845521.0988522.04530122.4520725.12126223.40422223.79165324.501225.4264124.5469224.26588624.76066624.0540224.49862325.39430426.34992224.48536726.01633325.259056024.1433225.1279523.5230.073705490000.61812-76.75.07903501.04343605136210.26502021.3605824344KIDS_5p6_m28p213.2774176.722591.63600000000000011.63600000000000012.087776e-0918819188173.810582e-105.07903518817.863.612689e-0921682165-28.6865152166.2790.78999999999999990.970.66999999999999990.7799999999999999
0.033164135.1278182.0878840.00012409190.830.831.1511001.9293860.00011468860.00096040870.810.811.083.3030.017473550.456529620.160476680.1237812040.181455610.719900130.503206250.62137030.613328930.01324539-0.00088975720.01530689-28.686661-28.6866610.080348744.775494e-060.074937234.454466e-061.996915e-05-1.199723e-062.267847e-0578.0576911.94232.267847e-115.998675e-131.996915e-110.0083840660.0132088590.00561574240.0203274040.02357030.061630260.031682760.042635530.0790949610000000000000000000000000000.20213851.9679470.27962150.39648280.59248140.085124270.78884580.12468741.1816530.16327070.4096192251.87572167.1169208.39558143.0128652.4952282.73e-111.34e-104.21e-116.54e-11309.84167204.47795258.70938170.1577663.2387963.13e-111.6e-104.79e-117.43e-11251.87572167.1169208.39558143.0128652.4952282.73e-111.34e-104.21e-116.54e-110.18546420.29874915.3274585.9959626.2738256.9701557.8567921.6791917.9386973.1898576.0799574.4194297.018614051.9013479.6136185.02053084.2152601.79444.3013e-101.7294e-099.5104e-102.1142e-104348.3043868.22786566.3023274.38042917.63674.8485e-101.8597e-099.9146e-102.552e-104051.9013479.6136185.02053084.2152601.79444.3013e-101.7294e-099.5104e-102.1142e-105.1524556.5961843.2383037.0502580.000419098701940157430KiDSDR4 J002030.676-284111.9705957504230241552.084849e-07KIDS_5.6_-28.25.1543820.041205840.35643820.048402530.061774850.055053280.10791270.042450350.21106640.040121010.0633810.06749190.05214510.03658240.05034480.02190640.068910790.0841266660.0480626370.33585820.07736490.0573930.04277750.05642180.0235330.070090840.093411730.0524547250.316105780.06749190.05214510.03658240.05034480.02190640.068910790.0841266660.0480626370.33585820.03909090.049186240.0818953522.843722.7153522.6661722.5518922.4218924.0972522.4106323.4005722.7002523.0465922.5443720.980921.146220.521621.277121.461823.34433621.97311822.6054423.9751320.904221.031220.456721.212221.337423.21513721.89933622.56289723.77765720.97251521.13299220.51598521.25677321.43822923.28270521.94143522.56280523.89603422.8799622.6117723.99703424.4424524.20277824.61156325.699726.33792524.75009325.99023225.249051229223.2341525.1279521.8440.170281190000.95672-11.75.12781801.04349605136210.075913551.082154350KIDS_5p6_m28p278.3272411.672762.8182.8181.530689e-0818102180934.44883e-105.12781818097.861.324538e-0821712162-28.6866612167.0660.83000000000000010.920.78999999999999990.8300000000000001
0.033205575.1710882.66071499999999970.000158160.90.91.15511002.4315810.0001445194-0.0012118120.870.871.134.2110.0235560.267618180.281677250.213691710.127523420.57171440.317111970.58469390.407556530.022489060.004024360.02341139-28.68675-28.686750.063209223.757584e-060.054932613.264565e-061.148496e-052.953093e-061.329186e-05-60.73038-29.269621.329186e-11-1.476561e-121.148496e-110.0087260830.0137476970.0058448290.0211566350.0245318190.064144390.032975230.044374790.0823215410000000000000000000000000000.2069911.9801790.28397070.40023680.59562230.089291550.79257020.12924691.1906170.16821430.4653718266.298146.86647284.13065170.8724877.0645142.79e-111.41e-104.29e-116.51e-11325.57266176.0589346.78217201.6673491.300313.2e-111.66e-104.88e-117.42e-11266.298146.86647284.13065170.8724877.0645142.79e-111.41e-104.29e-116.51e-110.25103150.35853210.113959.0252812.6385914.5213515.874533.00029516.144925.66074617.230918.11403815.060697332.3765630.73059407.1114593.234071.4349.4589e-103.2113e-091.8259e-095.6158e-107973.5626089.32769826.0964967.4244375.43071.0386e-093.5337e-091.9853e-096.1302e-107332.3765630.73059407.1114593.234071.4349.4589e-103.2113e-091.8259e-095.6158e-1012.0420614.088143.7381567.2038780.000428230501641070272KiDSDR4 J002041.061-284112.2901091048764493520113.85167e-07KIDS_5.6_-28.24.6015940.022225960.23827230.024400850.029932280.032320360.053312820.02479570.075040170.022514160.033557150.03943190.02831930.03279340.04039040.02055090.0320249050.0476719140.0255096550.125861720.04433230.03139160.03831780.04407870.02265560.03345230.051003820.0266881210.13141760.03943190.02831930.03279340.04039040.02055090.0320249050.0476719140.0255096550.125861720.022638990.027637850.0407474122.147722.2713521.9057521.7549821.6582523.4670921.6399122.7778121.5692322.3869121.7153920.336920.623620.066420.844720.975622.48873121.30115521.89724722.91446520.245920.538620.01920.759720.897422.38803521.2023721.80902122.8261720.32817520.60985220.06055620.82354420.95106722.42458721.26817921.85287322.83214421.9582521.7878723.9365824.58269323.86620524.4183225.28286426.31432324.69480725.96979325.254041622.6246625.1279521.0490.29851490000.9956538.55.17108801.04358605136210.086117391.0942324359KIDS_5p6_m28p2-51.45418-38.545823.3643.3642.341139e-081746617453-2.0122e-095.17108817459.232.248906e-0821742163-28.686752168.210.86000000000000010.890.78999999999999990.8600000000000001
0.025127045.912251201.6614990.01198622.02.02.051001102.6672360.0061042320.20623382.02.02.0222.0290.0003681149-0.913455960.078645706-0.412342070.954074860.317705150.94762610.0013160706--38.0032917.70473142.9275-28.648329-28.6483290.065241753.877772e-060.030923011.838689e-063.465592e-061.981326e-061.49523e-05-85.10667-4.8933341.49523e-11-9.90673e-133.465592e-120.0065265360.0102823720.00437154760.015823770.0183481850.047975770.024663290.033189420.0615710910000000000000000000000000000.23805122.2152640.35368360.52569290.81248480.083669841.0661190.12786191.4753820.18171217.6968855.24866400.5098950.09296484.01984235.716723.77e-112.23e-106.56e-11--855.24866400.5098950.09296484.01984235.716723.77e-112.23e-106.56e-11--855.24866400.5098950.09296484.01984235.716723.77e-112.23e-106.56e-11--11.132812.9576915.784861704.47132.000966.90851152.60592.493956275.49875.557158624.24979.9733866054.4523248.05721549.86510043.44831343.28312986.7383.6842e-095.7423e-095.6025e-09--23248.05721549.86510043.44831343.28312986.7383.6842e-095.7423e-095.6025e-09--23248.05721549.86510043.44831343.28312986.7383.6842e-095.7423e-095.6025e-09--44497.8147288.67221.345863.85190.051351191451800316701KiDSDR4 J002338.940-283853.981-31269297612006-21012-305718706657340.00104741KIDS_5.6_-28.23.6439590.016377950.0014114510.01200280.0085325860.036434260.0042025780.024987240.0025667060.01978660.00029095280.0399420.02017870.1027090.01676650.01970670.01111021450.0421641430.012712948--0.0399420.02017870.1027090.01676650.01970670.01111021450.0421641430.012712948--0.0399420.02017870.1027090.01676650.01970670.01111021450.0421641430.012712948--0.00027170370.00029757780.00578194321.664416.5810320.8970920.096319.2010723.6677818.559722.7978717.671622.1628912.6102419.08419.166419.995318.759619.716221.01247420.67014120.679983--19.08419.166419.995318.759619.716221.01329620.67522820.68263--19.07747319.15611819.99092918.74377619.69785120.96449920.64547720.646793--13.0391512.9731122.6697723.49346722.55558423.28784224.06902325.9874824.19709425.50867824.9404451435620.477225.1279512.5472.1574938018221.04.85.91225101.04359605136210.49089321.9642244360KIDS_5p6_m28p2-85.21107-4.7889321.01.00.000142927574925552-8.852452e-065.9122516519.483.800329e-0531962168-28.6483292823.8530.010.040.010.01
0.042013496.2068543.2896060.00019556870.990.991.22511002.6693230.00015860840.0056740540.90.91.151.10.01317252-0.266632080.40591430.090429306-0.1503830.506525040.164772030.1235942840.813262940.02799085-0.010782940.03541289-28.686387-28.6863870.073465824.367711e-060.057822633.435525e-061.308484e-05-5.543181e-061.779489e-0565.1771724.822831.779489e-112.771618e-121.308484e-110.0079714870.0125588510.0053393920.0193270950.0224104060.058597430.030123660.040537440.075202710000000000000000000000000000.26253212.7576180.36180470.51045840.75984720.1113191.0100710.16186441.565910.21283640.9226745377.9237172.92108490.3477239.10489113.6926653.53e-111.47e-105.74e-117.07e-11449.1889202.87726569.6579271.03824127.9569854.01e-111.71e-106.53e-118e-11377.9237172.92108490.3477239.10489113.6926653.53e-111.47e-105.74e-117.07e-110.34884360.57495119.5691560.6595213.2171916.8889221.595382.4568426.476564.86719536.438627.27953124.223113070.8672104.0782408.06421923.90562203.45079.5945e-102.0011e-091.7414e-093.9259e-103382.6742345.50682576.02422025.12392325.28171.0474e-092.1264e-091.9271e-094.2663e-103070.8672104.0782408.06421923.90562203.45079.5945e-102.0011e-091.7414e-093.9259e-1013.4205217.619956.33986910.838140.00064426740-1276785327KiDSDR4 J002449.644-284110.9901361281128963382084.805753e-07KIDS_5.6_-28.26.1619790.029794690.04937020.029727940.032823760.049206470.04143050.036116230.046669670.031752090.041366470.1336190.08922990.2210860.1349360.05602130.039946310.0797577350.035788020.1955260.1441760.0939120.2400980.1453130.05974650.041567710.087312310.0367902930.203593020.1336190.08922990.2210860.1349360.05602130.039946310.0797577350.035788020.1955260.028228730.035436930.0382115922.2078220.2027521.8571521.59121.324123.6840621.1028522.941820.756122.5047421.1994221.281821.692321.545821.789521.642222.47327821.81468421.94869223.30314621.176821.574421.472621.733921.583822.37887421.7538321.84132423.21972821.27382921.67974321.5404621.77017221.6197922.4146821.78456121.90815523.22794321.8405821.5449923.5564924.4053823.27373924.05352824.86066826.05889724.64956325.65365825.164446022.7659125.1279521.0010.26209890000.84319-27.76.20685401.04363605136210.18855851.2323754364KIDS_5p6_m28p262.2699427.730065.4555.4553.541289e-08218221665.391523e-096.2068542172.9382.799085e-0821752162-28.6863872168.3920.270.350.230.27
0.032584926.161440.7511824.466482e-050.720.721.017004410.4494982.669148e-05-0.0014336170.710.711.01.9880.4679059---3.38939482.2828636--0.508893970.0----0.0008548549-0.00080589960.001852526-28.686318-28.6863180.19087171.134919e-050.11032786.550753e-065.170074e-05-5.206151e-050.000120015971.3447318.655271.200158e-102.603102e-115.170074e-110.0078141380.0123109540.00523399840.0189455990.021968050.057440790.029529050.039737270.0737182910000000000000000000000000000.1933678--0.27080850.38619930.57925190.07801659--0.1168101--0.15522590.1592374317.41986146.4838--214.35852--2.55e-11--4e-11----180.95158------2.9e-11--4.59e-11--317.41986146.4838--214.35852--2.55e-11--4e-11--0.049474530.11225180.7552993--0.52061650.04090799-0.38836060.3974195--0.6197202--0.82565280.669472232.175262726.93396--88.23937--1.0455e-10--1.9011e-10----988.40967------8.7326e-11--1.6082e-10--32.175262726.93396--88.23937--1.0455e-10--1.9011e-10--0.23253190.47088271.7313343.4169140.00020311650-866981024KiDSDR4 J002438.745-284110.740444443221.413457e-08KIDS_5.6_-28.27.2264840.2780321--0.564903410.252580.2131904--0.2046984--0.20417210.258310710.71120.218786--2.63756--0.2648137--0.22844377----0.198769------0.36056098--0.3098824--10.71120.218786--2.63756--0.2648137--0.22844377--0.23106220.258887199.024.9647--25.3687128.1304899.025.66188--25.17951--24.8680125.0956726.231222.8463--25.1358--24.880022--24.353424----22.5127------25.076296--24.537735--26.22338522.83399--25.116854--24.82258--24.313686--26.2437925.4777223.74591424.58552623.42165824.17214824.95120226.41198324.81692926.04578825.286201024.4008825.1279525.0220.0581401430600.32271-19.56.1614401.04382605136210.40161261.6711584383KIDS_5p6_m28p270.5345619.465444.04.01.852526e-09284428424.029538e-106.161442843.1938.548549e-1021732172-28.6863182172.5921.622.050.912.16
0.032729965.97152400000000051.2310297.317097e-050.750.751.037204390.75414.482498e-050.042995530.720.721.012.0170.42035462.3550014-2.3319569----0.0-4.6315823--0.00.005353917-3.155174e-050.002009353-28.686822-28.6868220.18217881.082857e-050.10771616.402728e-060.00011725753.595047e-074.099535e-05-0.1350471-89.864954.099535e-11-1.797541e-131.172575e-100.0063551760.01001240.00425676860.01540830450.0178664380.046716130.024015740.032318010.0599544910000000000000000000000000000.19582441.7090550.27367480.3891670.58181350.079498190.77217170.11811871.0784580.15677590.3259732314.97177152.56778352.0165--102.65685--1.26e-10----395.14658186.44876436.96683245.83205116.562552.97e-111.52e-10----314.97177152.56778352.0165--102.65685--1.26e-10----0.080126170.18359041.674916126.73583.1095315.4812111.430330.53990620.299180.904115244.316311.2282334.56049924.341324207.8134213.40306--8.231131--6.2052e-10----105.19164434.6616111.43045148.1053838.627564.9849e-111.1216e-09----24.341324207.8134213.40306--8.231131--6.2052e-10----0.60017421.2415185.9740075.741210.0003412830-1518449243KiDSDR4 J002353.165-284112.5501197554323.887006e-08KIDS_5.6_-28.28.7146170.12697080.01464490.095580580.077106220.15990750.041310950.14188120.026428320.13862080.0776245914.04920.7971011.79096--13.5411--0.2204647----4.078510.4657284.257641.802153.276320.646880870.1471397----14.04920.7971011.79096--13.5411--0.2204647----0.14498630.1605930.0552783324.1000219.4027523.4282622.8128122.0148525.329221.391324.7694420.5435924.436823.0124726.534124.205824.177--27.7114--23.085966----24.94523.404624.882524.573626.032825.68501522.448347----26.52774424.19578724.172743--27.693533--23.06195----25.2143124.4251223.7543224.54134423.63359324.15400324.9715326.39928224.81692926.04850425.1491971435624.0581725.1279522.9530.0797187120700.30757-89.75.971524000000000501.04387605136210.38742291.6324474388KIDS_5p6_m28p20.270249389.729755.06.02.009353e-09564756451.577603e-115.97152400000000055646.1515.353917e-0921762172-28.6868222174.0610.721.110.470000000000000034.65
0.033210725.1490161.2160227.230684e-050.750.751.03511000.4952482.93655e-05-0.00038682070.710.711.010.120000000000000010.38159640.209178920.419483180.0540447240.339797970.818405150.0538272860.67725754-0.357082370.004777046-0.0026581280.001313565-28.686321-28.6863210.29359081.745754e-050.12058427.150005e-060.0002751549-0.00016289398.07332e-0519.9789270.021088.07332e-118.144777e-112.751549e-100.0085430980.01345941050.00572226430.0207129850.024017390.062799290.032283740.043444260.0805952710000000000000000000000000000.19770691.969890.27632540.39454490.5913870.080119280.78822090.11938261.1821540.15847510.2305012229.9144129.90288248.62883152.1320868.248252.63e-111.27e-104.05e-116.21e-11297.06937162.23967318.85382186.0338984.2093e-111.54e-104.58e-11--229.9144129.90288248.62883152.1320868.248252.63e-111.27e-104.05e-116.21e-110.050594790.099110190.94656321.6773461.3647341.5934611.085460.43960311.6464760.67550952.1277530.83979621.328981746.72327505.10638907.71466477.40405348.0337.5451e-113.499e-101.8273e-109.0624e-11790.3053669.6271006.0845493.12012382.302527.195e-114.5756e-102.0569e-10--746.72327505.10638907.71466477.40405348.0337.5451e-113.499e-101.8273e-109.0624e-110.28635510.45189462.9102954.6053560.000273762801873039605KiDSDR4 J002035.763-284110.750543333221.766821e-08KIDS_5.6_-28.27.4842450.22683081.2754080.21988850.26889630.19792750.5199030.19192840.60336830.20493540.18835810.3342960.2792290.297390.3459860.212910.378455730.394079720.240640920.743999540.4081190.2630560.3440970.4096040.2391530.45270440.365423920.24175562--0.3342960.2792290.297390.3459860.212910.378455730.394079720.240640920.743999540.19188040.23818310.591681324.7196324.0984424.3223824.1541524.5709625.5523524.1186125.0859223.840224.8495724.351222.817123.241522.605123.302823.645925.23417323.70799424.39641224.89488622.755522.935422.493423.267623.54425.28657723.42182424.270552--22.80855823.2280422.59937923.28208523.62188325.17137323.6757124.35296824.81429126.0177425.5224124.09608524.71595424.01112224.54444925.41477226.37844324.80834626.03229925.305265024.0190625.1279523.5930.0826423390000.36479-71.25.14901601.04389605136210.59273122.4553814390KIDS_5p6_m28p218.7527771.247233.4552.7271.313565e-0917786177841.329077e-095.14901617785.024.777046e-0921762173-28.6863212174.1050.771.10.580.64
0.032699425.9749132.777110.0001650780.920.921.167604352.3514570.00013976170.039665220.860.861.123.350.0001344783-1.5594940.18124962--0.0----0.89529990.00.024752030.0072221380.02203207-28.686763-28.6867630.18752951.114757e-050.15378249.139751e-060.00011400483.536768e-059.379852e-05-30.13004-59.869969.379851e-11-1.768402e-111.140048e-100.00634391230.0099946550.00424922440.0153809950.0178347730.046633330.023973170.032260720.0598482310000000000000000000000000000.19698031.8509340.25201660.30740920.48101970.080337490.6741520.11904721.0997040.15817960.7952651357.0216169.9388396.01532------1.4e-104.28e-11--429.59973201.26881474.43588----3.18e-111.65e-104.91e-11--357.0216169.9388396.01532------1.4e-104.28e-11--0.16760880.3865122.980301134.98844.2913535.51902811.656840.639276121.714921.32486349.787862.11232128.79766296.87506250.388670.72846------7.63e-103.2683e-10--411.98676382.7704285.45873----4.5217e-111.2717e-095.2235e-10--296.87506250.388670.72846------7.63e-103.2683e-10--2.6091875.47480216.9087315.325530.00091101763-1513466700KiDSDR4 J002353.979-284112.3404741363221191011.660812e-07KIDS_5.6_-28.28.9182550.071778180.014891020.063777090.060490080.1364770.033715490.097583860.023987350.081324330.029990561.305710.7368896.07914------0.199217650.1421825--1.132150.5709036.02761----0.763571440.140871640.10205732--1.305710.7368896.07914------0.199217650.1421825--0.069762410.076669830.0448137923.4743519.3342623.0785122.8053421.9935525.1457821.318124.3545720.4171923.848121.0116123.818624.003525.376------22.86154623.765133--23.462823.542725.1706----25.790922.31198123.258682--23.81225623.99350525.37175------22.83757223.732872--23.6187422.8140823.61826324.42426923.5057224.09032824.9027426.32213224.70253825.97232825.0960081435624.0450125.1279520.0560.0806910230600.6705255.35.97491301.04391605136210.15327191.1810174392KIDS_5p6_m28p2-34.68153-55.318473.06.02.203207e-0856025592-3.611105e-095.9749135596.1242.475204e-0821832172-28.6867632174.9220.40.490.273.78
0.033154795.101090.7766744.617996e-050.720.721.01511000.4403322.614364e-050.00039918130.710.711.00.6510.4622630.3481102-0.0409851070.64748380.039249420.187986370.67437170.6092758-0.220741270.001982978-0.00088184710.0008331006-28.686098-28.6860980.18457741.097464e-050.10662346.330898e-060.0001122161-4.872033e-054.830683e-0518.6599371.340074.830682e-112.436041e-111.122161e-100.0081456190.0128331930.0054560280.0197492860.022899950.059877470.030781690.041422960.0768454710000000000000000000000000000.1974963--0.27592510.39356180.58980930.079803790.78925620.11888271.1836530.15813550.2040879196.40332123.124146237.4997157.683669.135232.64e-111.25e-104.08e-116.27e-11251.6772155.41145307.6144190.0362785.282253e-111.52e-104.58e-117e-11196.40332123.124146237.4997157.683669.135232.64e-111.25e-104.08e-116.27e-110.050347840.11288361.319186--2.0102932.9117243.5279510.4043963.3856340.66578393.0789450.97115771.5071371247.51861289.96571723.3036705.9836678.95851.5839e-103.8555e-102.1446e-101.6792e-102053.75631807.10022709.3213953.731857.89941.716e-104.4223e-102.7625e-101.1214e-101247.51861289.96571723.3036705.9836678.95851.5839e-103.8555e-102.1446e-101.6792e-100.24000910.47415753.2833913.4397180.000204472201581928112KiDSDR4 J002024.261-284109.950554443211.766821e-08KIDS_5.6_-28.28.8288350.1625859--0.14906020.14678870.2143120.25316740.19391670.41749610.17683550.14705990.1709330.1036310.1496320.2425030.1105560.180967450.352008850.206556160.405405280.1330510.09337380.1232740.2163390.1079310.189814020.373181130.18000620.67773790.1709330.1036310.1496320.2425030.1105560.180967450.352008850.206556160.405405280.22781530.25854610.181559524.35923--23.9018523.4996223.2911925.6429823.335925.1016723.43924.6917824.2146222.259922.223621.909122.87822.920424.42901223.60265424.22257224.22523921.718621.857521.417822.551422.666424.34286323.45882223.95032924.67045622.25175322.21076821.90364322.85825222.89750124.36913523.57187324.18114924.14839426.2094325.4701924.26712824.77414124.06084324.50553325.40075126.37432324.82558326.02428625.2948251228824.3610425.1279523.5290.0603131790000.73042-71.35.1010901.04394605136210.43305431.7638374395KIDS_5p6_m28p218.7425471.257463.2733.1828.331006e-1018493184924.409279e-105.1010918492.381.982978e-0921762174-28.6860982174.7981.041.180.921.1400000000000001
" + ], + "text/plain": [ + "\n", + " Level ALPHA_J2000 ... Z_B_MIN Z_ML \n", + " count deg ... \n", + " float32 float64 ... float64 float64 \n", + "---------- ------------------ ... ------------------- ------------------\n", + "0.03316526 5.079035 ... 0.6699999999999999 0.7799999999999999\n", + "0.03316413 5.127818 ... 0.7899999999999999 0.8300000000000001\n", + "0.03320557 5.171088 ... 0.7899999999999999 0.8600000000000001\n", + "0.02512704 5.912251 ... 0.01 0.01\n", + "0.04201349 6.206854 ... 0.23 0.27\n", + "0.03258492 6.16144 ... 0.91 2.16\n", + "0.03272996 5.9715240000000005 ... 0.47000000000000003 4.65\n", + "0.03321072 5.149016 ... 0.58 0.64\n", + "0.03269942 5.974913 ... 0.27 3.78\n", + "0.03315479 5.10109 ... 0.92 1.1400000000000001" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "kids_catalogue" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "astroquery_testing", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.25" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/astroquery/eso/utils.py b/astroquery/eso/utils.py index e4f910e279..146160359d 100644 --- a/astroquery/eso/utils.py +++ b/astroquery/eso/utils.py @@ -3,7 +3,9 @@ """ from dataclasses import dataclass from typing import Dict, List, Optional, Union -from astropy.table import Table + +import numpy as np +from astropy.table import Column, Table DEFAULT_LEAD_COLS_RAW = ['object', 'ra', 'dec', 'dp_id', 'date_obs', 'prog_id'] DEFAULT_LEAD_COLS_PHASE3 = ['target_name', 's_ra', 's_dec', 'dp_id', 'date_obs', 'proposal_id'] @@ -194,3 +196,193 @@ def _build_adql_string(user_params: _UserParams) -> str: query_string = "select " + query_string return query_string.strip() + + +def _normalize_catalogue_list(values: Union[str, List[str], None], + label: str) -> Optional[List[str]]: + """ + Normalize a catalogue filter to a list of strings. + + Parameters + ---------- + values : str, list of str, or None + Filter values to normalize. + label : str + Label used in error messages. + + Returns + ------- + list of str or None + Normalized list of strings. Returns ``None`` for empty inputs. + """ + if values is None: + return None + if isinstance(values, str): + cleaned = values.strip() + return [cleaned] if cleaned else None + if hasattr(values, "tolist"): + values = values.tolist() + if not isinstance(values, (list, tuple, set)): + raise TypeError(f"`{label}` must be a string or list of strings.") + normalized = [] + for value in values: + if not isinstance(value, str): + raise TypeError(f"All `{label}` entries must be strings.") + cleaned = value.strip() + if cleaned: + normalized.append(cleaned) + return normalized or None + + +def _catalogue_like_conditions(column_name: str, + values: Optional[List[str]]) -> Optional[str]: + """ + Build a LIKE clause joined by OR for catalogue filters. + """ + if not values: + return None + return " OR ".join(f"{column_name} LIKE '{value}'" for value in values) + + +def _build_catalogue_metadata_query(all_versions: bool, + collections: Optional[List[str]], + tables: Optional[List[str]]) -> str: + """ + Build the ADQL query for catalogue metadata. + """ + query = """ + SELECT + collection, title, version, table_name, filter, instrument, telescope, publication_date, + ref.description AS description, number_rows, number_columns, rel_descr_url, acknowledgment, + cat_id, mjd_obs, mjd_end, skysqdeg, bibliography, document_id, kc.from_column AS from_column, + k.target_table AS target_table, kc.target_column AS target_column, schema_name + FROM TAP_SCHEMA.tables AS ref + LEFT OUTER JOIN TAP_SCHEMA.keys AS k ON ref.table_name = k.from_table + LEFT OUTER JOIN TAP_SCHEMA.key_columns AS kc ON k.key_id = kc.key_id + WHERE schema_name = 'safcat' + """ + if not all_versions: + query += """ + AND cat_id IN ( + SELECT t1.cat_id + FROM TAP_SCHEMA.tables t1 + LEFT JOIN TAP_SCHEMA.tables t2 ON (t1.title = t2.title AND t1.version < t2.version) + WHERE t2.title IS NULL + ) + """ + collections_clause = _catalogue_like_conditions("collection", collections) + if collections_clause: + query += f" AND ({collections_clause})" + tables_clause = _catalogue_like_conditions("table_name", tables) + if tables_clause: + query += f" AND ({tables_clause})" + return query + + +def _build_catalogue_columns_query(collections: Optional[List[str]], + tables: Optional[List[str]]) -> str: + """ + Build the ADQL query for catalogue column metadata. + """ + collections = collections or ["%"] + tables = tables or ["%"] + collections_clause = _catalogue_like_conditions("collection", collections) + tables_clause = _catalogue_like_conditions("table_name", tables) + return f""" + SELECT table_name, column_name, ucd, datatype, description, unit + FROM TAP_SCHEMA.columns + WHERE table_name IN ( + SELECT table_name FROM TAP_SCHEMA.tables WHERE {collections_clause} + ) + AND ({tables_clause}) + """ + + +def _build_catalogue_table_query(table_name: str, + columns: Union[List[str], str, None], + conditions_dict: Optional[Dict[str, str]], + order_by: Optional[str], + order: str, + top: Optional[int]) -> str: + """ + Build the ADQL query to retrieve rows from a catalogue table. + """ + if columns is None: + column_list = [] + elif isinstance(columns, str): + column_list = _split_str_as_list_of_str(columns) + else: + if hasattr(columns, "tolist"): + columns = columns.tolist() + if not isinstance(columns, (list, tuple, set)): + raise TypeError("`columns` must be a string or list of strings.") + column_list = [] + for col in columns: + if not isinstance(col, str): + raise TypeError("All `columns` entries must be strings.") + column_list.append(col.strip()) + select_columns = ", ".join(column_list) if column_list else "*" + select_clause = f"SELECT {'TOP ' + str(top) + ' ' if top else ''}{select_columns}" + + conditions_clause = "" + if conditions_dict: + if not isinstance(conditions_dict, dict): + raise TypeError("`conditions_dict` must be a dictionary.") + conditions = [] + for key, value in conditions_dict.items(): + if value is None: + continue + conditions.append(f"{key} {_adql_sanitize_op_val(value)}") + if conditions: + conditions_clause = " WHERE " + " AND ".join(conditions) + + order_clause = "" + if order_by: + order_token = (order or "ascending").strip().lower() + if order_token in ("ascending", "asc", ""): + direction = "asc" + elif order_token in ("descending", "desc"): + direction = "desc" + else: + raise ValueError("`order` must be 'ascending' or 'descending'.") + order_clause = f" ORDER BY {order_by} {direction}" + + return f"{select_clause} FROM {table_name}{conditions_clause}{order_clause}" + + +def _set_last_version(table: Table, update: bool = True) -> None: + """ + Append or update a ``last_version`` column based on title/version metadata. + """ + required_cols = ("title", "version") + if any(col not in table.colnames for col in required_cols): + return + if "last_version" in table.colnames and not update: + return + if "last_version" in table.colnames: + table.remove_column("last_version") + + titles = table["title"] + versions = table["version"] + try: + versions_numeric = versions.astype(float) + use_numeric = True + except Exception: + versions_numeric = versions + use_numeric = False + + last_version_flags = np.zeros(len(table), dtype=bool) + for title in np.unique(titles): + mask = titles == title + version_values = versions_numeric[mask] + latest = np.nanmax(version_values) if use_numeric else max(version_values) + last_version_flags[mask] = (version_values == latest) + + table.add_column( + Column( + data=last_version_flags, + name="last_version", + dtype=bool, + description="True if this is the latest version of the catalogue", + ) + ) From c03ff9bfbb487abd9807e40caf5ba8129bb0f96a Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Thu, 15 Jan 2026 10:28:32 +0100 Subject: [PATCH 04/30] update catalogue tests --- astroquery/eso/tests/test_eso_catalogues.py | 129 ++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 astroquery/eso/tests/test_eso_catalogues.py diff --git a/astroquery/eso/tests/test_eso_catalogues.py b/astroquery/eso/tests/test_eso_catalogues.py new file mode 100644 index 0000000000..69add7c2d8 --- /dev/null +++ b/astroquery/eso/tests/test_eso_catalogues.py @@ -0,0 +1,129 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +=========================== +ESO Astroquery Catalogue tests +=========================== + +European Southern Observatory (ESO) + +""" +from astropy.table import Table + +from ...eso import Eso + +CATALOGUE_TABLE_NAME = "KiDS_DR4_1_ugriZYJHKs_cat_fits" + + +def _catalogue_metadata_table(): + return Table({ + "collection": ["KIDS"], + "title": ["KiDS DR4"], + "version": ["1.0"], + "table_name": [CATALOGUE_TABLE_NAME], + }) + + +def _catalogue_columns_table(): + return Table({ + "table_name": [CATALOGUE_TABLE_NAME, CATALOGUE_TABLE_NAME, CATALOGUE_TABLE_NAME], + "column_name": ["ra", "dec", "source_id"], + "ucd": ["pos.eq.ra;meta.main", "pos.eq.dec;meta.main", "meta.id;meta.main"], + "datatype": ["double", "double", "char"], + "description": ["", "", ""], + "unit": ["deg", "deg", ""], + }) + + +def monkey_catalogue_tap(query, **kwargs): + _ = kwargs + if "FROM TAP_SCHEMA.tables AS ref" in query: + return _catalogue_metadata_table() + if "FROM TAP_SCHEMA.columns" in query: + return _catalogue_columns_table() + raise AssertionError(f"Unexpected catalogue query: {query}") + + +def test_list_catalogues_returns_table(monkeypatch): + # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html + eso = Eso() + monkeypatch.setattr(eso, "_run_catalogue_tap_query", monkey_catalogue_tap) + result = eso.list_catalogues() + + assert isinstance(result, Table) + assert len(result) > 0 + assert "table_name" in result.colnames + assert "table_RA" in result.colnames + assert result["table_name"][0] == CATALOGUE_TABLE_NAME + + +def test_list_catalogues_info_returns_table(monkeypatch): + # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html + eso = Eso() + monkeypatch.setattr(eso, "_run_catalogue_tap_query", monkey_catalogue_tap) + result = eso.list_catalogues_info(collections="KIDS") + + assert isinstance(result, Table) + assert len(result) > 0 + assert {"table_name", "column_name", "ucd", "datatype", "description", "unit"}.issubset( + result.colnames + ) + + +def test_query_catalogues_builds_expected_adql_with_columns_and_filters(monkeypatch): + # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html + eso = Eso() + captured = {} + + def mock_list_catalogues(*args, **kwargs): + _ = args, kwargs + return Table({ + "table_name": [CATALOGUE_TABLE_NAME], + "number_rows": [10], + }) + + def mock_list_catalogues_info(*args, **kwargs): + _ = args, kwargs + return Table({ + "table_name": [CATALOGUE_TABLE_NAME, CATALOGUE_TABLE_NAME], + "column_name": ["colA", "colB"], + "ucd": ["", ""], + }) + + def mock_run_catalogue_query(query, maxrec=None, type_of_query="sync", authenticated=False): + captured["query"] = query + captured["maxrec"] = maxrec + captured["type_of_query"] = type_of_query + captured["authenticated"] = authenticated + return Table({"colA": [1], "colB": [2]}) + + monkeypatch.setattr(eso, "list_catalogues", mock_list_catalogues) + monkeypatch.setattr(eso, "list_catalogues_info", mock_list_catalogues_info) + monkeypatch.setattr(eso, "_run_catalogue_tap_query", mock_run_catalogue_query) + + result = eso.query_catalogues( + tables=CATALOGUE_TABLE_NAME, + columns=["colA", "colB"], + conditions_dict={"colC": "> 0", "colD": "foo"}, + maxrec=5, + ) + + assert isinstance(result, Table) + assert f"FROM {CATALOGUE_TABLE_NAME}" in captured["query"] + assert "SELECT colA, colB" in captured["query"] + assert "colC > 0" in captured["query"] + assert "colD = 'foo'" in captured["query"] + assert captured["maxrec"] == 5 + + +def test_query_catalogues_unknown_collection_returns_none(monkeypatch): + # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html + eso = Eso() + + def mock_list_catalogues(*args, **kwargs): + _ = args, kwargs + return Table() + + monkeypatch.setattr(eso, "list_catalogues", mock_list_catalogues) + result = eso.query_catalogues(collections="NO_SUCH_COLLECTION") + + assert result is None From 3180cdb1862346eb3703971a92eb3f4b6d3efd7d Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Thu, 15 Jan 2026 15:48:25 +0100 Subject: [PATCH 05/30] remove async from query_catalogues --- astroquery/eso/core.py | 55 +-- astroquery/eso/testing/test_catalogues.ipynb | 435 +++++++++++++------ astroquery/eso/tests/test_eso_catalogues.py | 3 +- astroquery/eso/utils.py | 2 +- 4 files changed, 331 insertions(+), 164 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index a8714c106e..915c944ee1 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -1058,19 +1058,18 @@ def _tap_catalogues(self, authenticated: bool = False) -> TAPService: """ Return a TAPService connected to the catalogue TAP endpoint. """ - 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 {conf.tap_cat_url}") if authenticated: h = self._get_auth_header() + if not h: + raise LoginError( + "It seems you are trying to issue an authenticated query to the catalogue TAP " + f"service ({conf.tap_cat_url}) 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=" + ) self._session.headers = {**self._session.headers, **h} return TAPService(conf.tap_cat_url, session=self._session) return TAPService(conf.tap_cat_url) @@ -1078,7 +1077,6 @@ def _tap_catalogues(self, authenticated: bool = False) -> TAPService: def _run_catalogue_tap_query(self, query: str, *, maxrec: Optional[int] = None, - type_of_query: str = "sync", authenticated: bool = False) -> Table: """ Execute a TAP query against the catalogue service. @@ -1090,8 +1088,6 @@ def _run_catalogue_tap_query(self, maxrec : int, optional The maximum number of records to retrieve. If not provided, the current ROW_LIMIT value is used. - type_of_query : str, optional - The TAP query mode, either 'sync' or 'async'. Default is 'sync'. authenticated : bool, optional If ``True``, performs the query with an authenticated session. @@ -1100,10 +1096,6 @@ def _run_catalogue_tap_query(self, astropy.table.Table Table with the query results. """ - type_of_query = type_of_query.lower() - if type_of_query not in ("sync", "async"): - raise ValueError("`type_of_query` must be 'sync' or 'async'.") - row_limit = maxrec if maxrec is not None else self.ROW_LIMIT if row_limit is None or row_limit < 1: row_limit = sys.maxsize @@ -1120,16 +1112,9 @@ def message(query_str): tmp_limit = self.ROW_LIMIT try: self.ROW_LIMIT = row_limit - if type_of_query == "sync": - table_with_extra = tap_service.search( - query=query, maxrec=row_limit_plus_one - ).to_table() - else: - tap_job = tap_service.submit_job(query=query, maxrec=row_limit_plus_one) - tap_job.run() - tap_job.wait(phases=["EXECUTING", "COMPLETED", "ERROR", "ABORTED"], timeout=10.0) - tap_job.raise_if_error() - table_with_extra = tap_job.fetch_result().to_table() + table_with_extra = tap_service.search( + query=query, maxrec=row_limit_plus_one + ).to_table() self._maybe_warn_about_table_length(table_with_extra, row_limit_plus_one) except DALQueryError: log.error(message(query)) @@ -1178,7 +1163,7 @@ def list_catalogues(self, all_versions: bool = False, query = _build_catalogue_metadata_query(all_versions, clean_collections, clean_tables) if verbose: log.info("Query:\n%s", query) - table = self._run_catalogue_tap_query(query, maxrec=self.ROW_LIMIT, type_of_query="sync") + table = self._run_catalogue_tap_query(query, maxrec=self.ROW_LIMIT) if len(table) == 0: return table @@ -1202,11 +1187,11 @@ def list_catalogues(self, all_versions: bool = False, ucd = row["ucd"] if table_name not in lookup: continue - if ucd == "meta.id;meta.main": + if ucd.strip() == "meta.id;meta.main": lookup[table_name]["id"].append(row["column_name"]) - elif ucd == "pos.eq.ra;meta.main": + elif ucd.strip() == "pos.eq.ra;meta.main": lookup[table_name]["ra"].append(row["column_name"]) - elif ucd == "pos.eq.dec;meta.main": + elif ucd.strip() == "pos.eq.dec;meta.main": lookup[table_name]["dec"].append(row["column_name"]) for idx, table_name in enumerate(table["table_name"]): entry = lookup.get(table_name, {}) @@ -1276,13 +1261,12 @@ def list_catalogues_info(self, query = _build_catalogue_columns_query(clean_collections, clean_tables) if verbose: log.info("Query:\n%s", query) - return self._run_catalogue_tap_query(query, maxrec=self.ROW_LIMIT, type_of_query="sync") + return self._run_catalogue_tap_query(query, maxrec=self.ROW_LIMIT) def query_catalogues(self, collections: Union[List[str], str] = None, tables: Union[List[str], str] = None, columns: Union[List[str], str] = None, - type_of_query: str = "sync", all_versions: bool = False, maxrec: Optional[int] = None, verbose: bool = False, @@ -1301,8 +1285,6 @@ def query_catalogues(self, Catalogue table name(s) to query. columns : str or list of str, optional Column name(s) to retrieve. If not provided, selects all columns. - type_of_query : str, optional - The TAP query mode, either 'sync' or 'async'. Default is 'sync'. all_versions : bool, optional If ``True``, includes obsolete catalogue versions when expanding collections. Default is ``False``. @@ -1331,7 +1313,7 @@ def query_catalogues(self, TypeError If ``columns`` or ``conditions_dict`` types are invalid. ValueError - If ``type_of_query`` or ``order`` are invalid. + If ``order`` is invalid. DALFormatError If the TAP response is malformed. """ @@ -1420,7 +1402,6 @@ def query_catalogues(self, result_table = self._run_catalogue_tap_query( query, maxrec=effective_maxrec, - type_of_query=type_of_query, ) results.append(result_table) diff --git a/astroquery/eso/testing/test_catalogues.ipynb b/astroquery/eso/testing/test_catalogues.ipynb index c465f9308e..0d2d982b91 100644 --- a/astroquery/eso/testing/test_catalogues.ipynb +++ b/astroquery/eso/testing/test_catalogues.ipynb @@ -2,118 +2,181 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import astroquery\n", + "print(astroquery.__version__) # Print the version of astroquery\n", + "print(astroquery.__file__) # Print the file path of astroquery\n", + "from astroquery.eso import Eso # Import the ESO module\n", + "\n", + "eso = Eso()" + ] + }, + { + "cell_type": "code", + "execution_count": 17, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.4.12.dev10525\n", - "/opt/anaconda3/envs/astroquery_testing/lib/python3.9/site-packages/astroquery/__init__.py\n" - ] - }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING: MaxResultsWarning: Results truncated to 1000. To retrieve all the records set to None the ROW_LIMIT attribute [astroquery.eso.core]\n" ] + }, + { + "data": { + "text/html": [ + "
Table length=129\n", + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
table_IDtable_RAtable_Deccollectioninstrumenttable_nametitleversionnumber_rows
str10str11str11objectobjectobjectobjectint32int64
NoneNoneNone1101.A-0127MUSEAMUSED_MAIN_SOURCE_CAT_V1AMUSED: the MUSE Hubble Ultra-Deep Field surveys12221
NoneNoneNone195.B-0283HAWKIGNS_catalogue_V1GALACTICNUCLEUS Survey13277646
SPEC_IDNoneNone196.D-0214FORS2EREBOS_RV_cat_fits_V1EREBOS_RV_cat.fits1359
SOURCE_IDRA_2000DE_2000196.D-0214FORS2EREBOS_cat_fits_V1EREBOS_cat.fits19
NoneNoneNoneAMBREHARPSAMBRE_HARPS_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - HARPS1126688
NoneNoneNoneAMBREUVESAMBRE_UVES_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - UVES151897
DP_IDRAJ2000DEJ2000AMBREFEROSAMBRE_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra118618
ATLAS_NAMERADEATLASGALAPEXBOLATLASGAL_V1ATLASGAL - APEX Large Area Survey of the Galaxy110861
NoneNoneNoneFDSOMEGACAMFDS_SourceCatalogue_V1Fornax Deep Survey Source Catalogue13112605
NoneNoneNoneGAIAESOMULTIGES_2021_VRADGAIAESO catalogue of radial velocities1110762
...........................
NoneNoneNoneVVVVIRCAMVVV_bandMergedSourceCat_V3VVV: ZYJHKs Catalogue in the Via Lactea3590682953
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_OBSVIRAC2 observation details1197423
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_SOURCESVIRAC2 source catalogue - Rejected Sources1844909545
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_SOURCESVIRAC2 source catalogue1545346533
NoneNoneNoneXQ-100XSHOOTERXQ_100_summary_fits_V1Quasars and their absorption lines: a legacy survey of the high-redshift universe (XQ-100)1100
NoneNoneNoneZCOSMOSVIMOSZCOSMOS_V2zCOSMOS Spectroscopic Redshift Survey220689
" + ], + "text/plain": [ + "\n", + " table_ID table_RA table_Dec ... version number_rows\n", + " str10 str11 str11 ... int32 int64 \n", + "---------- -------- --------- ... ------- -----------\n", + " None None None ... 1 2221\n", + " None None None ... 1 3277646\n", + " SPEC_ID None None ... 1 359\n", + " SOURCE_ID RA_2000 DE_2000 ... 1 9\n", + " None None None ... 1 126688\n", + " None None None ... 1 51897\n", + " DP_ID RAJ2000 DEJ2000 ... 1 18618\n", + "ATLAS_NAME RA DE ... 1 10861\n", + " None None None ... 1 3112605\n", + " None None None ... 1 110762\n", + " ... ... ... ... ... ...\n", + " None None None ... 3 590682953\n", + " None None None ... 1 95768366366\n", + " None None None ... 1 95768366366\n", + " None None None ... 1 197423\n", + " None None None ... 1 27419652812\n", + " None None None ... 1 27419652812\n", + " None None None ... 1 844909545\n", + " None None None ... 1 545346533\n", + " None None None ... 1 100\n", + " None None None ... 2 20689" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ - "import astroquery\n", - "print(astroquery.__version__) # Print the version of astroquery\n", - "print(astroquery.__file__) # Print the file path of astroquery\n", - "from astroquery.eso import Eso # Import the ESO module\n", - "\n", - "eso = Eso()\n", - "all_catalogues = eso.list_catalogues(all_versions=False) " + "all_catalogues = eso.list_catalogues(all_versions=True) # Get all the available catalogues (only most recent version)\n", + "all_catalogues['table_ID', 'table_RA', 'table_Dec', 'collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Table length=86\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "
collectioninstrumenttable_nametitleversionnumber_rows
objectobjectobjectobjectint32int64
1101.A-0127MUSEAMUSED_MAIN_SOURCE_CAT_V1AMUSED: the MUSE Hubble Ultra-Deep Field surveys12221
195.B-0283HAWKIGNS_catalogue_V1GALACTICNUCLEUS Survey13277646
196.D-0214FORS2EREBOS_RV_cat_fits_V1EREBOS_RV_cat.fits1359
196.D-0214FORS2EREBOS_cat_fits_V1EREBOS_cat.fits19
AMBREHARPSAMBRE_HARPS_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - HARPS1126688
AMBREUVESAMBRE_UVES_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - UVES151897
AMBREFEROSAMBRE_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra118618
ATLASGALAPEXBOLATLASGAL_V1ATLASGAL - APEX Large Area Survey of the Galaxy110861
FDSOMEGACAMFDS_SourceCatalogue_V1Fornax Deep Survey Source Catalogue13112605
GAIAESOMULTIGES_2021_VRADGAIAESO catalogue of radial velocities1110762
..................
VVVVIRCAMVVV_bandMergedSourceCat_V3VVV: ZYJHKs Catalogue in the Via Lactea3590682953
VVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
VVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
VVVXVIRCAMVVVX_VIRAC_V2_OBSVIRAC2 observation details1197423
VVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
VVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
VVVXVIRCAMVVVX_VIRAC_V2_REJECTED_SOURCESVIRAC2 source catalogue - Rejected Sources1844909545
VVVXVIRCAMVVVX_VIRAC_V2_SOURCESVIRAC2 source catalogue1545346533
XQ-100XSHOOTERXQ_100_summary_fits_V1Quasars and their absorption lines: a legacy survey of the high-redshift universe (XQ-100)1100
ZCOSMOSVIMOSZCOSMOS_V2zCOSMOS Spectroscopic Redshift Survey220689
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "
table_IDtable_RAtable_Deccollectioninstrumenttable_nametitleversionnumber_rows
str10str11str11objectobjectobjectobjectint32int64
NoneNoneNone1101.A-0127MUSEAMUSED_MAIN_SOURCE_CAT_V1AMUSED: the MUSE Hubble Ultra-Deep Field surveys12221
NoneNoneNone195.B-0283HAWKIGNS_catalogue_V1GALACTICNUCLEUS Survey13277646
SPEC_IDNoneNone196.D-0214FORS2EREBOS_RV_cat_fits_V1EREBOS_RV_cat.fits1359
SOURCE_IDRA_2000DE_2000196.D-0214FORS2EREBOS_cat_fits_V1EREBOS_cat.fits19
NoneNoneNoneAMBREHARPSAMBRE_HARPS_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - HARPS1126688
NoneNoneNoneAMBREUVESAMBRE_UVES_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - UVES151897
DP_IDRAJ2000DEJ2000AMBREFEROSAMBRE_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra118618
ATLAS_NAMERADEATLASGALAPEXBOLATLASGAL_V1ATLASGAL - APEX Large Area Survey of the Galaxy110861
NoneNoneNoneFDSOMEGACAMFDS_SourceCatalogue_V1Fornax Deep Survey Source Catalogue13112605
NoneNoneNoneGAIAESOMULTIGES_2021_VRADGAIAESO catalogue of radial velocities1110762
...........................
NoneNoneNoneVVVVIRCAMVVV_bandMergedSourceCat_V3VVV: ZYJHKs Catalogue in the Via Lactea3590682953
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_OBSVIRAC2 observation details1197423
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_SOURCESVIRAC2 source catalogue - Rejected Sources1844909545
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_SOURCESVIRAC2 source catalogue1545346533
NoneNoneNoneXQ-100XSHOOTERXQ_100_summary_fits_V1Quasars and their absorption lines: a legacy survey of the high-redshift universe (XQ-100)1100
NoneNoneNoneZCOSMOSVIMOSZCOSMOS_V2zCOSMOS Spectroscopic Redshift Survey220689
" ], "text/plain": [ "\n", - " collection instrument table_name ... version number_rows\n", - " object object object ... int32 int64 \n", - "----------- ---------- ------------------------------ ... ------- -----------\n", - "1101.A-0127 MUSE AMUSED_MAIN_SOURCE_CAT_V1 ... 1 2221\n", - " 195.B-0283 HAWKI GNS_catalogue_V1 ... 1 3277646\n", - " 196.D-0214 FORS2 EREBOS_RV_cat_fits_V1 ... 1 359\n", - " 196.D-0214 FORS2 EREBOS_cat_fits_V1 ... 1 9\n", - " AMBRE HARPS AMBRE_HARPS_V1 ... 1 126688\n", - " AMBRE UVES AMBRE_UVES_V1 ... 1 51897\n", - " AMBRE FEROS AMBRE_V1 ... 1 18618\n", - " ATLASGAL APEXBOL ATLASGAL_V1 ... 1 10861\n", - " FDS OMEGACAM FDS_SourceCatalogue_V1 ... 1 3112605\n", - " GAIAESO MULTI GES_2021_VRAD ... 1 110762\n", - " ... ... ... ... ... ...\n", - " VVV VIRCAM VVV_bandMergedSourceCat_V3 ... 3 590682953\n", - " VVVX VIRCAM VVVX_VIRAC_V2_LC ... 1 95768366366\n", - " VVVX VIRCAM VVVX_VIRAC_V2_LC ... 1 95768366366\n", - " VVVX VIRCAM VVVX_VIRAC_V2_OBS ... 1 197423\n", - " VVVX VIRCAM VVVX_VIRAC_V2_REJECTED_LC ... 1 27419652812\n", - " VVVX VIRCAM VVVX_VIRAC_V2_REJECTED_LC ... 1 27419652812\n", - " VVVX VIRCAM VVVX_VIRAC_V2_REJECTED_SOURCES ... 1 844909545\n", - " VVVX VIRCAM VVVX_VIRAC_V2_SOURCES ... 1 545346533\n", - " XQ-100 XSHOOTER XQ_100_summary_fits_V1 ... 1 100\n", - " ZCOSMOS VIMOS ZCOSMOS_V2 ... 2 20689" + " table_ID table_RA table_Dec ... version number_rows\n", + " str10 str11 str11 ... int32 int64 \n", + "---------- -------- --------- ... ------- -----------\n", + " None None None ... 1 2221\n", + " None None None ... 1 3277646\n", + " SPEC_ID None None ... 1 359\n", + " SOURCE_ID RA_2000 DE_2000 ... 1 9\n", + " None None None ... 1 126688\n", + " None None None ... 1 51897\n", + " DP_ID RAJ2000 DEJ2000 ... 1 18618\n", + "ATLAS_NAME RA DE ... 1 10861\n", + " None None None ... 1 3112605\n", + " None None None ... 1 110762\n", + " ... ... ... ... ... ...\n", + " None None None ... 3 590682953\n", + " None None None ... 1 95768366366\n", + " None None None ... 1 95768366366\n", + " None None None ... 1 197423\n", + " None None None ... 1 27419652812\n", + " None None None ... 1 27419652812\n", + " None None None ... 1 844909545\n", + " None None None ... 1 545346533\n", + " None None None ... 1 100\n", + " None None None ... 2 20689" ] }, - "execution_count": 2, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_catalogues = eso.list_catalogues(all_versions=False) # Get all the available catalogues (only most recent version)\n", - "all_catalogues['collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" + "all_catalogues['table_ID', 'table_RA', 'table_Dec', 'collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Table length=4\n", - "
\n", + "
\n", "\n", "\n", "\n", @@ -133,7 +196,7 @@ " KIDS MULTI ... 5 138812117" ] }, - "execution_count": 3, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -145,14 +208,46 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Table length=1\n", + "
collectioninstrumenttable_nametitleversionnumber_rows
objectobjectobjectobjectint32int64
KIDSOMEGACAMKiDS_DR3_0_ugri_src_fits_V2The Kilo-Degree Survey248736590
\n", + "\n", + "\n", + "\n", + "
collectiontitleversiontable_namefilterinstrumenttelescopepublication_datedescriptionnumber_rowsnumber_columnsrel_descr_urlacknowledgmentcat_idmjd_obsmjd_endskysqdegbibliographydocument_idfrom_columntarget_tabletarget_columnschema_namelast_versiontable_RAtable_Dectable_ID
objectobjectint32objectobjectobjectobjectobjectobjectint64int16objectobjectint32float64float64float64objectint32objectobjectobjectobjectboolstr7str8str2
KIDSThe Kilo-Degree Survey 10-band ugri1i2ZYJHKs source catalogue5KiDS_DR5_0_ugriZYJHKs_cat_fitsu_SDSS g_SDSS r_SDSS i_SDSS Z Y J H KsMULTIMULTI2025-03-18T12:33:10ZThe 10-band ugriZYJHKs DR5 source catalogue is based on the KiDS imaging products, incorporating the overlapping VIKING survey. The i-band includes multi-epoch observations (i1i2), covering the full survey footprint. The catalogue offers PSF-homogenised and aperture-matched photometry, along with derived photometric redshifts and stellar mass estimates.138812117365http://www.eso.org/rm/api/v1/public/releaseDescriptions/229Please include the following acknowledgment in any published material that makes use of this data product: Based on data obtained from the ESO Science Archive Facility with DOI: https://doi.org/10.18727/archive/3743355782.34258691.0481331.02024A&A...686A.170W229safcatTrueRAJ2000DECJ2000ID
" + ], + "text/plain": [ + "\n", + "collection ... table_ID\n", + " object ... str2 \n", + "---------- ... --------\n", + " KIDS ... ID" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eso.list_catalogues(tables=\"KiDS_DR5_0_ugriZYJHKs_cat_fits\")" + ] + }, + { + "cell_type": "code", + "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Table length=5\n", - "
\n", + "
\n", "\n", "\n", "\n", @@ -174,7 +269,7 @@ " KIDS MULTI ... 5 138812117" ] }, - "execution_count": 4, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -186,14 +281,21 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 27, "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING: MaxResultsWarning: Results truncated to 1000. To retrieve all the records set to None the ROW_LIMIT attribute [astroquery.eso.core]\n" + ] + }, { "data": { "text/html": [ - "
Table length=10\n", - "
collectioninstrumenttable_nametitleversionnumber_rows
objectobjectobjectobjectint32int64
KIDSOMEGACAMKiDS_DR3_0_ugri_src_fits_V2The Kilo-Degree Survey248736590
\n", + "
Table length=1000\n", + "
\n", "\n", "\n", "\n", @@ -206,38 +308,60 @@ "\n", "\n", "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "
table_namecolumn_nameucddatatypedescriptionunit
objectobjectobjectobjectobjectobject
KiDS_DR3_0_ugri_src_fits_V2IDmeta.id;meta.mainCHARSource identifier
KiDS_DR3_0_ugri_src_fits_V2Aphys.angSize.smajAxisDOUBLELinear semi major axispixel
KiDS_DR3_0_ugri_src_fits_V2Bphys.angSize.sminAxisDOUBLELinear semi minor axispixel
KiDS_DR3_0_ugri_src_fits_V2CLASS_STARsrc.class.starGalaxyREALSExtractor star/galaxy classifier
..................
KiDS_DR4_1_ugriZYJHKs_cat_fitsFLUXERR_ISOstat.error;phot.flux;em.opt.RREALError on FLUX_ISO (counts)count
KiDS_DR4_1_ugriZYJHKs_cat_fitsMAG_ISOCORphot.mag;em.opt.RREALr-band Corrected Isophotal Magnitude (mag)mag
KiDS_DR4_1_ugriZYJHKs_cat_fitsMAGERR_ISOCORstat.error;phot.mag;em.opt.RREALError on MAG_ISOCOR (mag)mag
KiDS_DR4_1_ugriZYJHKs_cat_fitsFLUX_ISOCORphot.flux;em.opt.RREALr-band Corrected Isophotal Flux (counts)count
KiDS_DR4_1_ugriZYJHKs_cat_fitsFLUXERR_ISOCORstat.error;phot.flux;em.opt.RREALError on FLUX_ISOCOR (counts)count
KiDS_DR4_1_ugriZYJHKs_cat_fitsNIMAFLAGS_ISOmeta.codeSMALLINTNumber of flagged pixels over the isophotal profile
KiDS_DR4_1_ugriZYJHKs_cat_fitsIMAFLAGS_ISOmeta.codeSMALLINTFLAG-image flags ORed over the isophotal profile
KiDS_DR4_1_ugriZYJHKs_cat_fitsXMIN_IMAGEpos.cartesian.xSMALLINTMinimum x-coordinate among detected pixels (pixel)pixel
KiDS_DR4_1_ugriZYJHKs_cat_fitsYMIN_IMAGEpos.cartesian.ySMALLINTMinimum y-coordinate among detected pixels (pixel)pixel
KiDS_DR4_1_ugriZYJHKs_cat_fitsXMAX_IMAGEpos.cartesian.xSMALLINTMaximum x-coordinate among detected pixels (pixel)pixel
" ], "text/plain": [ - "\n", - " table_name column_name ... unit \n", - " object object ... object\n", - "--------------------------- ----------- ... ------\n", - "KiDS_DR3_0_ugri_src_fits_V2 ID ... \n", - "KiDS_DR3_0_ugri_src_fits_V2 SCID ... \n", - "KiDS_DR3_0_ugri_src_fits_V2 SLID ... \n", - "KiDS_DR3_0_ugri_src_fits_V2 SID ... \n", - "KiDS_DR3_0_ugri_src_fits_V2 RAJ2000 ... deg\n", - "KiDS_DR3_0_ugri_src_fits_V2 DECJ2000 ... deg\n", - "KiDS_DR3_0_ugri_src_fits_V2 SG2DPHOT ... \n", - "KiDS_DR3_0_ugri_src_fits_V2 A ... pixel\n", - "KiDS_DR3_0_ugri_src_fits_V2 B ... pixel\n", - "KiDS_DR3_0_ugri_src_fits_V2 CLASS_STAR ... " + "
\n", + " table_name column_name ... unit \n", + " object object ... object\n", + "------------------------------ -------------- ... ------\n", + " KiDS_DR3_0_ugri_src_fits_V2 ID ... \n", + " KiDS_DR3_0_ugri_src_fits_V2 SCID ... \n", + " KiDS_DR3_0_ugri_src_fits_V2 SLID ... \n", + " KiDS_DR3_0_ugri_src_fits_V2 SID ... \n", + " KiDS_DR3_0_ugri_src_fits_V2 RAJ2000 ... deg\n", + " KiDS_DR3_0_ugri_src_fits_V2 DECJ2000 ... deg\n", + " KiDS_DR3_0_ugri_src_fits_V2 SG2DPHOT ... \n", + " KiDS_DR3_0_ugri_src_fits_V2 A ... pixel\n", + " KiDS_DR3_0_ugri_src_fits_V2 B ... pixel\n", + " KiDS_DR3_0_ugri_src_fits_V2 CLASS_STAR ... \n", + " ... ... ... ...\n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits FLUXERR_ISO ... count\n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits MAG_ISOCOR ... mag\n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits MAGERR_ISOCOR ... mag\n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits FLUX_ISOCOR ... count\n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits FLUXERR_ISOCOR ... count\n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits NIMAFLAGS_ISO ... \n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits IMAFLAGS_ISO ... \n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits XMIN_IMAGE ... pixel\n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits YMIN_IMAGE ... pixel\n", + "KiDS_DR4_1_ugriZYJHKs_cat_fits XMAX_IMAGE ... pixel" ] }, - "execution_count": 5, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "kids_columns = eso.list_catalogues_info(collections='KIDS') \n", - "kids_columns[:10]" + "kids_columns" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -257,53 +381,107 @@ ], "source": [ "table_name = 'KiDS_DR4_1_ugriZYJHKs_cat_fits' \n", - "kids_catalogue = eso.query_catalogues(tables=table_name, maxrec=10) # Get the KIDS catalogues" + "kids_catalogue = eso.query_catalogues(tables=table_name, maxrec=10, columns=[\"ID\"]) # Get the KIDS catalogues" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "INFO: The query to %s returned %d entries out of %d (with a limit set to maxrec=%s) [astroquery.eso.core]\n", + "INFO: The query to %s returned %d entries out of %d (with a limit set to maxrec=%s) [astroquery.eso.core]\n" + ] + }, + { + "data": { + "text/plain": [ + "[
\n", + " ID \n", + " object \n", + " -----------------------------\n", + " KiDSDR4 J002018.968-284111.45\n", + " KiDSDR4 J002030.676-284111.97\n", + " KiDSDR4 J002041.061-284112.29\n", + " KiDSDR4 J002338.940-283853.98\n", + " KiDSDR4 J002449.644-284110.99\n", + " KiDSDR4 J002438.745-284110.74\n", + " KiDSDR4 J002353.165-284112.55\n", + " KiDSDR4 J002035.763-284110.75\n", + " KiDSDR4 J002353.979-284112.34\n", + " KiDSDR4 J002024.261-284109.95,\n", + "
\n", + " ID \n", + " object \n", + " -------------------------\n", + " KIDS J085512.03+011900.03\n", + " KIDS J085527.99+011900.13\n", + " KIDS J085448.72+011923.56\n", + " KIDS J085608.94+011900.14\n", + " KIDS J085611.25+011900.23\n", + " KIDS J085441.91+011900.17\n", + " KIDS J085644.13+011900.22\n", + " KIDS J085530.94+011900.47\n", + " KIDS J085511.45+011900.40\n", + " KIDS J085637.87+011901.95]" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "kids_catalogue = eso.query_catalogues(tables=['KiDS_DR4_1_ugriZYJHKs_cat_fits', 'KiDS_DR3_0_ugri_src_fits_V2'], maxrec=10, columns=[\"ID\"]) # Get the KIDS catalogues\n", + "kids_catalogue" + ] + }, + { + "cell_type": "code", + "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Table length=10\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "
LevelALPHA_J2000A_IMAGEA_WORLDAgaperAgaper_0p7Agaper_1p0BPZ_FILTBPZ_FLAGFILTBPZ_NONDETFILTB_IMAGEB_WORLDBackGrBgaperBgaper_0p7Bgaper_1p0CHI_SQUARED_BPZCLASS_STARCOLOUR_GAAP_H_KsCOLOUR_GAAP_J_HCOLOUR_GAAP_Y_JCOLOUR_GAAP_Z_YCOLOUR_GAAP_g_rCOLOUR_GAAP_i_ZCOLOUR_GAAP_r_iCOLOUR_GAAP_u_gCXX_WORLDCXY_WORLDCYY_WORLDDECJ2000DELTA_J2000ERRA_IMAGEERRA_WORLDERRB_IMAGEERRB_WORLDERRCXX_WORLDERRCXY_WORLDERRCYY_WORLDERRTHETA_J2000ERRTHETA_WORLDERRX2_WORLDERRXY_WORLDERRY2_WORLDEXTINCTION_HEXTINCTION_JEXTINCTION_KsEXTINCTION_YEXTINCTION_ZEXTINCTION_gEXTINCTION_iEXTINCTION_rEXTINCTION_uFIELD_POSFLAG_GAAP_0p7_HFLAG_GAAP_0p7_JFLAG_GAAP_0p7_KsFLAG_GAAP_0p7_YFLAG_GAAP_0p7_ZFLAG_GAAP_0p7_gFLAG_GAAP_0p7_iFLAG_GAAP_0p7_rFLAG_GAAP_0p7_uFLAG_GAAP_1p0_HFLAG_GAAP_1p0_JFLAG_GAAP_1p0_KsFLAG_GAAP_1p0_YFLAG_GAAP_1p0_ZFLAG_GAAP_1p0_gFLAG_GAAP_1p0_iFLAG_GAAP_1p0_rFLAG_GAAP_1p0_uFLAG_GAAP_HFLAG_GAAP_JFLAG_GAAP_KsFLAG_GAAP_YFLAG_GAAP_ZFLAG_GAAP_gFLAG_GAAP_iFLAG_GAAP_rFLAG_GAAP_uFLUXERR_APER_10FLUXERR_APER_100FLUXERR_APER_14FLUXERR_APER_20FLUXERR_APER_30FLUXERR_APER_4FLUXERR_APER_40FLUXERR_APER_6FLUXERR_APER_60FLUXERR_APER_8FLUXERR_AUTOFLUXERR_GAAP_0p7_HFLUXERR_GAAP_0p7_JFLUXERR_GAAP_0p7_KsFLUXERR_GAAP_0p7_YFLUXERR_GAAP_0p7_ZFLUXERR_GAAP_0p7_gFLUXERR_GAAP_0p7_iFLUXERR_GAAP_0p7_rFLUXERR_GAAP_0p7_uFLUXERR_GAAP_1p0_HFLUXERR_GAAP_1p0_JFLUXERR_GAAP_1p0_KsFLUXERR_GAAP_1p0_YFLUXERR_GAAP_1p0_ZFLUXERR_GAAP_1p0_gFLUXERR_GAAP_1p0_iFLUXERR_GAAP_1p0_rFLUXERR_GAAP_1p0_uFLUXERR_GAAP_HFLUXERR_GAAP_JFLUXERR_GAAP_KsFLUXERR_GAAP_YFLUXERR_GAAP_ZFLUXERR_GAAP_gFLUXERR_GAAP_iFLUXERR_GAAP_rFLUXERR_GAAP_uFLUXERR_ISOFLUXERR_ISOCORFLUX_APER_10FLUX_APER_100FLUX_APER_14FLUX_APER_20FLUX_APER_30FLUX_APER_4FLUX_APER_40FLUX_APER_6FLUX_APER_60FLUX_APER_8FLUX_AUTOFLUX_GAAP_0p7_HFLUX_GAAP_0p7_JFLUX_GAAP_0p7_KsFLUX_GAAP_0p7_YFLUX_GAAP_0p7_ZFLUX_GAAP_0p7_gFLUX_GAAP_0p7_iFLUX_GAAP_0p7_rFLUX_GAAP_0p7_uFLUX_GAAP_1p0_HFLUX_GAAP_1p0_JFLUX_GAAP_1p0_KsFLUX_GAAP_1p0_YFLUX_GAAP_1p0_ZFLUX_GAAP_1p0_gFLUX_GAAP_1p0_iFLUX_GAAP_1p0_rFLUX_GAAP_1p0_uFLUX_GAAP_HFLUX_GAAP_JFLUX_GAAP_KsFLUX_GAAP_YFLUX_GAAP_ZFLUX_GAAP_gFLUX_GAAP_iFLUX_GAAP_rFLUX_GAAP_uFLUX_ISOFLUX_ISOCORFLUX_RADIUSFWHM_IMAGEFWHM_WORLDFlagHTMIDIMAFLAGS_ISOISO0ISO1ISO2ISO3ISO4ISO5ISO6ISO7ISOAREA_WORLDKIDS_TILEKRON_RADIUSMAGERR_APER_10MAGERR_APER_100MAGERR_APER_14MAGERR_APER_20MAGERR_APER_4MAGERR_APER_40MAGERR_APER_6MAGERR_APER_60MAGERR_APER_8MAGERR_AUTOMAGERR_GAAP_0p7_HMAGERR_GAAP_0p7_JMAGERR_GAAP_0p7_KsMAGERR_GAAP_0p7_YMAGERR_GAAP_0p7_ZMAGERR_GAAP_0p7_gMAGERR_GAAP_0p7_iMAGERR_GAAP_0p7_rMAGERR_GAAP_0p7_uMAGERR_GAAP_1p0_HMAGERR_GAAP_1p0_JMAGERR_GAAP_1p0_KsMAGERR_GAAP_1p0_YMAGERR_GAAP_1p0_ZMAGERR_GAAP_1p0_gMAGERR_GAAP_1p0_iMAGERR_GAAP_1p0_rMAGERR_GAAP_1p0_uMAGERR_GAAP_HMAGERR_GAAP_JMAGERR_GAAP_KsMAGERR_GAAP_YMAGERR_GAAP_ZMAGERR_GAAP_gMAGERR_GAAP_iMAGERR_GAAP_rMAGERR_GAAP_uMAGERR_ISOMAGERR_ISOCORMAGGERR_APER_30MAG_APER_10MAG_APER_100MAG_APER_14MAG_APER_20MAG_APER_30MAG_APER_4MAG_APER_40MAG_APER_6MAG_APER_60MAG_APER_8MAG_AUTOMAG_GAAP_0p7_HMAG_GAAP_0p7_JMAG_GAAP_0p7_KsMAG_GAAP_0p7_YMAG_GAAP_0p7_ZMAG_GAAP_0p7_gMAG_GAAP_0p7_iMAG_GAAP_0p7_rMAG_GAAP_0p7_uMAG_GAAP_1p0_HMAG_GAAP_1p0_JMAG_GAAP_1p0_KsMAG_GAAP_1p0_YMAG_GAAP_1p0_ZMAG_GAAP_1p0_gMAG_GAAP_1p0_iMAG_GAAP_1p0_rMAG_GAAP_1p0_uMAG_GAAP_HMAG_GAAP_JMAG_GAAP_KsMAG_GAAP_YMAG_GAAP_ZMAG_GAAP_gMAG_GAAP_iMAG_GAAP_rMAG_GAAP_uMAG_ISOMAG_ISOCORMAG_LIM_HMAG_LIM_JMAG_LIM_KsMAG_LIM_YMAG_LIM_ZMAG_LIM_gMAG_LIM_iMAG_LIM_rMAG_LIM_uMASKMU_MAXMU_THRESHOLDM_0MaxValNBPZ_FILTNBPZ_FLAGFILTNBPZ_NONDETFILTNIMAFLAGS_ISOODDSPAgaapRAJ2000SG2DPHOTSG_FLAGSIDSLIDS_ELLIPTICITYS_ELONGATIONSeqNrTHELI_NAMETHETA_J2000THETA_WORLDT_BT_MLX2_WORLDXMAX_IMAGEXMIN_IMAGEXY_WORLDX_WORLDXposY2_WORLDYMAX_IMAGEYMIN_IMAGEY_WORLDYposZ_BZ_B_MAXZ_B_MINZ_ML
countdegpixeldegarcsecarcsecarcsecpixeldegcountarcsecarcsecarcsecmagmagmagmagmagmagmagmagdeg**(-2)deg**(-2)deg**(-2)degdegpixeldegpixeldegdeg**(-2)deg**(-2)deg**(-2)degdegdeg**2deg**2deg**2magmagmagmagmagmagmagmagmagcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountcountpixelpixeldegpixel**2pixel**2pixel**2pixel**2pixel**2pixel**2pixel**2pixel**2deg**2pixelmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmag.arcsec**(-2)mag.arcsec**(-2)magcountdegdegdegdegdeg**2pixelpixeldeg**2degpixeldeg**2pixelpixeldegpixel
float32float64float64float32float32float32float32int32int32int32float64float32float32float32float32float32float64float32float32float32float32float32float32float32float32float32float32float32float32float64float64float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32int16int16int16int16int16int16int32int32int32int32int16int16int16int16int16int32int32int32int32int16int16int16int16int16int16int16int16int16float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32int16int32objectint16int16int16int16int16int16int16int16int16float32objectfloat32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32int32float32float32float64float32int32int32int32int16float64float32float64int16float32int32int32float32float32int32objectfloat32float32float64float64float32int16int16float32float64float32float32int16int16float64float32float64float64float64float64
0.033165265.0790351.0235426.084906e-050.730.731.02511000.75228299999999994.469738e-05-0.0017154590.720.721.010.7290.46484760.29991530.49968910.146846770.40676881.32960890.952152250.3874302-0.62006190.003612689-0.00076210870.002087776-28.686515-28.6865150.15672519.317543e-060.11101976.595674e-068.399833e-05-2.136587e-054.632119e-0514.7784375.221574.632119e-111.068304e-118.399833e-110.0078360370.0123454550.00524866630.0189986940.0220296140.057601770.029611810.039848640.0739248810000000000000000000000000000.19809811.9727470.27665760.39451150.59137990.080621470.78793330.11983471.1810960.15883160.2735538196.62798124.66181238.99669158.690569.5472.7e-111.71e-104.11e-116.48e-11251.6214156.75671308.5334190.8169485.86073.06e-112.07e-104.61e-117.23e-11196.62798124.66181238.99669158.690569.5472.7e-111.71e-104.11e-116.48e-110.074607720.17720881.596522.4921692.03042.7329234.3372950.54272714.3494090.90840273.3192411.2815951.8628962737.44021720.62123617.13571493.72961024.12837.9394e-114.5041e-103.0745e-101.2166e-103256.9052114.56034415.32231885.77691198.38679.304e-113.9883e-103.5764e-109.2285e-112737.44021720.62123617.13571493.72961024.12837.9394e-114.5041e-103.0745e-101.2166e-100.4936681.1097663.0711524.069960.000241936521405256194KiDSDR4 J002018.968-284111.450877654432.826914e-08KIDS_5.6_-28.27.957740.13475220.85965420.14797580.15676970.1613240.19673840.1432630.38643490.1345910.15947190.07798750.07866340.07173840.1153460.07373070.36923290.41220420.14514150.578297730.08388160.08048790.07586890.1098630.07778960.357088660.563516740.139952020.8506120.07798750.07866340.07173840.1153460.07373070.36923290.41220420.14514150.578297730.16412640.17341390.148073524.1520623.6685623.8910523.5684323.0669525.3235523.0639224.764323.357424.3906223.9845321.406621.910821.104122.064322.474125.17886423.43383423.83150124.57512521.21821.686920.887621.811322.303525.0074823.57097223.66997124.8820321.39876621.89845521.0988522.04530122.4520725.12126223.40422223.79165324.501225.4264124.5469224.26588624.76066624.0540224.49862325.39430426.34992224.48536726.01633325.259056024.1433225.1279523.5230.073705490000.61812-76.75.07903501.04343605136210.26502021.3605824344KIDS_5p6_m28p213.2774176.722591.63600000000000011.63600000000000012.087776e-0918819188173.810582e-105.07903518817.863.612689e-0921682165-28.6865152166.2790.78999999999999990.970.66999999999999990.7799999999999999
0.033164135.1278182.0878840.00012409190.830.831.1511001.9293860.00011468860.00096040870.810.811.083.3030.017473550.456529620.160476680.1237812040.181455610.719900130.503206250.62137030.613328930.01324539-0.00088975720.01530689-28.686661-28.6866610.080348744.775494e-060.074937234.454466e-061.996915e-05-1.199723e-062.267847e-0578.0576911.94232.267847e-115.998675e-131.996915e-110.0083840660.0132088590.00561574240.0203274040.02357030.061630260.031682760.042635530.0790949610000000000000000000000000000.20213851.9679470.27962150.39648280.59248140.085124270.78884580.12468741.1816530.16327070.4096192251.87572167.1169208.39558143.0128652.4952282.73e-111.34e-104.21e-116.54e-11309.84167204.47795258.70938170.1577663.2387963.13e-111.6e-104.79e-117.43e-11251.87572167.1169208.39558143.0128652.4952282.73e-111.34e-104.21e-116.54e-110.18546420.29874915.3274585.9959626.2738256.9701557.8567921.6791917.9386973.1898576.0799574.4194297.018614051.9013479.6136185.02053084.2152601.79444.3013e-101.7294e-099.5104e-102.1142e-104348.3043868.22786566.3023274.38042917.63674.8485e-101.8597e-099.9146e-102.552e-104051.9013479.6136185.02053084.2152601.79444.3013e-101.7294e-099.5104e-102.1142e-105.1524556.5961843.2383037.0502580.000419098701940157430KiDSDR4 J002030.676-284111.9705957504230241552.084849e-07KIDS_5.6_-28.25.1543820.041205840.35643820.048402530.061774850.055053280.10791270.042450350.21106640.040121010.0633810.06749190.05214510.03658240.05034480.02190640.068910790.0841266660.0480626370.33585820.07736490.0573930.04277750.05642180.0235330.070090840.093411730.0524547250.316105780.06749190.05214510.03658240.05034480.02190640.068910790.0841266660.0480626370.33585820.03909090.049186240.0818953522.843722.7153522.6661722.5518922.4218924.0972522.4106323.4005722.7002523.0465922.5443720.980921.146220.521621.277121.461823.34433621.97311822.6054423.9751320.904221.031220.456721.212221.337423.21513721.89933622.56289723.77765720.97251521.13299220.51598521.25677321.43822923.28270521.94143522.56280523.89603422.8799622.6117723.99703424.4424524.20277824.61156325.699726.33792524.75009325.99023225.249051229223.2341525.1279521.8440.170281190000.95672-11.75.12781801.04349605136210.075913551.082154350KIDS_5p6_m28p278.3272411.672762.8182.8181.530689e-0818102180934.44883e-105.12781818097.861.324538e-0821712162-28.6866612167.0660.83000000000000010.920.78999999999999990.8300000000000001
0.033205575.1710882.66071499999999970.000158160.90.91.15511002.4315810.0001445194-0.0012118120.870.871.134.2110.0235560.267618180.281677250.213691710.127523420.57171440.317111970.58469390.407556530.022489060.004024360.02341139-28.68675-28.686750.063209223.757584e-060.054932613.264565e-061.148496e-052.953093e-061.329186e-05-60.73038-29.269621.329186e-11-1.476561e-121.148496e-110.0087260830.0137476970.0058448290.0211566350.0245318190.064144390.032975230.044374790.0823215410000000000000000000000000000.2069911.9801790.28397070.40023680.59562230.089291550.79257020.12924691.1906170.16821430.4653718266.298146.86647284.13065170.8724877.0645142.79e-111.41e-104.29e-116.51e-11325.57266176.0589346.78217201.6673491.300313.2e-111.66e-104.88e-117.42e-11266.298146.86647284.13065170.8724877.0645142.79e-111.41e-104.29e-116.51e-110.25103150.35853210.113959.0252812.6385914.5213515.874533.00029516.144925.66074617.230918.11403815.060697332.3765630.73059407.1114593.234071.4349.4589e-103.2113e-091.8259e-095.6158e-107973.5626089.32769826.0964967.4244375.43071.0386e-093.5337e-091.9853e-096.1302e-107332.3765630.73059407.1114593.234071.4349.4589e-103.2113e-091.8259e-095.6158e-1012.0420614.088143.7381567.2038780.000428230501641070272KiDSDR4 J002041.061-284112.2901091048764493520113.85167e-07KIDS_5.6_-28.24.6015940.022225960.23827230.024400850.029932280.032320360.053312820.02479570.075040170.022514160.033557150.03943190.02831930.03279340.04039040.02055090.0320249050.0476719140.0255096550.125861720.04433230.03139160.03831780.04407870.02265560.03345230.051003820.0266881210.13141760.03943190.02831930.03279340.04039040.02055090.0320249050.0476719140.0255096550.125861720.022638990.027637850.0407474122.147722.2713521.9057521.7549821.6582523.4670921.6399122.7778121.5692322.3869121.7153920.336920.623620.066420.844720.975622.48873121.30115521.89724722.91446520.245920.538620.01920.759720.897422.38803521.2023721.80902122.8261720.32817520.60985220.06055620.82354420.95106722.42458721.26817921.85287322.83214421.9582521.7878723.9365824.58269323.86620524.4183225.28286426.31432324.69480725.96979325.254041622.6246625.1279521.0490.29851490000.9956538.55.17108801.04358605136210.086117391.0942324359KIDS_5p6_m28p2-51.45418-38.545823.3643.3642.341139e-081746617453-2.0122e-095.17108817459.232.248906e-0821742163-28.686752168.210.86000000000000010.890.78999999999999990.8600000000000001
0.025127045.912251201.6614990.01198622.02.02.051001102.6672360.0061042320.20623382.02.02.0222.0290.0003681149-0.913455960.078645706-0.412342070.954074860.317705150.94762610.0013160706--38.0032917.70473142.9275-28.648329-28.6483290.065241753.877772e-060.030923011.838689e-063.465592e-061.981326e-061.49523e-05-85.10667-4.8933341.49523e-11-9.90673e-133.465592e-120.0065265360.0102823720.00437154760.015823770.0183481850.047975770.024663290.033189420.0615710910000000000000000000000000000.23805122.2152640.35368360.52569290.81248480.083669841.0661190.12786191.4753820.18171217.6968855.24866400.5098950.09296484.01984235.716723.77e-112.23e-106.56e-11--855.24866400.5098950.09296484.01984235.716723.77e-112.23e-106.56e-11--855.24866400.5098950.09296484.01984235.716723.77e-112.23e-106.56e-11--11.132812.9576915.784861704.47132.000966.90851152.60592.493956275.49875.557158624.24979.9733866054.4523248.05721549.86510043.44831343.28312986.7383.6842e-095.7423e-095.6025e-09--23248.05721549.86510043.44831343.28312986.7383.6842e-095.7423e-095.6025e-09--23248.05721549.86510043.44831343.28312986.7383.6842e-095.7423e-095.6025e-09--44497.8147288.67221.345863.85190.051351191451800316701KiDSDR4 J002338.940-283853.981-31269297612006-21012-305718706657340.00104741KIDS_5.6_-28.23.6439590.016377950.0014114510.01200280.0085325860.036434260.0042025780.024987240.0025667060.01978660.00029095280.0399420.02017870.1027090.01676650.01970670.01111021450.0421641430.012712948--0.0399420.02017870.1027090.01676650.01970670.01111021450.0421641430.012712948--0.0399420.02017870.1027090.01676650.01970670.01111021450.0421641430.012712948--0.00027170370.00029757780.00578194321.664416.5810320.8970920.096319.2010723.6677818.559722.7978717.671622.1628912.6102419.08419.166419.995318.759619.716221.01247420.67014120.679983--19.08419.166419.995318.759619.716221.01329620.67522820.68263--19.07747319.15611819.99092918.74377619.69785120.96449920.64547720.646793--13.0391512.9731122.6697723.49346722.55558423.28784224.06902325.9874824.19709425.50867824.9404451435620.477225.1279512.5472.1574938018221.04.85.91225101.04359605136210.49089321.9642244360KIDS_5p6_m28p2-85.21107-4.7889321.01.00.000142927574925552-8.852452e-065.9122516519.483.800329e-0531962168-28.6483292823.8530.010.040.010.01
0.042013496.2068543.2896060.00019556870.990.991.22511002.6693230.00015860840.0056740540.90.91.151.10.01317252-0.266632080.40591430.090429306-0.1503830.506525040.164772030.1235942840.813262940.02799085-0.010782940.03541289-28.686387-28.6863870.073465824.367711e-060.057822633.435525e-061.308484e-05-5.543181e-061.779489e-0565.1771724.822831.779489e-112.771618e-121.308484e-110.0079714870.0125588510.0053393920.0193270950.0224104060.058597430.030123660.040537440.075202710000000000000000000000000000.26253212.7576180.36180470.51045840.75984720.1113191.0100710.16186441.565910.21283640.9226745377.9237172.92108490.3477239.10489113.6926653.53e-111.47e-105.74e-117.07e-11449.1889202.87726569.6579271.03824127.9569854.01e-111.71e-106.53e-118e-11377.9237172.92108490.3477239.10489113.6926653.53e-111.47e-105.74e-117.07e-110.34884360.57495119.5691560.6595213.2171916.8889221.595382.4568426.476564.86719536.438627.27953124.223113070.8672104.0782408.06421923.90562203.45079.5945e-102.0011e-091.7414e-093.9259e-103382.6742345.50682576.02422025.12392325.28171.0474e-092.1264e-091.9271e-094.2663e-103070.8672104.0782408.06421923.90562203.45079.5945e-102.0011e-091.7414e-093.9259e-1013.4205217.619956.33986910.838140.00064426740-1276785327KiDSDR4 J002449.644-284110.9901361281128963382084.805753e-07KIDS_5.6_-28.26.1619790.029794690.04937020.029727940.032823760.049206470.04143050.036116230.046669670.031752090.041366470.1336190.08922990.2210860.1349360.05602130.039946310.0797577350.035788020.1955260.1441760.0939120.2400980.1453130.05974650.041567710.087312310.0367902930.203593020.1336190.08922990.2210860.1349360.05602130.039946310.0797577350.035788020.1955260.028228730.035436930.0382115922.2078220.2027521.8571521.59121.324123.6840621.1028522.941820.756122.5047421.1994221.281821.692321.545821.789521.642222.47327821.81468421.94869223.30314621.176821.574421.472621.733921.583822.37887421.7538321.84132423.21972821.27382921.67974321.5404621.77017221.6197922.4146821.78456121.90815523.22794321.8405821.5449923.5564924.4053823.27373924.05352824.86066826.05889724.64956325.65365825.164446022.7659125.1279521.0010.26209890000.84319-27.76.20685401.04363605136210.18855851.2323754364KIDS_5p6_m28p262.2699427.730065.4555.4553.541289e-08218221665.391523e-096.2068542172.9382.799085e-0821752162-28.6863872168.3920.270.350.230.27
0.032584926.161440.7511824.466482e-050.720.721.017004410.4494982.669148e-05-0.0014336170.710.711.01.9880.4679059---3.38939482.2828636--0.508893970.0----0.0008548549-0.00080589960.001852526-28.686318-28.6863180.19087171.134919e-050.11032786.550753e-065.170074e-05-5.206151e-050.000120015971.3447318.655271.200158e-102.603102e-115.170074e-110.0078141380.0123109540.00523399840.0189455990.021968050.057440790.029529050.039737270.0737182910000000000000000000000000000.1933678--0.27080850.38619930.57925190.07801659--0.1168101--0.15522590.1592374317.41986146.4838--214.35852--2.55e-11--4e-11----180.95158------2.9e-11--4.59e-11--317.41986146.4838--214.35852--2.55e-11--4e-11--0.049474530.11225180.7552993--0.52061650.04090799-0.38836060.3974195--0.6197202--0.82565280.669472232.175262726.93396--88.23937--1.0455e-10--1.9011e-10----988.40967------8.7326e-11--1.6082e-10--32.175262726.93396--88.23937--1.0455e-10--1.9011e-10--0.23253190.47088271.7313343.4169140.00020311650-866981024KiDSDR4 J002438.745-284110.740444443221.413457e-08KIDS_5.6_-28.27.2264840.2780321--0.564903410.252580.2131904--0.2046984--0.20417210.258310710.71120.218786--2.63756--0.2648137--0.22844377----0.198769------0.36056098--0.3098824--10.71120.218786--2.63756--0.2648137--0.22844377--0.23106220.258887199.024.9647--25.3687128.1304899.025.66188--25.17951--24.8680125.0956726.231222.8463--25.1358--24.880022--24.353424----22.5127------25.076296--24.537735--26.22338522.83399--25.116854--24.82258--24.313686--26.2437925.4777223.74591424.58552623.42165824.17214824.95120226.41198324.81692926.04578825.286201024.4008825.1279525.0220.0581401430600.32271-19.56.1614401.04382605136210.40161261.6711584383KIDS_5p6_m28p270.5345619.465444.04.01.852526e-09284428424.029538e-106.161442843.1938.548549e-1021732172-28.6863182172.5921.622.050.912.16
0.032729965.97152400000000051.2310297.317097e-050.750.751.037204390.75414.482498e-050.042995530.720.721.012.0170.42035462.3550014-2.3319569----0.0-4.6315823--0.00.005353917-3.155174e-050.002009353-28.686822-28.6868220.18217881.082857e-050.10771616.402728e-060.00011725753.595047e-074.099535e-05-0.1350471-89.864954.099535e-11-1.797541e-131.172575e-100.0063551760.01001240.00425676860.01540830450.0178664380.046716130.024015740.032318010.0599544910000000000000000000000000000.19582441.7090550.27367480.3891670.58181350.079498190.77217170.11811871.0784580.15677590.3259732314.97177152.56778352.0165--102.65685--1.26e-10----395.14658186.44876436.96683245.83205116.562552.97e-111.52e-10----314.97177152.56778352.0165--102.65685--1.26e-10----0.080126170.18359041.674916126.73583.1095315.4812111.430330.53990620.299180.904115244.316311.2282334.56049924.341324207.8134213.40306--8.231131--6.2052e-10----105.19164434.6616111.43045148.1053838.627564.9849e-111.1216e-09----24.341324207.8134213.40306--8.231131--6.2052e-10----0.60017421.2415185.9740075.741210.0003412830-1518449243KiDSDR4 J002353.165-284112.5501197554323.887006e-08KIDS_5.6_-28.28.7146170.12697080.01464490.095580580.077106220.15990750.041310950.14188120.026428320.13862080.0776245914.04920.7971011.79096--13.5411--0.2204647----4.078510.4657284.257641.802153.276320.646880870.1471397----14.04920.7971011.79096--13.5411--0.2204647----0.14498630.1605930.0552783324.1000219.4027523.4282622.8128122.0148525.329221.391324.7694420.5435924.436823.0124726.534124.205824.177--27.7114--23.085966----24.94523.404624.882524.573626.032825.68501522.448347----26.52774424.19578724.172743--27.693533--23.06195----25.2143124.4251223.7543224.54134423.63359324.15400324.9715326.39928224.81692926.04850425.1491971435624.0581725.1279522.9530.0797187120700.30757-89.75.971524000000000501.04387605136210.38742291.6324474388KIDS_5p6_m28p20.270249389.729755.06.02.009353e-09564756451.577603e-115.97152400000000055646.1515.353917e-0921762172-28.6868222174.0610.721.110.470000000000000034.65
0.033210725.1490161.2160227.230684e-050.750.751.03511000.4952482.93655e-05-0.00038682070.710.711.010.120000000000000010.38159640.209178920.419483180.0540447240.339797970.818405150.0538272860.67725754-0.357082370.004777046-0.0026581280.001313565-28.686321-28.6863210.29359081.745754e-050.12058427.150005e-060.0002751549-0.00016289398.07332e-0519.9789270.021088.07332e-118.144777e-112.751549e-100.0085430980.01345941050.00572226430.0207129850.024017390.062799290.032283740.043444260.0805952710000000000000000000000000000.19770691.969890.27632540.39454490.5913870.080119280.78822090.11938261.1821540.15847510.2305012229.9144129.90288248.62883152.1320868.248252.63e-111.27e-104.05e-116.21e-11297.06937162.23967318.85382186.0338984.2093e-111.54e-104.58e-11--229.9144129.90288248.62883152.1320868.248252.63e-111.27e-104.05e-116.21e-110.050594790.099110190.94656321.6773461.3647341.5934611.085460.43960311.6464760.67550952.1277530.83979621.328981746.72327505.10638907.71466477.40405348.0337.5451e-113.499e-101.8273e-109.0624e-11790.3053669.6271006.0845493.12012382.302527.195e-114.5756e-102.0569e-10--746.72327505.10638907.71466477.40405348.0337.5451e-113.499e-101.8273e-109.0624e-110.28635510.45189462.9102954.6053560.000273762801873039605KiDSDR4 J002035.763-284110.750543333221.766821e-08KIDS_5.6_-28.27.4842450.22683081.2754080.21988850.26889630.19792750.5199030.19192840.60336830.20493540.18835810.3342960.2792290.297390.3459860.212910.378455730.394079720.240640920.743999540.4081190.2630560.3440970.4096040.2391530.45270440.365423920.24175562--0.3342960.2792290.297390.3459860.212910.378455730.394079720.240640920.743999540.19188040.23818310.591681324.7196324.0984424.3223824.1541524.5709625.5523524.1186125.0859223.840224.8495724.351222.817123.241522.605123.302823.645925.23417323.70799424.39641224.89488622.755522.935422.493423.267623.54425.28657723.42182424.270552--22.80855823.2280422.59937923.28208523.62188325.17137323.6757124.35296824.81429126.0177425.5224124.09608524.71595424.01112224.54444925.41477226.37844324.80834626.03229925.305265024.0190625.1279523.5930.0826423390000.36479-71.25.14901601.04389605136210.59273122.4553814390KIDS_5p6_m28p218.7527771.247233.4552.7271.313565e-0917786177841.329077e-095.14901617785.024.777046e-0921762173-28.6863212174.1050.771.10.580.64
0.032699425.9749132.777110.0001650780.920.921.167604352.3514570.00013976170.039665220.860.861.123.350.0001344783-1.5594940.18124962--0.0----0.89529990.00.024752030.0072221380.02203207-28.686763-28.6867630.18752951.114757e-050.15378249.139751e-060.00011400483.536768e-059.379852e-05-30.13004-59.869969.379851e-11-1.768402e-111.140048e-100.00634391230.0099946550.00424922440.0153809950.0178347730.046633330.023973170.032260720.0598482310000000000000000000000000000.19698031.8509340.25201660.30740920.48101970.080337490.6741520.11904721.0997040.15817960.7952651357.0216169.9388396.01532------1.4e-104.28e-11--429.59973201.26881474.43588----3.18e-111.65e-104.91e-11--357.0216169.9388396.01532------1.4e-104.28e-11--0.16760880.3865122.980301134.98844.2913535.51902811.656840.639276121.714921.32486349.787862.11232128.79766296.87506250.388670.72846------7.63e-103.2683e-10--411.98676382.7704285.45873----4.5217e-111.2717e-095.2235e-10--296.87506250.388670.72846------7.63e-103.2683e-10--2.6091875.47480216.9087315.325530.00091101763-1513466700KiDSDR4 J002353.979-284112.3404741363221191011.660812e-07KIDS_5.6_-28.28.9182550.071778180.014891020.063777090.060490080.1364770.033715490.097583860.023987350.081324330.029990561.305710.7368896.07914------0.199217650.1421825--1.132150.5709036.02761----0.763571440.140871640.10205732--1.305710.7368896.07914------0.199217650.1421825--0.069762410.076669830.0448137923.4743519.3342623.0785122.8053421.9935525.1457821.318124.3545720.4171923.848121.0116123.818624.003525.376------22.86154623.765133--23.462823.542725.1706----25.790922.31198123.258682--23.81225623.99350525.37175------22.83757223.732872--23.6187422.8140823.61826324.42426923.5057224.09032824.9027426.32213224.70253825.97232825.0960081435624.0450125.1279520.0560.0806910230600.6705255.35.97491301.04391605136210.15327191.1810174392KIDS_5p6_m28p2-34.68153-55.318473.06.02.203207e-0856025592-3.611105e-095.9749135596.1242.475204e-0821832172-28.6867632174.9220.40.490.273.78
0.033154795.101090.7766744.617996e-050.720.721.01511000.4403322.614364e-050.00039918130.710.711.00.6510.4622630.3481102-0.0409851070.64748380.039249420.187986370.67437170.6092758-0.220741270.001982978-0.00088184710.0008331006-28.686098-28.6860980.18457741.097464e-050.10662346.330898e-060.0001122161-4.872033e-054.830683e-0518.6599371.340074.830682e-112.436041e-111.122161e-100.0081456190.0128331930.0054560280.0197492860.022899950.059877470.030781690.041422960.0768454710000000000000000000000000000.1974963--0.27592510.39356180.58980930.079803790.78925620.11888271.1836530.15813550.2040879196.40332123.124146237.4997157.683669.135232.64e-111.25e-104.08e-116.27e-11251.6772155.41145307.6144190.0362785.282253e-111.52e-104.58e-117e-11196.40332123.124146237.4997157.683669.135232.64e-111.25e-104.08e-116.27e-110.050347840.11288361.319186--2.0102932.9117243.5279510.4043963.3856340.66578393.0789450.97115771.5071371247.51861289.96571723.3036705.9836678.95851.5839e-103.8555e-102.1446e-101.6792e-102053.75631807.10022709.3213953.731857.89941.716e-104.4223e-102.7625e-101.1214e-101247.51861289.96571723.3036705.9836678.95851.5839e-103.8555e-102.1446e-101.6792e-100.24000910.47415753.2833913.4397180.000204472201581928112KiDSDR4 J002024.261-284109.950554443211.766821e-08KIDS_5.6_-28.28.8288350.1625859--0.14906020.14678870.2143120.25316740.19391670.41749610.17683550.14705990.1709330.1036310.1496320.2425030.1105560.180967450.352008850.206556160.405405280.1330510.09337380.1232740.2163390.1079310.189814020.373181130.18000620.67773790.1709330.1036310.1496320.2425030.1105560.180967450.352008850.206556160.405405280.22781530.25854610.181559524.35923--23.9018523.4996223.2911925.6429823.335925.1016723.43924.6917824.2146222.259922.223621.909122.87822.920424.42901223.60265424.22257224.22523921.718621.857521.417822.551422.666424.34286323.45882223.95032924.67045622.25175322.21076821.90364322.85825222.89750124.36913523.57187324.18114924.14839426.2094325.4701924.26712824.77414124.06084324.50553325.40075126.37432324.82558326.02428625.2948251228824.3610425.1279523.5290.0603131790000.73042-71.35.1010901.04394605136210.43305431.7638374395KIDS_5p6_m28p218.7425471.257463.2733.1828.331006e-1018493184924.409279e-105.1010918492.381.982978e-0921762174-28.6860982174.7981.041.180.921.1400000000000001
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "
ID
object
KiDSDR4 J002018.968-284111.45
KiDSDR4 J002030.676-284111.97
KiDSDR4 J002041.061-284112.29
KiDSDR4 J002338.940-283853.98
KiDSDR4 J002449.644-284110.99
KiDSDR4 J002438.745-284110.74
KiDSDR4 J002353.165-284112.55
KiDSDR4 J002035.763-284110.75
KiDSDR4 J002353.979-284112.34
KiDSDR4 J002024.261-284109.95
" ], "text/plain": [ "\n", - " Level ALPHA_J2000 ... Z_B_MIN Z_ML \n", - " count deg ... \n", - " float32 float64 ... float64 float64 \n", - "---------- ------------------ ... ------------------- ------------------\n", - "0.03316526 5.079035 ... 0.6699999999999999 0.7799999999999999\n", - "0.03316413 5.127818 ... 0.7899999999999999 0.8300000000000001\n", - "0.03320557 5.171088 ... 0.7899999999999999 0.8600000000000001\n", - "0.02512704 5.912251 ... 0.01 0.01\n", - "0.04201349 6.206854 ... 0.23 0.27\n", - "0.03258492 6.16144 ... 0.91 2.16\n", - "0.03272996 5.9715240000000005 ... 0.47000000000000003 4.65\n", - "0.03321072 5.149016 ... 0.58 0.64\n", - "0.03269942 5.974913 ... 0.27 3.78\n", - "0.03315479 5.10109 ... 0.92 1.1400000000000001" + " ID \n", + " object \n", + "-----------------------------\n", + "KiDSDR4 J002018.968-284111.45\n", + "KiDSDR4 J002030.676-284111.97\n", + "KiDSDR4 J002041.061-284112.29\n", + "KiDSDR4 J002338.940-283853.98\n", + "KiDSDR4 J002449.644-284110.99\n", + "KiDSDR4 J002438.745-284110.74\n", + "KiDSDR4 J002353.165-284112.55\n", + "KiDSDR4 J002035.763-284110.75\n", + "KiDSDR4 J002353.979-284112.34\n", + "KiDSDR4 J002024.261-284109.95" ] }, - "execution_count": 8, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -311,6 +489,15 @@ "source": [ "kids_catalogue" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "eso." + ] } ], "metadata": { diff --git a/astroquery/eso/tests/test_eso_catalogues.py b/astroquery/eso/tests/test_eso_catalogues.py index 69add7c2d8..ce49b64bba 100644 --- a/astroquery/eso/tests/test_eso_catalogues.py +++ b/astroquery/eso/tests/test_eso_catalogues.py @@ -89,10 +89,9 @@ def mock_list_catalogues_info(*args, **kwargs): "ucd": ["", ""], }) - def mock_run_catalogue_query(query, maxrec=None, type_of_query="sync", authenticated=False): + def mock_run_catalogue_query(query, maxrec=None, authenticated=False): captured["query"] = query captured["maxrec"] = maxrec - captured["type_of_query"] = type_of_query captured["authenticated"] = authenticated return Table({"colA": [1], "colB": [2]}) diff --git a/astroquery/eso/utils.py b/astroquery/eso/utils.py index 146160359d..07feb6eaad 100644 --- a/astroquery/eso/utils.py +++ b/astroquery/eso/utils.py @@ -12,7 +12,7 @@ @dataclass -class _UserParams: +class _UserParams: """ Parameters set by the user """ From 47f6663f9c6aac054196f54f8e38615322ca6910 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:20:17 +0100 Subject: [PATCH 06/30] list_catalogues and query_catalogue working --- astroquery/eso/core.py | 559 +++++++++++++--------------------------- astroquery/eso/utils.py | 193 +------------- 2 files changed, 182 insertions(+), 570 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 915c944ee1..68193081be 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -37,10 +37,8 @@ from ..query import QueryWithLogin from ..utils import schema from .utils import _UserParams, raise_if_coords_not_valid, _reorder_columns, \ - _raise_if_has_deprecated_keys, _build_adql_string, _split_str_as_list_of_str, \ - _normalize_catalogue_list, _build_catalogue_metadata_query, \ - _build_catalogue_columns_query, _build_catalogue_table_query, \ - _set_last_version, DEFAULT_LEAD_COLS_PHASE3, DEFAULT_LEAD_COLS_RAW + _raise_if_has_deprecated_keys, _build_adql_string, \ + DEFAULT_LEAD_COLS_PHASE3, DEFAULT_LEAD_COLS_RAW __all__ = ['Eso', 'EsoClass'] @@ -73,6 +71,7 @@ class _EsoNames: phase3_table = "ivoa.ObsCore" raw_instruments_column = "instrument" phase3_surveys_column = "obs_collection" + catalogue_schema = "safcat" @staticmethod def ist_table(instrument_name): @@ -257,8 +256,10 @@ def message(query_str): row_limit_plus_one = self.ROW_LIMIT if self.ROW_LIMIT < sys.maxsize: row_limit_plus_one = self.ROW_LIMIT + 1 - - table_with_an_extra_row = tap.search(query=query_str, maxrec=row_limit_plus_one).to_table() + table_with_an_extra_row = tap.search(query=query_str, + maxrec=row_limit_plus_one).to_table() + else: + table_with_an_extra_row = tap.search(query=query_str).to_table() self._maybe_warn_about_table_length(table_with_an_extra_row, row_limit_plus_one) except DALQueryError: log.error(message(query_str)) @@ -269,7 +270,10 @@ def message(query_str): return table_with_an_extra_row[:self.ROW_LIMIT] - def tap(self, authenticated: bool = False) -> TAPService: + def tap(self, authenticated: bool = False, *, which_tap: str = "tap_obs") -> TAPService: + which_tap = which_tap.lower() + if which_tap not in ("tap_obs", "tap_cat"): + raise ValueError("which_tap must be 'tap_obs' or 'tap_cat'.") if authenticated and not self.authenticated(): raise LoginError( @@ -281,32 +285,36 @@ def tap(self, authenticated: bool = False) -> TAPService: ".login(username=" ) - log.debug(f"Querying from {self._tap_url()}") + tap_url = self._tap_url() if which_tap == "tap_obs" else conf.tap_cat_url + log.debug(f"Querying from {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) + tap_service = TAPService(tap_url, session=self._session) else: - tap_service = TAPService(self._tap_url()) + tap_service = TAPService(tap_url) return tap_service def query_tap(self, query: str, *, authenticated: bool = False, + which_tap: str = "tap_obs", ) -> Table: """ Query the ESO TAP service using a free ADQL string. Parameters ---------- - query_str : str + query : 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``. + which_tap : {"tap_obs", "tap_cat"}, optional + TAP endpoint to query. Default is ``"tap_obs"``. Returns ------- @@ -319,7 +327,7 @@ def query_tap(self, eso_instance.query_tap("SELECT * FROM ivoa.ObsCore") """ table_to_return = Table() - tap_service = self.tap(authenticated) + tap_service = self.tap(authenticated, which_tap=which_tap) table_to_return = self._try_download_pyvo_table(query, tap_service) return table_to_return @@ -370,20 +378,27 @@ def list_surveys(self, *, cache=True) -> List[str]: return res @unlimited_maxrec - def list_column(self, table_name: str) -> None: + def _list_column(self, table_name: str, *, which_tap: str = "tap_obs") -> 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(help_query) + if which_tap == "tap_obs": + help_query = ( + f"select column_name, datatype, unit, xtype " + f"from TAP_SCHEMA.columns " + f"where table_name = '{table_name}'") + else: + schema = _EsoNames.catalogue_schema + help_query = ( + f"select column_name, datatype, unit, ucd " + f"from TAP_SCHEMA.columns " + f"where table_name = '{table_name.removeprefix(schema+'.')}'") + + print(help_query) + available_cols = self.query_tap(help_query, which_tap=which_tap) count_query = f"select count(*) from {table_name}" - num_records = list(self.query_tap(count_query)[0].values())[0] + num_records = list(self.query_tap(count_query, which_tap=which_tap)[0].values())[0] with (astropy.conf.set_temp( "max_lines", len(available_cols) + 2), @@ -392,12 +407,51 @@ def list_column(self, table_name: str) -> None: 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") + @unlimited_maxrec + @deprecated_renamed_argument('cache', None, since='0.4.12') + def list_catalogues(self, all_versions: bool = False, cache: bool = True) -> List[str]: + """ + List available catalogue tables offered by the ESO archive. + + Parameters + ---------- + all_versions : bool, optional + If True, list all versions of each catalogue table. If False (default), + return only the latest version of each catalogue (as determined by the + TAP_CAT metadata query). + cache : bool, optional + Deprecated and unused. Retained for backwards compatibility. + + Returns + ------- + list[str] + List of catalogue table names. + """ + _ = cache # We're aware about disregarding the argument + schema = _EsoNames.catalogue_schema + + query_str = (f"SELECT table_name FROM TAP_SCHEMA.tables as ref " + "LEFT OUTER JOIN TAP_SCHEMA.keys AS k ON ref.table_name = k.from_table " + "LEFT OUTER JOIN TAP_SCHEMA.key_columns AS kc ON k.key_id = kc.key_id " + f"WHERE schema_name='{schema}'") + + if not all_versions: + query_str += ("AND cat_id IN ( " + "SELECT t1.cat_id " + "FROM TAP_SCHEMA.tables t1 " + "LEFT JOIN TAP_SCHEMA.tables t2 ON (t1.title = t2.title AND t1.version < t2.version) " + "WHERE t2.title IS NULL)") + + res = self.query_tap(query_str, which_tap="tap_cat") + return list(res["table_name"]) + def _query_on_allowed_values( self, - user_params: _UserParams + user_params: _UserParams, + query_func=None, ) -> Union[Table, int, str, None]: if user_params.print_help: - self.list_column(user_params.table_name) + self._list_column(user_params.table_name, which_tap=user_params.which_tap) return _raise_if_has_deprecated_keys(user_params.column_filters) @@ -409,7 +463,9 @@ def _query_on_allowed_values( if user_params.get_query_payload: return query - ret_table = self.query_tap(query=query, authenticated=user_params.authenticated) + if query_func is None: + query_func = self.query_tap + ret_table = query_func(query=query, authenticated=user_params.authenticated) return list(ret_table[0].values())[0] if user_params.count_only else ret_table @deprecated_renamed_argument(('open_form', 'cache'), (None, None), @@ -1054,375 +1110,120 @@ def query_apex_quicklooks(self, authenticated=authenticated) return self._query_on_allowed_values(user_params) - def _tap_catalogues(self, authenticated: bool = False) -> TAPService: - """ - Return a TAPService connected to the catalogue TAP endpoint. - """ - log.debug(f"Querying from {conf.tap_cat_url}") - if authenticated: - h = self._get_auth_header() - if not h: - raise LoginError( - "It seems you are trying to issue an authenticated query to the catalogue TAP " - f"service ({conf.tap_cat_url}) 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=" - ) - self._session.headers = {**self._session.headers, **h} - return TAPService(conf.tap_cat_url, session=self._session) - return TAPService(conf.tap_cat_url) - - def _run_catalogue_tap_query(self, - query: str, *, - maxrec: Optional[int] = None, - authenticated: bool = False) -> Table: - """ - Execute a TAP query against the catalogue service. - - Parameters - ---------- - query : str - The ADQL query string to be executed. - maxrec : int, optional - The maximum number of records to retrieve. If not provided, the - current ROW_LIMIT value is used. - authenticated : bool, optional - If ``True``, performs the query with an authenticated session. - - Returns - ------- - astropy.table.Table - Table with the query results. - """ - row_limit = maxrec if maxrec is not None else self.ROW_LIMIT - if row_limit is None or row_limit < 1: - row_limit = sys.maxsize - row_limit_plus_one = row_limit if row_limit >= sys.maxsize else row_limit + 1 - - def message(query_str): - return ( - "Error executing the following catalogue query:\n\n" - f"{query_str}\n\n" - ) - - table_with_extra = Table() - tap_service = self._tap_catalogues(authenticated=authenticated) - tmp_limit = self.ROW_LIMIT - try: - self.ROW_LIMIT = row_limit - table_with_extra = tap_service.search( - query=query, maxrec=row_limit_plus_one - ).to_table() - self._maybe_warn_about_table_length(table_with_extra, row_limit_plus_one) - except DALQueryError: - log.error(message(query)) - except DALFormatError as e: - raise DALFormatError(message(query) + f"cause: {e.cause}") from e - except Exception as e: - raise type(e)(f"{e}\n" + message(query)) from e - finally: - self.ROW_LIMIT = tmp_limit - - return table_with_extra[:row_limit] - - def list_catalogues(self, all_versions: bool = False, - collections: Union[str, List[str]] = None, - tables: Union[str, List[str]] = None, - verbose: bool = False) -> Table: - """ - Retrieve metadata for ESO catalogues. - - Parameters - ---------- - all_versions : bool, optional - If ``True``, includes all versions of the catalogues. Default is ``False``. - collections : str or list of str, optional - Catalogue collection name(s) to filter by. - tables : str or list of str, optional - Catalogue table name(s) to filter by. - verbose : bool, optional - If ``True``, logs the generated ADQL query. - - Returns - ------- - astropy.table.Table - Metadata table for the selected catalogues. The table includes - ``table_RA``, ``table_Dec``, and ``table_ID`` columns when available. - - Raises - ------ - TypeError - If ``collections`` or ``tables`` are not strings or lists of strings. - DALFormatError - If the TAP response is malformed. - """ - clean_collections = _normalize_catalogue_list(collections, "collections") - clean_tables = _normalize_catalogue_list(tables, "tables") - query = _build_catalogue_metadata_query(all_versions, clean_collections, clean_tables) - if verbose: - log.info("Query:\n%s", query) - table = self._run_catalogue_tap_query(query, maxrec=self.ROW_LIMIT) - if len(table) == 0: - return table - - table.sort(["collection", "table_name", "version"]) - _set_last_version(table, update=True) - - ra_id = [None] * len(table) - dec_id = [None] * len(table) - source_id = [None] * len(table) - columns_table = self.list_catalogues_info( - tables=table["table_name"].tolist(), verbose=False - ) - if isinstance(columns_table, Table) and len(columns_table) > 0: - if {"table_name", "column_name", "ucd"}.issubset(columns_table.colnames): - lookup = { - table_name: {"id": [], "ra": [], "dec": []} - for table_name in table["table_name"] - } - for row in columns_table: - table_name = row["table_name"] - ucd = row["ucd"] - if table_name not in lookup: - continue - if ucd.strip() == "meta.id;meta.main": - lookup[table_name]["id"].append(row["column_name"]) - elif ucd.strip() == "pos.eq.ra;meta.main": - lookup[table_name]["ra"].append(row["column_name"]) - elif ucd.strip() == "pos.eq.dec;meta.main": - lookup[table_name]["dec"].append(row["column_name"]) - for idx, table_name in enumerate(table["table_name"]): - entry = lookup.get(table_name, {}) - ids = entry.get("id", []) - ras = entry.get("ra", []) - decs = entry.get("dec", []) - source_id[idx] = ids[0] if len(ids) == 1 else None - ra_id[idx] = ras[0] if len(ras) == 1 else None - dec_id[idx] = decs[0] if len(decs) == 1 else None - - table.add_column( - Column( - data=ra_id, - name="table_RA", - dtype=str, - description="Identifier for RA in the catalog", - ) - ) - table.add_column( - Column( - data=dec_id, - name="table_Dec", - dtype=str, - description="Identifier for Dec in the catalog", - ) - ) - table.add_column( - Column( - data=source_id, - name="table_ID", - dtype=str, - description="Identifier for Source ID in the catalog", - ) - ) - return table - - def list_catalogues_info(self, - collections: Union[str, List[str]] = None, - tables: Union[str, List[str]] = None, - verbose: bool = False) -> Table: - """ - Retrieve column metadata for ESO catalogues. - - Parameters - ---------- - collections : str or list of str, optional - Catalogue collection name(s) to filter by. - tables : str or list of str, optional - Catalogue table name(s) to filter by. - verbose : bool, optional - If ``True``, logs the generated ADQL query. - - Returns - ------- - astropy.table.Table - Table of column metadata (name, UCD, datatype, description, unit). - - Raises - ------ - TypeError - If ``collections`` or ``tables`` are not strings or lists of strings. - DALFormatError - If the TAP response is malformed. - """ - clean_collections = _normalize_catalogue_list(collections, "collections") - clean_tables = _normalize_catalogue_list(tables, "tables") - query = _build_catalogue_columns_query(clean_collections, clean_tables) - if verbose: - log.info("Query:\n%s", query) - return self._run_catalogue_tap_query(query, maxrec=self.ROW_LIMIT) - - def query_catalogues(self, - collections: Union[List[str], str] = None, - tables: Union[List[str], str] = None, - columns: Union[List[str], str] = None, - all_versions: bool = False, - maxrec: Optional[int] = None, - verbose: bool = False, - conditions_dict: Optional[Dict[str, str]] = None, - top: Optional[int] = None, - order_by: Optional[str] = None, - order: str = "ascending") -> Union[Table, List[Table], None]: + @deprecated_renamed_argument(('open_form', 'cache'), (None, None), + since=['0.4.12', '0.4.12']) + def query_catalogue( + self, + catalogue: 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, + get_query_payload: bool = False, + help: bool = False, + authenticated: bool = False, + open_form: bool = False, cache: bool = False, + maxrec: Optional[int] = None, + ) -> Union[Table, int, str]: """ - Query ESO catalogues with collection/table filters and custom constraints. + Query catalogue data contained in the ESO archive. Parameters ---------- - collections : str or list of str, optional - Catalogue collection name(s) to query. - tables : str or list of str, optional - Catalogue table name(s) to query. + catalogue : str + Name of the catalogue to query. Should be ONLY ONE of the names + returned by :meth:`~astroquery.eso.EsoClass.list_catalogues`. + cone_ra : float, optional + **Not implemented** for catalogue queries. + cone_dec : float, optional + **Not implemented** for catalogue queries. + cone_radius : float, optional + **Not implemented** for catalogue queries. columns : str or list of str, optional - Column name(s) to retrieve. If not provided, selects all columns. - all_versions : bool, optional - If ``True``, includes obsolete catalogue versions when expanding collections. - Default is ``False``. - maxrec : int, optional - Maximum number of rows to retrieve per catalogue. Defaults to ROW_LIMIT. - verbose : bool, optional - If ``True``, logs the generated ADQL query for each catalogue. - conditions_dict : dict, optional - Additional query constraints in ADQL syntax, e.g., - ``{"mag": "< 20", "flag": "= 0"}``. + 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, selects only the top N rows. - order_by : str, optional - Column name to order by. - order : str, optional - Sort order: 'ascending' or 'descending'. Default is 'ascending'. + 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``. + get_query_payload : 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., ``{"mag": "< 20"}``. + Default is ``None``. + open_form : bool, optional + **Deprecated** - unused. + cache : bool, optional + **Deprecated** - unused. + maxrec : int, optional + Overrides the configured row limit for this query only. Returns ------- - astropy.table.Table or list of astropy.table.Table or None - If only one catalogue is queried, returns a single table. Otherwise, - returns a list of tables. Returns ``None`` if no catalogues match. - - Raises - ------ - TypeError - If ``columns`` or ``conditions_dict`` types are invalid. - ValueError - If ``order`` is invalid. - DALFormatError - If the TAP response is malformed. + 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 ``get_query_payload`` is ``True``, returns the query string that + would be issued to the TAP service given the specified arguments. """ - clean_collections = _normalize_catalogue_list(collections, "collections") - clean_tables = _normalize_catalogue_list(tables, "tables") - - table_names = list(clean_tables or []) - if clean_collections: - collections_table = self.list_catalogues( - all_versions=all_versions, - collections=clean_collections, - tables=None, - verbose=False, - ) - if isinstance(collections_table, Table) and len(collections_table) > 0: - table_names += collections_table["table_name"].tolist() - - # De-duplicate tables while preserving order. - table_names = list(dict.fromkeys(table_names)) - if not table_names: - return None + _ = open_form, cache # make explicit that we are aware these arguments are unused + column_filters = column_filters if column_filters else {} - if conditions_dict is not None and not isinstance(conditions_dict, dict): - raise TypeError("`conditions_dict` must be a dictionary.") + schema = _EsoNames.catalogue_schema + if catalogue.lower().startswith(f"{schema}."): + catalogue = catalogue.split(".", 1)[1] - requested_columns = None - if columns is not None: - if isinstance(columns, str): - requested_columns = _split_str_as_list_of_str(columns) - else: - if hasattr(columns, "tolist"): - columns = columns.tolist() - if not isinstance(columns, (list, tuple, set)): - raise TypeError("`columns` must be a string or list of strings.") - requested_columns = [] - for col in columns: - if not isinstance(col, str): - raise TypeError("All `columns` entries must be strings.") - requested_columns.append(col.strip()) - - columns_table = None - if requested_columns is not None: - columns_table = self.list_catalogues_info(tables=table_names, verbose=False) - - column_lookup = {} - if isinstance(columns_table, Table) and len(columns_table) > 0: - if {"table_name", "column_name"}.issubset(columns_table.colnames): - for row in columns_table: - column_lookup.setdefault(row["table_name"], set()).add(row["column_name"]) - - totals_lookup = {} - totals_table = self.list_catalogues( - all_versions=all_versions, - collections=None, - tables=table_names, - verbose=False, - ) - if isinstance(totals_table, Table) and "number_rows" in totals_table.colnames: - for row in totals_table: - try: - totals_lookup[row["table_name"]] = int(row["number_rows"]) - except Exception: - totals_lookup[row["table_name"]] = None - - results = [] - for table_name in table_names: - valid_columns = requested_columns - if requested_columns is not None and column_lookup: - valid_columns = [ - col for col in requested_columns - if col in column_lookup.get(table_name, set()) - ] - - query = _build_catalogue_table_query( - table_name, - valid_columns, - conditions_dict, - order_by, - order, - top, + catalogue_names = self.list_catalogues(all_versions=True) + catalogue_map = {name.lower(): name for name in catalogue_names} + lookup_key = catalogue.lower() + if lookup_key not in catalogue_map: + raise ValueError( + f"Unknown catalogue '{catalogue}'. Use list_catalogues() to see available catalogues." ) - if verbose: - log.info("Query:\n%s", query) + catalogue = catalogue_map[lookup_key] + table_name = f"{schema}.{catalogue}" - effective_maxrec = maxrec if maxrec is not None else self.ROW_LIMIT - result_table = self._run_catalogue_tap_query( - query, - maxrec=effective_maxrec, - ) - results.append(result_table) - - total_rows = totals_lookup.get(table_name) - if total_rows is not None: - log.info( - "The query to %s returned %d entries out of %d (with a limit set to maxrec=%s)", - table_name, - len(result_table), - total_rows, - effective_maxrec, - ) - else: - log.info( - "The query to %s returned %d entries (with a limit set to maxrec=%s)", - table_name, - len(result_table), - effective_maxrec, - ) - - return results[0] if len(results) == 1 else results + row_limit = None + if maxrec is not None: + row_limit = self.ROW_LIMIT + self.ROW_LIMIT = maxrec + + try: + user_params = _UserParams(table_name=table_name, + column_name=None, + allowed_values=None, + cone_ra=None, + cone_dec=None, + cone_radius=None, + columns=columns, + column_filters=column_filters, + top=top, + count_only=count_only, + get_query_payload=get_query_payload, + print_help=help, + authenticated=authenticated, + which_tap="tap_cat" + ) + query_func = functools.partial(self.query_tap, which_tap="tap_cat") + return self._query_on_allowed_values(user_params, query_func=query_func) + + finally: + if row_limit is not None: + self.ROW_LIMIT = row_limit Eso = EsoClass() diff --git a/astroquery/eso/utils.py b/astroquery/eso/utils.py index 07feb6eaad..fe0f775dfc 100644 --- a/astroquery/eso/utils.py +++ b/astroquery/eso/utils.py @@ -5,7 +5,7 @@ from typing import Dict, List, Optional, Union import numpy as np -from astropy.table import Column, Table +from astropy.table import Table DEFAULT_LEAD_COLS_RAW = ['object', 'ra', 'dec', 'dp_id', 'date_obs', 'prog_id'] DEFAULT_LEAD_COLS_PHASE3 = ['target_name', 's_ra', 's_dec', 'dp_id', 'date_obs', 'proposal_id'] @@ -31,6 +31,7 @@ class _UserParams: get_query_payload: bool = False print_help: bool = False authenticated: bool = False + which_tap: str = "tap_obs" def _split_str_as_list_of_str(column_str: str): @@ -196,193 +197,3 @@ def _build_adql_string(user_params: _UserParams) -> str: query_string = "select " + query_string return query_string.strip() - - -def _normalize_catalogue_list(values: Union[str, List[str], None], - label: str) -> Optional[List[str]]: - """ - Normalize a catalogue filter to a list of strings. - - Parameters - ---------- - values : str, list of str, or None - Filter values to normalize. - label : str - Label used in error messages. - - Returns - ------- - list of str or None - Normalized list of strings. Returns ``None`` for empty inputs. - """ - if values is None: - return None - if isinstance(values, str): - cleaned = values.strip() - return [cleaned] if cleaned else None - if hasattr(values, "tolist"): - values = values.tolist() - if not isinstance(values, (list, tuple, set)): - raise TypeError(f"`{label}` must be a string or list of strings.") - normalized = [] - for value in values: - if not isinstance(value, str): - raise TypeError(f"All `{label}` entries must be strings.") - cleaned = value.strip() - if cleaned: - normalized.append(cleaned) - return normalized or None - - -def _catalogue_like_conditions(column_name: str, - values: Optional[List[str]]) -> Optional[str]: - """ - Build a LIKE clause joined by OR for catalogue filters. - """ - if not values: - return None - return " OR ".join(f"{column_name} LIKE '{value}'" for value in values) - - -def _build_catalogue_metadata_query(all_versions: bool, - collections: Optional[List[str]], - tables: Optional[List[str]]) -> str: - """ - Build the ADQL query for catalogue metadata. - """ - query = """ - SELECT - collection, title, version, table_name, filter, instrument, telescope, publication_date, - ref.description AS description, number_rows, number_columns, rel_descr_url, acknowledgment, - cat_id, mjd_obs, mjd_end, skysqdeg, bibliography, document_id, kc.from_column AS from_column, - k.target_table AS target_table, kc.target_column AS target_column, schema_name - FROM TAP_SCHEMA.tables AS ref - LEFT OUTER JOIN TAP_SCHEMA.keys AS k ON ref.table_name = k.from_table - LEFT OUTER JOIN TAP_SCHEMA.key_columns AS kc ON k.key_id = kc.key_id - WHERE schema_name = 'safcat' - """ - if not all_versions: - query += """ - AND cat_id IN ( - SELECT t1.cat_id - FROM TAP_SCHEMA.tables t1 - LEFT JOIN TAP_SCHEMA.tables t2 ON (t1.title = t2.title AND t1.version < t2.version) - WHERE t2.title IS NULL - ) - """ - collections_clause = _catalogue_like_conditions("collection", collections) - if collections_clause: - query += f" AND ({collections_clause})" - tables_clause = _catalogue_like_conditions("table_name", tables) - if tables_clause: - query += f" AND ({tables_clause})" - return query - - -def _build_catalogue_columns_query(collections: Optional[List[str]], - tables: Optional[List[str]]) -> str: - """ - Build the ADQL query for catalogue column metadata. - """ - collections = collections or ["%"] - tables = tables or ["%"] - collections_clause = _catalogue_like_conditions("collection", collections) - tables_clause = _catalogue_like_conditions("table_name", tables) - return f""" - SELECT table_name, column_name, ucd, datatype, description, unit - FROM TAP_SCHEMA.columns - WHERE table_name IN ( - SELECT table_name FROM TAP_SCHEMA.tables WHERE {collections_clause} - ) - AND ({tables_clause}) - """ - - -def _build_catalogue_table_query(table_name: str, - columns: Union[List[str], str, None], - conditions_dict: Optional[Dict[str, str]], - order_by: Optional[str], - order: str, - top: Optional[int]) -> str: - """ - Build the ADQL query to retrieve rows from a catalogue table. - """ - if columns is None: - column_list = [] - elif isinstance(columns, str): - column_list = _split_str_as_list_of_str(columns) - else: - if hasattr(columns, "tolist"): - columns = columns.tolist() - if not isinstance(columns, (list, tuple, set)): - raise TypeError("`columns` must be a string or list of strings.") - column_list = [] - for col in columns: - if not isinstance(col, str): - raise TypeError("All `columns` entries must be strings.") - column_list.append(col.strip()) - select_columns = ", ".join(column_list) if column_list else "*" - select_clause = f"SELECT {'TOP ' + str(top) + ' ' if top else ''}{select_columns}" - - conditions_clause = "" - if conditions_dict: - if not isinstance(conditions_dict, dict): - raise TypeError("`conditions_dict` must be a dictionary.") - conditions = [] - for key, value in conditions_dict.items(): - if value is None: - continue - conditions.append(f"{key} {_adql_sanitize_op_val(value)}") - if conditions: - conditions_clause = " WHERE " + " AND ".join(conditions) - - order_clause = "" - if order_by: - order_token = (order or "ascending").strip().lower() - if order_token in ("ascending", "asc", ""): - direction = "asc" - elif order_token in ("descending", "desc"): - direction = "desc" - else: - raise ValueError("`order` must be 'ascending' or 'descending'.") - order_clause = f" ORDER BY {order_by} {direction}" - - return f"{select_clause} FROM {table_name}{conditions_clause}{order_clause}" - - -def _set_last_version(table: Table, update: bool = True) -> None: - """ - Append or update a ``last_version`` column based on title/version metadata. - """ - required_cols = ("title", "version") - if any(col not in table.colnames for col in required_cols): - return - if "last_version" in table.colnames and not update: - return - if "last_version" in table.colnames: - table.remove_column("last_version") - - titles = table["title"] - versions = table["version"] - try: - versions_numeric = versions.astype(float) - use_numeric = True - except Exception: - versions_numeric = versions - use_numeric = False - - last_version_flags = np.zeros(len(table), dtype=bool) - for title in np.unique(titles): - mask = titles == title - version_values = versions_numeric[mask] - latest = np.nanmax(version_values) if use_numeric else max(version_values) - last_version_flags[mask] = (version_values == latest) - - table.add_column( - Column( - data=last_version_flags, - name="last_version", - dtype=bool, - description="True if this is the latest version of the catalogue", - ) - ) From 8fe8c04fafc50d9aad99f8d21bc6fa159138cb62 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:49:28 +0100 Subject: [PATCH 07/30] include RA/Dec query catalogue, print_help output table --- astroquery/eso/core.py | 73 ++++++++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 17 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 68193081be..0d2836f010 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -378,24 +378,50 @@ def list_surveys(self, *, cache=True) -> List[str]: return res @unlimited_maxrec - def _list_column(self, table_name: str, *, which_tap: str = "tap_obs") -> None: - """ - Prints the columns contained in a given table - """ + def _columns_table(self, table_name: str, *, which_tap: str = "tap_obs") -> Table: if which_tap == "tap_obs": help_query = ( - f"select column_name, datatype, unit, xtype " - f"from TAP_SCHEMA.columns " - f"where table_name = '{table_name}'") + "select column_name, datatype, unit, xtype " + f"from TAP_SCHEMA.columns where table_name = '{table_name}'") else: schema = _EsoNames.catalogue_schema help_query = ( - f"select column_name, datatype, unit, ucd " + "select column_name, datatype, unit, ucd " f"from TAP_SCHEMA.columns " f"where table_name = '{table_name.removeprefix(schema+'.')}'") + return self.query_tap(help_query, which_tap=which_tap) + + def _catalogue_radec_columns(self, table_name: str, *, which_tap: str = "tap_cat") -> Tuple[str, str]: + columns = self._columns_table(table_name, which_tap=which_tap) + ra_col = None + dec_col = None + for row in columns: + ucd = row["ucd"] + try: + ucd_norm = ucd.strip().lower() + except AttributeError: + continue + if ucd_norm == "pos.eq.ra;meta.main": + ra_col = row["column_name"] + elif ucd_norm == "pos.eq.dec;meta.main": + dec_col = row["column_name"] + if ra_col and dec_col: + break + if not ra_col or not dec_col: + raise ValueError( + "Unable to resolve RA/Dec columns from UCD metadata. " + "Expected UCDs 'pos.eq.ra;meta.main' and 'pos.eq.dec;meta.main'." + ) + return ra_col, dec_col - print(help_query) - available_cols = self.query_tap(help_query, which_tap=which_tap) + @unlimited_maxrec + def _list_column(self, table_name: str, *, which_tap: str = "tap_obs", + return_table: bool = False) -> Optional[Table]: + """ + Prints the columns contained in a given table. + Returns an astropy table when return_table is True. + """ + available_cols = self._columns_table(table_name, which_tap=which_tap) count_query = f"select count(*) from {table_name}" num_records = list(self.query_tap(count_query, which_tap=which_tap)[0].values())[0] @@ -404,8 +430,11 @@ def _list_column(self, table_name: str, *, which_tap: str = "tap_obs") -> None: "max_lines", len(available_cols) + 2), astropy.conf.set_temp( "max_width", sys.maxsize)): - log.info(f"\nColumns present in the table {table_name}:\n{available_cols}\n" + 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") + if return_table: + return available_cols @unlimited_maxrec @deprecated_renamed_argument('cache', None, since='0.4.12') @@ -451,8 +480,9 @@ def _query_on_allowed_values( query_func=None, ) -> Union[Table, int, str, None]: if user_params.print_help: - self._list_column(user_params.table_name, which_tap=user_params.which_tap) - return + return self._list_column(user_params.table_name, + which_tap=user_params.which_tap, + return_table=True) _raise_if_has_deprecated_keys(user_params.column_filters) @@ -539,7 +569,7 @@ def query_surveys( would be issued to the TAP service given the specified arguments. """ _ = open_form, cache # make explicit that we are aware these arguments are unused - column_filters = column_filters if column_filters else {} + column_filters = dict(column_filters) if column_filters else {} user_params = _UserParams(table_name=_EsoNames.phase3_table, column_name=_EsoNames.phase3_surveys_column, allowed_values=surveys, @@ -1135,11 +1165,11 @@ def query_catalogue( Name of the catalogue to query. Should be ONLY ONE of the names returned by :meth:`~astroquery.eso.EsoClass.list_catalogues`. cone_ra : float, optional - **Not implemented** for catalogue queries. + Cone Search Center - Right Ascension in degrees. cone_dec : float, optional - **Not implemented** for catalogue queries. + Cone Search Center - Declination in degrees. cone_radius : float, optional - **Not implemented** for catalogue queries. + 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. @@ -1203,6 +1233,15 @@ def query_catalogue( self.ROW_LIMIT = maxrec try: + if any(v is not None for v in (cone_ra, cone_dec, cone_radius)): + raise_if_coords_not_valid(cone_ra, cone_dec, cone_radius) + ra_col, dec_col = self._catalogue_radec_columns(table_name, which_tap="tap_cat") + cone_constraint = ( + "CONTAINS(point('', " + f"{ra_col}, {dec_col}), circle('', {cone_ra}, {cone_dec}, {cone_radius}))" + ) + column_filters[cone_constraint] = "= 1" + user_params = _UserParams(table_name=table_name, column_name=None, allowed_values=None, From a7c80e8b53c34847c35d2b856c9b9b402b7d1a0c Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:52:20 +0100 Subject: [PATCH 08/30] removed testing --- astroquery/eso/testing/test_catalogues.ipynb | 524 ------------------- 1 file changed, 524 deletions(-) delete mode 100644 astroquery/eso/testing/test_catalogues.ipynb diff --git a/astroquery/eso/testing/test_catalogues.ipynb b/astroquery/eso/testing/test_catalogues.ipynb deleted file mode 100644 index 0d2d982b91..0000000000 --- a/astroquery/eso/testing/test_catalogues.ipynb +++ /dev/null @@ -1,524 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import astroquery\n", - "print(astroquery.__version__) # Print the version of astroquery\n", - "print(astroquery.__file__) # Print the file path of astroquery\n", - "from astroquery.eso import Eso # Import the ESO module\n", - "\n", - "eso = Eso()" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING: MaxResultsWarning: Results truncated to 1000. To retrieve all the records set to None the ROW_LIMIT attribute [astroquery.eso.core]\n" - ] - }, - { - "data": { - "text/html": [ - "
Table length=129\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
table_IDtable_RAtable_Deccollectioninstrumenttable_nametitleversionnumber_rows
str10str11str11objectobjectobjectobjectint32int64
NoneNoneNone1101.A-0127MUSEAMUSED_MAIN_SOURCE_CAT_V1AMUSED: the MUSE Hubble Ultra-Deep Field surveys12221
NoneNoneNone195.B-0283HAWKIGNS_catalogue_V1GALACTICNUCLEUS Survey13277646
SPEC_IDNoneNone196.D-0214FORS2EREBOS_RV_cat_fits_V1EREBOS_RV_cat.fits1359
SOURCE_IDRA_2000DE_2000196.D-0214FORS2EREBOS_cat_fits_V1EREBOS_cat.fits19
NoneNoneNoneAMBREHARPSAMBRE_HARPS_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - HARPS1126688
NoneNoneNoneAMBREUVESAMBRE_UVES_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - UVES151897
DP_IDRAJ2000DEJ2000AMBREFEROSAMBRE_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra118618
ATLAS_NAMERADEATLASGALAPEXBOLATLASGAL_V1ATLASGAL - APEX Large Area Survey of the Galaxy110861
NoneNoneNoneFDSOMEGACAMFDS_SourceCatalogue_V1Fornax Deep Survey Source Catalogue13112605
NoneNoneNoneGAIAESOMULTIGES_2021_VRADGAIAESO catalogue of radial velocities1110762
...........................
NoneNoneNoneVVVVIRCAMVVV_bandMergedSourceCat_V3VVV: ZYJHKs Catalogue in the Via Lactea3590682953
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_OBSVIRAC2 observation details1197423
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_SOURCESVIRAC2 source catalogue - Rejected Sources1844909545
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_SOURCESVIRAC2 source catalogue1545346533
NoneNoneNoneXQ-100XSHOOTERXQ_100_summary_fits_V1Quasars and their absorption lines: a legacy survey of the high-redshift universe (XQ-100)1100
NoneNoneNoneZCOSMOSVIMOSZCOSMOS_V2zCOSMOS Spectroscopic Redshift Survey220689
" - ], - "text/plain": [ - "\n", - " table_ID table_RA table_Dec ... version number_rows\n", - " str10 str11 str11 ... int32 int64 \n", - "---------- -------- --------- ... ------- -----------\n", - " None None None ... 1 2221\n", - " None None None ... 1 3277646\n", - " SPEC_ID None None ... 1 359\n", - " SOURCE_ID RA_2000 DE_2000 ... 1 9\n", - " None None None ... 1 126688\n", - " None None None ... 1 51897\n", - " DP_ID RAJ2000 DEJ2000 ... 1 18618\n", - "ATLAS_NAME RA DE ... 1 10861\n", - " None None None ... 1 3112605\n", - " None None None ... 1 110762\n", - " ... ... ... ... ... ...\n", - " None None None ... 3 590682953\n", - " None None None ... 1 95768366366\n", - " None None None ... 1 95768366366\n", - " None None None ... 1 197423\n", - " None None None ... 1 27419652812\n", - " None None None ... 1 27419652812\n", - " None None None ... 1 844909545\n", - " None None None ... 1 545346533\n", - " None None None ... 1 100\n", - " None None None ... 2 20689" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "all_catalogues = eso.list_catalogues(all_versions=True) # Get all the available catalogues (only most recent version)\n", - "all_catalogues['table_ID', 'table_RA', 'table_Dec', 'collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=86\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
table_IDtable_RAtable_Deccollectioninstrumenttable_nametitleversionnumber_rows
str10str11str11objectobjectobjectobjectint32int64
NoneNoneNone1101.A-0127MUSEAMUSED_MAIN_SOURCE_CAT_V1AMUSED: the MUSE Hubble Ultra-Deep Field surveys12221
NoneNoneNone195.B-0283HAWKIGNS_catalogue_V1GALACTICNUCLEUS Survey13277646
SPEC_IDNoneNone196.D-0214FORS2EREBOS_RV_cat_fits_V1EREBOS_RV_cat.fits1359
SOURCE_IDRA_2000DE_2000196.D-0214FORS2EREBOS_cat_fits_V1EREBOS_cat.fits19
NoneNoneNoneAMBREHARPSAMBRE_HARPS_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - HARPS1126688
NoneNoneNoneAMBREUVESAMBRE_UVES_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra - UVES151897
DP_IDRAJ2000DEJ2000AMBREFEROSAMBRE_V1Atmospheric Parameters and Chemical Abundances from Stellar Spectra118618
ATLAS_NAMERADEATLASGALAPEXBOLATLASGAL_V1ATLASGAL - APEX Large Area Survey of the Galaxy110861
NoneNoneNoneFDSOMEGACAMFDS_SourceCatalogue_V1Fornax Deep Survey Source Catalogue13112605
NoneNoneNoneGAIAESOMULTIGES_2021_VRADGAIAESO catalogue of radial velocities1110762
...........................
NoneNoneNoneVVVVIRCAMVVV_bandMergedSourceCat_V3VVV: ZYJHKs Catalogue in the Via Lactea3590682953
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_LCVIRAC2 time series195768366366
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_OBSVIRAC2 observation details1197423
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_LCVIRAC2 time series - Rejected Sources127419652812
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_REJECTED_SOURCESVIRAC2 source catalogue - Rejected Sources1844909545
NoneNoneNoneVVVXVIRCAMVVVX_VIRAC_V2_SOURCESVIRAC2 source catalogue1545346533
NoneNoneNoneXQ-100XSHOOTERXQ_100_summary_fits_V1Quasars and their absorption lines: a legacy survey of the high-redshift universe (XQ-100)1100
NoneNoneNoneZCOSMOSVIMOSZCOSMOS_V2zCOSMOS Spectroscopic Redshift Survey220689
" - ], - "text/plain": [ - "\n", - " table_ID table_RA table_Dec ... version number_rows\n", - " str10 str11 str11 ... int32 int64 \n", - "---------- -------- --------- ... ------- -----------\n", - " None None None ... 1 2221\n", - " None None None ... 1 3277646\n", - " SPEC_ID None None ... 1 359\n", - " SOURCE_ID RA_2000 DE_2000 ... 1 9\n", - " None None None ... 1 126688\n", - " None None None ... 1 51897\n", - " DP_ID RAJ2000 DEJ2000 ... 1 18618\n", - "ATLAS_NAME RA DE ... 1 10861\n", - " None None None ... 1 3112605\n", - " None None None ... 1 110762\n", - " ... ... ... ... ... ...\n", - " None None None ... 3 590682953\n", - " None None None ... 1 95768366366\n", - " None None None ... 1 95768366366\n", - " None None None ... 1 197423\n", - " None None None ... 1 27419652812\n", - " None None None ... 1 27419652812\n", - " None None None ... 1 844909545\n", - " None None None ... 1 545346533\n", - " None None None ... 1 100\n", - " None None None ... 2 20689" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "all_catalogues = eso.list_catalogues(all_versions=False) # Get all the available catalogues (only most recent version)\n", - "all_catalogues['table_ID', 'table_RA', 'table_Dec', 'collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=4\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
collectioninstrumenttable_nametitleversionnumber_rows
objectobjectobjectobjectint32int64
KIDSOMEGACAMKiDS_DR3_0_ugri_src_fits_V2The Kilo-Degree Survey248736590
KIDSOMEGACAMKiDS_DR3_1_ugri_shear_fits_V1The Kilo-Degree Survey: Weak lensing shear mesurements114650348
KIDSOMEGACAM, VIRCAMKiDS_DR4_1_ugriZYJHKs_cat_fitsThe Kilo-Degree Survey 9-band ugriZYJHKs source catalogue4100350804
KIDSMULTIKiDS_DR5_0_ugriZYJHKs_cat_fitsThe Kilo-Degree Survey 10-band ugri1i2ZYJHKs source catalogue5138812117
" - ], - "text/plain": [ - "\n", - "collection instrument ... version number_rows\n", - " object object ... int32 int64 \n", - "---------- ---------------- ... ------- -----------\n", - " KIDS OMEGACAM ... 2 48736590\n", - " KIDS OMEGACAM ... 1 14650348\n", - " KIDS OMEGACAM, VIRCAM ... 4 100350804\n", - " KIDS MULTI ... 5 138812117" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "kids_catalogues = eso.list_catalogues(all_versions=False, collections='KIDS') # only most recent versions of KIDS catalogues\n", - "kids_catalogues['collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" - ] - }, - { - "cell_type": "code", - "execution_count": 25, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=1\n", - "
\n", - "\n", - "\n", - "\n", - "
collectiontitleversiontable_namefilterinstrumenttelescopepublication_datedescriptionnumber_rowsnumber_columnsrel_descr_urlacknowledgmentcat_idmjd_obsmjd_endskysqdegbibliographydocument_idfrom_columntarget_tabletarget_columnschema_namelast_versiontable_RAtable_Dectable_ID
objectobjectint32objectobjectobjectobjectobjectobjectint64int16objectobjectint32float64float64float64objectint32objectobjectobjectobjectboolstr7str8str2
KIDSThe Kilo-Degree Survey 10-band ugri1i2ZYJHKs source catalogue5KiDS_DR5_0_ugriZYJHKs_cat_fitsu_SDSS g_SDSS r_SDSS i_SDSS Z Y J H KsMULTIMULTI2025-03-18T12:33:10ZThe 10-band ugriZYJHKs DR5 source catalogue is based on the KiDS imaging products, incorporating the overlapping VIKING survey. The i-band includes multi-epoch observations (i1i2), covering the full survey footprint. The catalogue offers PSF-homogenised and aperture-matched photometry, along with derived photometric redshifts and stellar mass estimates.138812117365http://www.eso.org/rm/api/v1/public/releaseDescriptions/229Please include the following acknowledgment in any published material that makes use of this data product: Based on data obtained from the ESO Science Archive Facility with DOI: https://doi.org/10.18727/archive/3743355782.34258691.0481331.02024A&A...686A.170W229safcatTrueRAJ2000DECJ2000ID
" - ], - "text/plain": [ - "\n", - "collection ... table_ID\n", - " object ... str2 \n", - "---------- ... --------\n", - " KIDS ... ID" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "eso.list_catalogues(tables=\"KiDS_DR5_0_ugriZYJHKs_cat_fits\")" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=5\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
collectioninstrumenttable_nametitleversionnumber_rows
objectobjectobjectobjectint32int64
KIDSOMEGACAMKiDS_DR3_0_ugri_src_fits_V2The Kilo-Degree Survey248736590
KIDSOMEGACAMKiDS_DR3_1_ugri_shear_fits_V1The Kilo-Degree Survey: Weak lensing shear mesurements114650348
KIDSOMEGACAMKiDS_DR4_0_ugriZYJHKs_cat_fits_V3The Kilo-Degree Survey 9-band ugriZYJHKs source catalogue3100350871
KIDSOMEGACAM, VIRCAMKiDS_DR4_1_ugriZYJHKs_cat_fitsThe Kilo-Degree Survey 9-band ugriZYJHKs source catalogue4100350804
KIDSMULTIKiDS_DR5_0_ugriZYJHKs_cat_fitsThe Kilo-Degree Survey 10-band ugri1i2ZYJHKs source catalogue5138812117
" - ], - "text/plain": [ - "\n", - "collection instrument ... version number_rows\n", - " object object ... int32 int64 \n", - "---------- ---------------- ... ------- -----------\n", - " KIDS OMEGACAM ... 2 48736590\n", - " KIDS OMEGACAM ... 1 14650348\n", - " KIDS OMEGACAM ... 3 100350871\n", - " KIDS OMEGACAM, VIRCAM ... 4 100350804\n", - " KIDS MULTI ... 5 138812117" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "kids_catalogues = eso.list_catalogues(all_versions=True, collections='KIDS') # get all versions of KIDS catalogues\n", - "kids_catalogues['collection', 'instrument', 'table_name', 'title', 'version', 'number_rows']" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING: MaxResultsWarning: Results truncated to 1000. To retrieve all the records set to None the ROW_LIMIT attribute [astroquery.eso.core]\n" - ] - }, - { - "data": { - "text/html": [ - "
Table length=1000\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
table_namecolumn_nameucddatatypedescriptionunit
objectobjectobjectobjectobjectobject
KiDS_DR3_0_ugri_src_fits_V2IDmeta.id;meta.mainCHARSource identifier
KiDS_DR3_0_ugri_src_fits_V2SCIDmeta.idBIGINTAstro-WISE SourceCollection identifier
KiDS_DR3_0_ugri_src_fits_V2SLIDmeta.idBIGINTAstro-WISE SourceList identifier
KiDS_DR3_0_ugri_src_fits_V2SIDmeta.idBIGINTAstro-WISE Source identifier
KiDS_DR3_0_ugri_src_fits_V2RAJ2000pos.eq.ra;meta.mainDOUBLERight ascensiondeg
KiDS_DR3_0_ugri_src_fits_V2DECJ2000pos.eq.dec;meta.mainDOUBLEDeclinationdeg
KiDS_DR3_0_ugri_src_fits_V2SG2DPHOTsrc.class.starGalaxyBIGINTStar/galaxy separation
KiDS_DR3_0_ugri_src_fits_V2Aphys.angSize.smajAxisDOUBLELinear semi major axispixel
KiDS_DR3_0_ugri_src_fits_V2Bphys.angSize.sminAxisDOUBLELinear semi minor axispixel
KiDS_DR3_0_ugri_src_fits_V2CLASS_STARsrc.class.starGalaxyREALSExtractor star/galaxy classifier
..................
KiDS_DR4_1_ugriZYJHKs_cat_fitsFLUXERR_ISOstat.error;phot.flux;em.opt.RREALError on FLUX_ISO (counts)count
KiDS_DR4_1_ugriZYJHKs_cat_fitsMAG_ISOCORphot.mag;em.opt.RREALr-band Corrected Isophotal Magnitude (mag)mag
KiDS_DR4_1_ugriZYJHKs_cat_fitsMAGERR_ISOCORstat.error;phot.mag;em.opt.RREALError on MAG_ISOCOR (mag)mag
KiDS_DR4_1_ugriZYJHKs_cat_fitsFLUX_ISOCORphot.flux;em.opt.RREALr-band Corrected Isophotal Flux (counts)count
KiDS_DR4_1_ugriZYJHKs_cat_fitsFLUXERR_ISOCORstat.error;phot.flux;em.opt.RREALError on FLUX_ISOCOR (counts)count
KiDS_DR4_1_ugriZYJHKs_cat_fitsNIMAFLAGS_ISOmeta.codeSMALLINTNumber of flagged pixels over the isophotal profile
KiDS_DR4_1_ugriZYJHKs_cat_fitsIMAFLAGS_ISOmeta.codeSMALLINTFLAG-image flags ORed over the isophotal profile
KiDS_DR4_1_ugriZYJHKs_cat_fitsXMIN_IMAGEpos.cartesian.xSMALLINTMinimum x-coordinate among detected pixels (pixel)pixel
KiDS_DR4_1_ugriZYJHKs_cat_fitsYMIN_IMAGEpos.cartesian.ySMALLINTMinimum y-coordinate among detected pixels (pixel)pixel
KiDS_DR4_1_ugriZYJHKs_cat_fitsXMAX_IMAGEpos.cartesian.xSMALLINTMaximum x-coordinate among detected pixels (pixel)pixel
" - ], - "text/plain": [ - "\n", - " table_name column_name ... unit \n", - " object object ... object\n", - "------------------------------ -------------- ... ------\n", - " KiDS_DR3_0_ugri_src_fits_V2 ID ... \n", - " KiDS_DR3_0_ugri_src_fits_V2 SCID ... \n", - " KiDS_DR3_0_ugri_src_fits_V2 SLID ... \n", - " KiDS_DR3_0_ugri_src_fits_V2 SID ... \n", - " KiDS_DR3_0_ugri_src_fits_V2 RAJ2000 ... deg\n", - " KiDS_DR3_0_ugri_src_fits_V2 DECJ2000 ... deg\n", - " KiDS_DR3_0_ugri_src_fits_V2 SG2DPHOT ... \n", - " KiDS_DR3_0_ugri_src_fits_V2 A ... pixel\n", - " KiDS_DR3_0_ugri_src_fits_V2 B ... pixel\n", - " KiDS_DR3_0_ugri_src_fits_V2 CLASS_STAR ... \n", - " ... ... ... ...\n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits FLUXERR_ISO ... count\n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits MAG_ISOCOR ... mag\n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits MAGERR_ISOCOR ... mag\n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits FLUX_ISOCOR ... count\n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits FLUXERR_ISOCOR ... count\n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits NIMAFLAGS_ISO ... \n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits IMAFLAGS_ISO ... \n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits XMIN_IMAGE ... pixel\n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits YMIN_IMAGE ... pixel\n", - "KiDS_DR4_1_ugriZYJHKs_cat_fits XMAX_IMAGE ... pixel" - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "kids_columns = eso.list_catalogues_info(collections='KIDS') \n", - "kids_columns" - ] - }, - { - "cell_type": "code", - "execution_count": 33, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "INFO: The query to %s returned %d entries out of %d (with a limit set to maxrec=%s) [astroquery.eso.core]\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING: MaxResultsWarning: Results truncated to 10. To retrieve all the records set to None the ROW_LIMIT attribute [astroquery.eso.core]\n" - ] - } - ], - "source": [ - "table_name = 'KiDS_DR4_1_ugriZYJHKs_cat_fits' \n", - "kids_catalogue = eso.query_catalogues(tables=table_name, maxrec=10, columns=[\"ID\"]) # Get the KIDS catalogues" - ] - }, - { - "cell_type": "code", - "execution_count": 39, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "INFO: The query to %s returned %d entries out of %d (with a limit set to maxrec=%s) [astroquery.eso.core]\n", - "INFO: The query to %s returned %d entries out of %d (with a limit set to maxrec=%s) [astroquery.eso.core]\n" - ] - }, - { - "data": { - "text/plain": [ - "[
\n", - " ID \n", - " object \n", - " -----------------------------\n", - " KiDSDR4 J002018.968-284111.45\n", - " KiDSDR4 J002030.676-284111.97\n", - " KiDSDR4 J002041.061-284112.29\n", - " KiDSDR4 J002338.940-283853.98\n", - " KiDSDR4 J002449.644-284110.99\n", - " KiDSDR4 J002438.745-284110.74\n", - " KiDSDR4 J002353.165-284112.55\n", - " KiDSDR4 J002035.763-284110.75\n", - " KiDSDR4 J002353.979-284112.34\n", - " KiDSDR4 J002024.261-284109.95,\n", - "
\n", - " ID \n", - " object \n", - " -------------------------\n", - " KIDS J085512.03+011900.03\n", - " KIDS J085527.99+011900.13\n", - " KIDS J085448.72+011923.56\n", - " KIDS J085608.94+011900.14\n", - " KIDS J085611.25+011900.23\n", - " KIDS J085441.91+011900.17\n", - " KIDS J085644.13+011900.22\n", - " KIDS J085530.94+011900.47\n", - " KIDS J085511.45+011900.40\n", - " KIDS J085637.87+011901.95]" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "kids_catalogue = eso.query_catalogues(tables=['KiDS_DR4_1_ugriZYJHKs_cat_fits', 'KiDS_DR3_0_ugri_src_fits_V2'], maxrec=10, columns=[\"ID\"]) # Get the KIDS catalogues\n", - "kids_catalogue" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=10\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
ID
object
KiDSDR4 J002018.968-284111.45
KiDSDR4 J002030.676-284111.97
KiDSDR4 J002041.061-284112.29
KiDSDR4 J002338.940-283853.98
KiDSDR4 J002449.644-284110.99
KiDSDR4 J002438.745-284110.74
KiDSDR4 J002353.165-284112.55
KiDSDR4 J002035.763-284110.75
KiDSDR4 J002353.979-284112.34
KiDSDR4 J002024.261-284109.95
" - ], - "text/plain": [ - "\n", - " ID \n", - " object \n", - "-----------------------------\n", - "KiDSDR4 J002018.968-284111.45\n", - "KiDSDR4 J002030.676-284111.97\n", - "KiDSDR4 J002041.061-284112.29\n", - "KiDSDR4 J002338.940-283853.98\n", - "KiDSDR4 J002449.644-284110.99\n", - "KiDSDR4 J002438.745-284110.74\n", - "KiDSDR4 J002353.165-284112.55\n", - "KiDSDR4 J002035.763-284110.75\n", - "KiDSDR4 J002353.979-284112.34\n", - "KiDSDR4 J002024.261-284109.95" - ] - }, - "execution_count": 34, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "kids_catalogue" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "eso." - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "astroquery_testing", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.25" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 9e883d306b721063ffa66e5fc9d79026601bd6f9 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:31:47 +0100 Subject: [PATCH 09/30] updated tests -- didn't check! --- astroquery/eso/tests/test_eso_catalogues.py | 132 ++++++++------------ 1 file changed, 54 insertions(+), 78 deletions(-) diff --git a/astroquery/eso/tests/test_eso_catalogues.py b/astroquery/eso/tests/test_eso_catalogues.py index ce49b64bba..51e82a0d1f 100644 --- a/astroquery/eso/tests/test_eso_catalogues.py +++ b/astroquery/eso/tests/test_eso_catalogues.py @@ -7,122 +7,98 @@ European Southern Observatory (ESO) """ +import pytest from astropy.table import Table from ...eso import Eso CATALOGUE_TABLE_NAME = "KiDS_DR4_1_ugriZYJHKs_cat_fits" +CATALOGUE_TABLE_FULL = f"safcat.{CATALOGUE_TABLE_NAME}" def _catalogue_metadata_table(): return Table({ - "collection": ["KIDS"], - "title": ["KiDS DR4"], - "version": ["1.0"], - "table_name": [CATALOGUE_TABLE_NAME], - }) - - -def _catalogue_columns_table(): - return Table({ - "table_name": [CATALOGUE_TABLE_NAME, CATALOGUE_TABLE_NAME, CATALOGUE_TABLE_NAME], - "column_name": ["ra", "dec", "source_id"], - "ucd": ["pos.eq.ra;meta.main", "pos.eq.dec;meta.main", "meta.id;meta.main"], - "datatype": ["double", "double", "char"], - "description": ["", "", ""], - "unit": ["deg", "deg", ""], + "table_name": [CATALOGUE_TABLE_FULL], }) def monkey_catalogue_tap(query, **kwargs): _ = kwargs - if "FROM TAP_SCHEMA.tables AS ref" in query: + if "tap_schema.tables" in query.lower(): return _catalogue_metadata_table() - if "FROM TAP_SCHEMA.columns" in query: - return _catalogue_columns_table() raise AssertionError(f"Unexpected catalogue query: {query}") def test_list_catalogues_returns_table(monkeypatch): # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html eso = Eso() - monkeypatch.setattr(eso, "_run_catalogue_tap_query", monkey_catalogue_tap) + monkeypatch.setattr(eso, "query_tap", monkey_catalogue_tap) result = eso.list_catalogues() - assert isinstance(result, Table) + assert isinstance(result, list) assert len(result) > 0 - assert "table_name" in result.colnames - assert "table_RA" in result.colnames - assert result["table_name"][0] == CATALOGUE_TABLE_NAME + assert all(isinstance(value, str) for value in result) + assert CATALOGUE_TABLE_NAME in result -def test_list_catalogues_info_returns_table(monkeypatch): +def test_query_catalogues_builds_expected_adql_with_columns_and_filters(monkeypatch): # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html eso = Eso() - monkeypatch.setattr(eso, "_run_catalogue_tap_query", monkey_catalogue_tap) - result = eso.list_catalogues_info(collections="KIDS") + monkeypatch.setattr(eso, "list_catalogues", lambda *args, **kwargs: [CATALOGUE_TABLE_NAME]) - assert isinstance(result, Table) - assert len(result) > 0 - assert {"table_name", "column_name", "ucd", "datatype", "description", "unit"}.issubset( - result.colnames + query = eso.query_catalogue( + catalogue=CATALOGUE_TABLE_NAME, + columns=["colA", "colB"], + column_filters={"colC": "> 0", "colD": "foo"}, + get_query_payload=True, ) + assert f"from {CATALOGUE_TABLE_FULL}" in query + assert "select colA, colB" in query + assert "colC > 0" in query + assert "colD = 'foo'" in query -def test_query_catalogues_builds_expected_adql_with_columns_and_filters(monkeypatch): + +def test_query_catalogues_unknown_collection_raises(monkeypatch): # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html eso = Eso() - captured = {} - - def mock_list_catalogues(*args, **kwargs): - _ = args, kwargs - return Table({ - "table_name": [CATALOGUE_TABLE_NAME], - "number_rows": [10], - }) - - def mock_list_catalogues_info(*args, **kwargs): - _ = args, kwargs - return Table({ - "table_name": [CATALOGUE_TABLE_NAME, CATALOGUE_TABLE_NAME], - "column_name": ["colA", "colB"], - "ucd": ["", ""], - }) - - def mock_run_catalogue_query(query, maxrec=None, authenticated=False): - captured["query"] = query - captured["maxrec"] = maxrec - captured["authenticated"] = authenticated - return Table({"colA": [1], "colB": [2]}) - - monkeypatch.setattr(eso, "list_catalogues", mock_list_catalogues) - monkeypatch.setattr(eso, "list_catalogues_info", mock_list_catalogues_info) - monkeypatch.setattr(eso, "_run_catalogue_tap_query", mock_run_catalogue_query) - - result = eso.query_catalogues( - tables=CATALOGUE_TABLE_NAME, - columns=["colA", "colB"], - conditions_dict={"colC": "> 0", "colD": "foo"}, - maxrec=5, - ) - assert isinstance(result, Table) - assert f"FROM {CATALOGUE_TABLE_NAME}" in captured["query"] - assert "SELECT colA, colB" in captured["query"] - assert "colC > 0" in captured["query"] - assert "colD = 'foo'" in captured["query"] - assert captured["maxrec"] == 5 + monkeypatch.setattr(eso, "list_catalogues", lambda *args, **kwargs: [CATALOGUE_TABLE_NAME]) + with pytest.raises(ValueError): + eso.query_catalogue(catalogue="NO_SUCH_COLLECTION") -def test_query_catalogues_unknown_collection_returns_none(monkeypatch): - # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html + +def test_query_catalogues_help_returns_table(monkeypatch): eso = Eso() + monkeypatch.setattr(eso, "list_catalogues", lambda *args, **kwargs: [CATALOGUE_TABLE_NAME]) + + columns = Table({ + "column_name": ["col_ra", "col_dec"], + "datatype": ["double", "double"], + "unit": ["deg", "deg"], + "ucd": ["pos.eq.ra;meta.main", "pos.eq.dec;meta.main"], + }) + monkeypatch.setattr(eso, "_columns_table", lambda *args, **kwargs: columns) + monkeypatch.setattr(eso, "query_tap", lambda *args, **kwargs: Table({"count": [1]})) - def mock_list_catalogues(*args, **kwargs): - _ = args, kwargs - return Table() + result = eso.query_catalogue(catalogue=CATALOGUE_TABLE_NAME, help=True) - monkeypatch.setattr(eso, "list_catalogues", mock_list_catalogues) - result = eso.query_catalogues(collections="NO_SUCH_COLLECTION") + assert isinstance(result, Table) + assert "column_name" in result.colnames + + +def test_query_catalogues_cone_uses_ucd_columns(monkeypatch): + eso = Eso() + monkeypatch.setattr(eso, "list_catalogues", lambda *args, **kwargs: [CATALOGUE_TABLE_NAME]) + monkeypatch.setattr(eso, "_catalogue_radec_columns", lambda *args, **kwargs: ("col_ra", "col_dec")) + + query = eso.query_catalogue( + catalogue=CATALOGUE_TABLE_NAME, + cone_ra=41.2863, + cone_dec=-55.7406, + cone_radius=0.04, + get_query_payload=True, + ) - assert result is None + assert "CONTAINS(point('', col_ra, col_dec), circle('', 41.2863, -55.7406, 0.04)) = 1" in query From 5745b59efec1b1f8c6dcf787abbad24227dee524 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Fri, 23 Jan 2026 08:29:25 +0100 Subject: [PATCH 10/30] removed RA/Dec query functionality --- astroquery/eso/core.py | 83 ++++++++++-------------------------------- 1 file changed, 20 insertions(+), 63 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 0d2836f010..cc74b2b9a0 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -19,6 +19,7 @@ import time import warnings import xml.etree.ElementTree as ET +from contextlib import contextmanager from typing import List, Optional, Tuple, Dict, Set, Union import astropy.utils.data @@ -143,6 +144,18 @@ def ROW_LIMIT(self, value): self._ROW_LIMIT = mr + @contextmanager + def _temporary_row_limit(self, row_limit: Optional[int]): + if row_limit is None: + yield + return + tmpvar = self.ROW_LIMIT + try: + self.ROW_LIMIT = row_limit + yield + finally: + self.ROW_LIMIT = tmpvar + def _tap_url(self) -> str: url = conf.tap_url return url @@ -415,8 +428,7 @@ def _catalogue_radec_columns(self, table_name: str, *, which_tap: str = "tap_cat return ra_col, dec_col @unlimited_maxrec - def _list_column(self, table_name: str, *, which_tap: str = "tap_obs", - return_table: bool = False) -> Optional[Table]: + def _list_column(self, table_name: str, *, which_tap: str = "tap_obs") -> Optional[Table]: """ Prints the columns contained in a given table. Returns an astropy table when return_table is True. @@ -431,10 +443,8 @@ def _list_column(self, table_name: str, *, which_tap: str = "tap_obs", astropy.conf.set_temp( "max_width", sys.maxsize)): log.info( - # f"\nColumns present in the table {table_name}:\n{available_cols}\n" + 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") - if return_table: - return available_cols @unlimited_maxrec @deprecated_renamed_argument('cache', None, since='0.4.12') @@ -474,30 +484,6 @@ def list_catalogues(self, all_versions: bool = False, cache: bool = True) -> Lis res = self.query_tap(query_str, which_tap="tap_cat") return list(res["table_name"]) - def _query_on_allowed_values( - self, - user_params: _UserParams, - query_func=None, - ) -> Union[Table, int, str, None]: - if user_params.print_help: - return self._list_column(user_params.table_name, - which_tap=user_params.which_tap, - return_table=True) - - _raise_if_has_deprecated_keys(user_params.column_filters) - - raise_if_coords_not_valid(user_params.cone_ra, user_params.cone_dec, user_params.cone_radius) - - query = _build_adql_string(user_params) - - if user_params.get_query_payload: - return query - - if query_func is None: - query_func = self.query_tap - ret_table = query_func(query=query, authenticated=user_params.authenticated) - return list(ret_table[0].values())[0] if user_params.count_only else ret_table - @deprecated_renamed_argument(('open_form', 'cache'), (None, None), since=['0.4.12', '0.4.12']) def query_surveys( @@ -1154,7 +1140,7 @@ def query_catalogue( help: bool = False, authenticated: bool = False, open_form: bool = False, cache: bool = False, - maxrec: Optional[int] = None, + ROW_LIMIT: Optional[int] = None, ) -> Union[Table, int, str]: """ Query catalogue data contained in the ESO archive. @@ -1197,8 +1183,8 @@ def query_catalogue( **Deprecated** - unused. cache : bool, optional **Deprecated** - unused. - maxrec : int, optional - Overrides the configured row limit for this query only. + ROW_LIMIT : int, optional + Overrides the configured (eso.ROW_LIMIT) row limit for this query only. Returns ------- @@ -1214,34 +1200,9 @@ def query_catalogue( column_filters = column_filters if column_filters else {} schema = _EsoNames.catalogue_schema - if catalogue.lower().startswith(f"{schema}."): - catalogue = catalogue.split(".", 1)[1] - - catalogue_names = self.list_catalogues(all_versions=True) - catalogue_map = {name.lower(): name for name in catalogue_names} - lookup_key = catalogue.lower() - if lookup_key not in catalogue_map: - raise ValueError( - f"Unknown catalogue '{catalogue}'. Use list_catalogues() to see available catalogues." - ) - catalogue = catalogue_map[lookup_key] table_name = f"{schema}.{catalogue}" - row_limit = None - if maxrec is not None: - row_limit = self.ROW_LIMIT - self.ROW_LIMIT = maxrec - - try: - if any(v is not None for v in (cone_ra, cone_dec, cone_radius)): - raise_if_coords_not_valid(cone_ra, cone_dec, cone_radius) - ra_col, dec_col = self._catalogue_radec_columns(table_name, which_tap="tap_cat") - cone_constraint = ( - "CONTAINS(point('', " - f"{ra_col}, {dec_col}), circle('', {cone_ra}, {cone_dec}, {cone_radius}))" - ) - column_filters[cone_constraint] = "= 1" - + with self._temporary_row_limit(ROW_LIMIT): user_params = _UserParams(table_name=table_name, column_name=None, allowed_values=None, @@ -1258,11 +1219,7 @@ def query_catalogue( which_tap="tap_cat" ) query_func = functools.partial(self.query_tap, which_tap="tap_cat") - return self._query_on_allowed_values(user_params, query_func=query_func) - - finally: - if row_limit is not None: - self.ROW_LIMIT = row_limit + return self._query_on_allowed_values(user_params, query_func=query_func) Eso = EsoClass() From b282ba035981affedb20005c2e4293a9defa89b2 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:31:53 +0100 Subject: [PATCH 11/30] remove RA/Dec column resolution method from EsoClass --- astroquery/eso/core.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index cc74b2b9a0..4a8f1147f0 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -404,34 +404,10 @@ def _columns_table(self, table_name: str, *, which_tap: str = "tap_obs") -> Tabl f"where table_name = '{table_name.removeprefix(schema+'.')}'") return self.query_tap(help_query, which_tap=which_tap) - def _catalogue_radec_columns(self, table_name: str, *, which_tap: str = "tap_cat") -> Tuple[str, str]: - columns = self._columns_table(table_name, which_tap=which_tap) - ra_col = None - dec_col = None - for row in columns: - ucd = row["ucd"] - try: - ucd_norm = ucd.strip().lower() - except AttributeError: - continue - if ucd_norm == "pos.eq.ra;meta.main": - ra_col = row["column_name"] - elif ucd_norm == "pos.eq.dec;meta.main": - dec_col = row["column_name"] - if ra_col and dec_col: - break - if not ra_col or not dec_col: - raise ValueError( - "Unable to resolve RA/Dec columns from UCD metadata. " - "Expected UCDs 'pos.eq.ra;meta.main' and 'pos.eq.dec;meta.main'." - ) - return ra_col, dec_col - @unlimited_maxrec def _list_column(self, table_name: str, *, which_tap: str = "tap_obs") -> Optional[Table]: """ Prints the columns contained in a given table. - Returns an astropy table when return_table is True. """ available_cols = self._columns_table(table_name, which_tap=which_tap) From f992b5e26beb3a32077d6bd64f9a7c0e46c1c795 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:36:29 +0100 Subject: [PATCH 12/30] moved query_on_allowed_values --- astroquery/eso/core.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 4a8f1147f0..3132d0fdea 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -460,6 +460,30 @@ def list_catalogues(self, all_versions: bool = False, cache: bool = True) -> Lis res = self.query_tap(query_str, which_tap="tap_cat") return list(res["table_name"]) + def _query_on_allowed_values( + self, + user_params: _UserParams, + query_func=None, + ) -> Union[Table, int, str, None]: + if user_params.print_help: + return self._list_column(user_params.table_name, + which_tap=user_params.which_tap, + return_table=True) + + _raise_if_has_deprecated_keys(user_params.column_filters) + + raise_if_coords_not_valid(user_params.cone_ra, user_params.cone_dec, user_params.cone_radius) + + query = _build_adql_string(user_params) + + if user_params.get_query_payload: + return query + + if query_func is None: + query_func = self.query_tap + ret_table = query_func(query=query, authenticated=user_params.authenticated) + return list(ret_table[0].values())[0] if user_params.count_only else ret_table + @deprecated_renamed_argument(('open_form', 'cache'), (None, None), since=['0.4.12', '0.4.12']) def query_surveys( From a98016daebb59e15d2c5ea97bc683ce0e5b53477 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:46:11 +0100 Subject: [PATCH 13/30] update documentation for cone search --- astroquery/eso/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 3132d0fdea..790a795d82 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -467,8 +467,7 @@ def _query_on_allowed_values( ) -> Union[Table, int, str, None]: if user_params.print_help: return self._list_column(user_params.table_name, - which_tap=user_params.which_tap, - return_table=True) + which_tap=user_params.which_tap) _raise_if_has_deprecated_keys(user_params.column_filters) @@ -1151,10 +1150,13 @@ def query_catalogue( Name of the catalogue to query. Should be ONLY ONE of the names returned by :meth:`~astroquery.eso.EsoClass.list_catalogues`. cone_ra : float, optional + Not yet implemented. Cone Search Center - Right Ascension in degrees. cone_dec : float, optional + Not yet implemented. Cone Search Center - Declination in degrees. cone_radius : float, optional + Not yet implemented. 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, From 06ec6918e21017caae3c6f2d33900a5da1f0ddc5 Mon Sep 17 00:00:00 2001 From: "Juan M. Carmona Loaiza" Date: Fri, 12 Sep 2025 09:42:38 +0200 Subject: [PATCH 14/30] Setup auto sync fork for main branch --- .github/workflows/sync_fork.yml | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/sync_fork.yml diff --git a/.github/workflows/sync_fork.yml b/.github/workflows/sync_fork.yml new file mode 100644 index 0000000000..18abb115e6 --- /dev/null +++ b/.github/workflows/sync_fork.yml @@ -0,0 +1,45 @@ +name: Sync Fork +run-name: Sync Fork +on: + schedule: + - cron: '58 23 * * *' # run every day - two minutes to midnight + workflow_dispatch: # to enable manual runs of the workflow + +jobs: + Get-Timestamp: + runs-on: ubuntu-latest + steps: + - run: date + + Sync-With-Upstream: + runs-on: ubuntu-latest + steps: + - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub" + - run: echo "Running on branch ${{ github.ref }}, repository ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: echo "The ${{ github.repository }} repository has been cloned to the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - name: Sync repository with upstream + run: | + cd ${{ github.workspace }} + git config --global user.email "jcarmona@eso.org" + git config --global user.name "Nightly Sync" + git remote add upstream https://github.com/astropy/astroquery.git + git remote -v + git fetch upstream main + echo "--- upstream log: " + git log upstream/main --oneline -10 + echo "--- current branch log before merge: " + git log --oneline -10 + git merge upstream/main + echo "--- current branch log after merge: " + git log --oneline -10 + echo "--- push force with lease" + git push --force-with-lease + - run: echo "The job finished with status ${{ job.status }}." From 1a6e9278574132267c7dc3a21e13dab802952ac5 Mon Sep 17 00:00:00 2001 From: "Juan M. Carmona Loaiza" Date: Thu, 11 Sep 2025 16:19:21 +0200 Subject: [PATCH 15/30] Setup custom CI/CD for ESO submodule --- .github/workflows/ci_devtests.yml | 2 ++ .github/workflows/ci_tests.yml | 2 ++ setup.cfg | 4 +++- tox.ini | 6 +++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_devtests.yml b/.github/workflows/ci_devtests.yml index e0f73c1310..7f0b61b132 100644 --- a/.github/workflows/ci_devtests.yml +++ b/.github/workflows/ci_devtests.yml @@ -5,11 +5,13 @@ on: push: branches: - main + - develop tags: - '*' pull_request: branches: - main + - develop schedule: # run every Monday at 5am UTC - cron: '0 5 * * 1' diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 9786f85fcf..278b38491e 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -5,11 +5,13 @@ on: push: branches: - main + - develop tags: - '*' pull_request: branches: - main + - develop schedule: # run every Monday at 5am UTC - cron: '0 5 * * 1' diff --git a/setup.cfg b/setup.cfg index 5ccbb7dd9b..7b8d7d633e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,9 @@ show-response = 1 [tool:pytest] minversion = 7.4 norecursedirs = build docs/_build astroquery/irsa astroquery/nasa_exoplanet_archive astroquery/ned astroquery/ibe astroquery/irsa_dust astroquery/cds astroquery/sha astroquery/dace -testpaths = astroquery docs +testpaths = + docs/eso + astroquery/eso doctest_plus = enabled astropy_header = true text_file_format = rst diff --git a/tox.ini b/tox.ini index 53a67b9341..1f7fcceef4 100644 --- a/tox.ini +++ b/tox.ini @@ -66,12 +66,12 @@ commands = devdeps: pip install -U --pre --no-deps --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy python -m pip freeze - !cov: pytest --pyargs astroquery {toxinidir}/docs {env:PYTEST_ARGS} {posargs} - cov: pytest --pyargs astroquery {toxinidir}/docs --cov astroquery --cov-config={toxinidir}/setup.cfg {env:PYTEST_ARGS} {posargs} + !cov: pytest --pyargs astroquery.eso {toxinidir}/docs/eso {env:PYTEST_ARGS} {posargs} + cov: pytest --pyargs astroquery.eso {toxinidir}/docs/eso --cov astroquery.eso --cov-config={toxinidir}/setup.cfg {env:PYTEST_ARGS} {posargs} # For remote tests, we re-run the failures to filter out at least some of the flaky ones. # We use a second pytest run with --last-failed as opposed to --rerun in order to rerun the # failed ones at the end rather than right away. - online: pytest --pyargs astroquery {toxinidir}/docs {env:PYTEST_ARGS_2} {posargs} + online: pytest --pyargs astroquery.eso {toxinidir}/docs/eso {env:PYTEST_ARGS_2} {posargs} cov: coverage xml -o {toxinidir}/coverage.xml pip_pre = From 08c1a4c9a45719ad42132cef7ac22699cb409a9b Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:21:20 +0100 Subject: [PATCH 16/30] updated a number of PR comments --- astroquery/eso/__init__.py | 4 ++-- astroquery/eso/core.py | 10 +++------- astroquery/eso/tests/test_eso.py | 2 +- astroquery/eso/utils.py | 1 - 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/astroquery/eso/__init__.py b/astroquery/eso/__init__.py index 9b9b84a0e8..26eee10300 100644 --- a/astroquery/eso/__init__.py +++ b/astroquery/eso/__init__.py @@ -16,9 +16,9 @@ class Conf(_config.ConfigNamespace): username = _config.ConfigItem( "", 'Optional default username for ESO archive.') - tap_url = _config.ConfigItem( + tap_obs_url = _config.ConfigItem( "https://archive.eso.org/tap_obs", - 'URL for TAP queries.') + 'URL for TAP observation queries.') tap_cat_url = _config.ConfigItem( "https://archive.eso.org/tap_cat", 'URL for TAP catalogue queries.') diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 790a795d82..16663bc667 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -157,7 +157,7 @@ def _temporary_row_limit(self, row_limit: Optional[int]): self.ROW_LIMIT = tmpvar def _tap_url(self) -> str: - url = conf.tap_url + url = conf.tap_obs_url return url def _authenticate(self, *, username: str, password: str) -> bool: @@ -269,11 +269,7 @@ def message(query_str): row_limit_plus_one = self.ROW_LIMIT if self.ROW_LIMIT < sys.maxsize: row_limit_plus_one = self.ROW_LIMIT + 1 - table_with_an_extra_row = tap.search(query=query_str, - maxrec=row_limit_plus_one).to_table() - else: - table_with_an_extra_row = tap.search(query=query_str).to_table() - self._maybe_warn_about_table_length(table_with_an_extra_row, row_limit_plus_one) + table_with_an_extra_row = tap.search(query=query_str, maxrec=row_limit_plus_one).to_table() except DALQueryError: log.error(message(query_str)) except DALFormatError as e: @@ -554,7 +550,7 @@ def query_surveys( would be issued to the TAP service given the specified arguments. """ _ = open_form, cache # make explicit that we are aware these arguments are unused - column_filters = dict(column_filters) if column_filters else {} + column_filters = column_filters if column_filters else {} user_params = _UserParams(table_name=_EsoNames.phase3_table, column_name=_EsoNames.phase3_surveys_column, allowed_values=surveys, diff --git a/astroquery/eso/tests/test_eso.py b/astroquery/eso/tests/test_eso.py index 758623e7a6..76f0e79f2d 100644 --- a/astroquery/eso/tests/test_eso.py +++ b/astroquery/eso/tests/test_eso.py @@ -257,7 +257,7 @@ def test_calselector_multipart(monkeypatch, tmp_path): assert datasets[0] not in result and datasets[1] not in result -def test_tap_url(): +def test_tap_obs_url(): prod_url = "https://archive.eso.org/tap_obs" eso_instance = Eso() assert eso_instance._tap_url() == prod_url diff --git a/astroquery/eso/utils.py b/astroquery/eso/utils.py index fe0f775dfc..8b977868ab 100644 --- a/astroquery/eso/utils.py +++ b/astroquery/eso/utils.py @@ -4,7 +4,6 @@ from dataclasses import dataclass from typing import Dict, List, Optional, Union -import numpy as np from astropy.table import Table DEFAULT_LEAD_COLS_RAW = ['object', 'ra', 'dec', 'dp_id', 'date_obs', 'prog_id'] From fbaec019b21a19d10f28ee417d524593069c4abd Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:29:08 +0100 Subject: [PATCH 17/30] remove deprecated_renamed_argument --- astroquery/eso/core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 16663bc667..e3b225e4fe 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -419,7 +419,6 @@ def _list_column(self, table_name: str, *, which_tap: str = "tap_obs") -> Option f"\nNumber of records present in the table {table_name}:\n{num_records}\n") @unlimited_maxrec - @deprecated_renamed_argument('cache', None, since='0.4.12') def list_catalogues(self, all_versions: bool = False, cache: bool = True) -> List[str]: """ List available catalogue tables offered by the ESO archive. From 0eff8a8715d8228356a70ec712a4b40072cd96fc Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:29:46 +0100 Subject: [PATCH 18/30] remove deprecated_renamed_argument --- astroquery/eso/core.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index e3b225e4fe..23c2e99086 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -478,8 +478,6 @@ def _query_on_allowed_values( ret_table = query_func(query=query, authenticated=user_params.authenticated) return list(ret_table[0].values())[0] if user_params.count_only else ret_table - @deprecated_renamed_argument(('open_form', 'cache'), (None, None), - since=['0.4.12', '0.4.12']) def query_surveys( self, surveys: Union[List[str], str] = None, *, From 3654699caf0df70beff9e989ab8ab91e744fc248 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:33:16 +0100 Subject: [PATCH 19/30] updated a number of minor comments --- astroquery/eso/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astroquery/eso/utils.py b/astroquery/eso/utils.py index 8b977868ab..374883e7af 100644 --- a/astroquery/eso/utils.py +++ b/astroquery/eso/utils.py @@ -11,7 +11,7 @@ @dataclass -class _UserParams: +class _UserParams: """ Parameters set by the user """ From 0e2564dc0193b2f093a8fd0c537b87a6b23b1b84 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:59:17 +0100 Subject: [PATCH 20/30] remove deprecated_renamed_argument --- astroquery/eso/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 23c2e99086..27300cb301 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -477,7 +477,9 @@ def _query_on_allowed_values( query_func = self.query_tap ret_table = query_func(query=query, authenticated=user_params.authenticated) return list(ret_table[0].values())[0] if user_params.count_only else ret_table - + + @deprecated_renamed_argument(('open_form', 'cache'), (None, None), + since=['0.4.12', '0.4.12']) def query_surveys( self, surveys: Union[List[str], str] = None, *, @@ -1118,8 +1120,6 @@ def query_apex_quicklooks(self, authenticated=authenticated) return self._query_on_allowed_values(user_params) - @deprecated_renamed_argument(('open_form', 'cache'), (None, None), - since=['0.4.12', '0.4.12']) def query_catalogue( self, catalogue: str, *, From 6c582f913abcf8005636104dbe71a0acac5623e0 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:35:11 +0100 Subject: [PATCH 21/30] update tap_url function --- astroquery/eso/core.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 27300cb301..b19b71f252 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -156,8 +156,14 @@ def _temporary_row_limit(self, row_limit: Optional[int]): finally: self.ROW_LIMIT = tmpvar - def _tap_url(self) -> str: - url = conf.tap_obs_url + def _tap_url(self, which_tap: str = "tap_obs") -> str: + which_tap = which_tap.lower() + if which_tap == "tap_obs": + url = conf.tap_obs_url + elif which_tap == "tap_cat": + url = conf.tap_cat_url + else: + raise ValueError("which_tap must be 'tap_obs' or 'tap_cat'.") return url def _authenticate(self, *, username: str, password: str) -> bool: @@ -280,9 +286,6 @@ def message(query_str): return table_with_an_extra_row[:self.ROW_LIMIT] def tap(self, authenticated: bool = False, *, which_tap: str = "tap_obs") -> TAPService: - which_tap = which_tap.lower() - if which_tap not in ("tap_obs", "tap_cat"): - raise ValueError("which_tap must be 'tap_obs' or 'tap_cat'.") if authenticated and not self.authenticated(): raise LoginError( @@ -294,7 +297,7 @@ def tap(self, authenticated: bool = False, *, which_tap: str = "tap_obs") -> TAP ".login(username=" ) - tap_url = self._tap_url() if which_tap == "tap_obs" else conf.tap_cat_url + tap_url = self._tap_url(which_tap) log.debug(f"Querying from {tap_url}") if authenticated: h = self._get_auth_header() From d296b3859b5c906919d2d2b0d146004821a00c82 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:39:14 +0100 Subject: [PATCH 22/30] some putbacks --- astroquery/eso/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index b19b71f252..167861312b 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -275,7 +275,9 @@ def message(query_str): row_limit_plus_one = self.ROW_LIMIT if self.ROW_LIMIT < sys.maxsize: row_limit_plus_one = self.ROW_LIMIT + 1 + table_with_an_extra_row = tap.search(query=query_str, maxrec=row_limit_plus_one).to_table() + self._maybe_warn_about_table_length(table_with_an_extra_row, row_limit_plus_one) except DALQueryError: log.error(message(query_str)) except DALFormatError as e: From d60edc1cabd48bd96d1155c64c4f01882de59320 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:39:54 +0100 Subject: [PATCH 23/30] putback --- astroquery/eso/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 167861312b..b529351287 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -276,8 +276,8 @@ def message(query_str): if self.ROW_LIMIT < sys.maxsize: row_limit_plus_one = self.ROW_LIMIT + 1 - table_with_an_extra_row = tap.search(query=query_str, maxrec=row_limit_plus_one).to_table() - self._maybe_warn_about_table_length(table_with_an_extra_row, row_limit_plus_one) + table_with_an_extra_row = tap.search(query=query_str, maxrec=row_limit_plus_one).to_table() + self._maybe_warn_about_table_length(table_with_an_extra_row, row_limit_plus_one) except DALQueryError: log.error(message(query_str)) except DALFormatError as e: From 1ca393581dbad1ab2bcd047f96feeba1ec4fb01a Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:57:20 +0100 Subject: [PATCH 24/30] minor refactor --- astroquery/eso/core.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index b529351287..decbbc6222 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -157,7 +157,6 @@ def _temporary_row_limit(self, row_limit: Optional[int]): self.ROW_LIMIT = tmpvar def _tap_url(self, which_tap: str = "tap_obs") -> str: - which_tap = which_tap.lower() if which_tap == "tap_obs": url = conf.tap_obs_url elif which_tap == "tap_cat": @@ -299,14 +298,12 @@ def tap(self, authenticated: bool = False, *, which_tap: str = "tap_obs") -> TAP ".login(username=" ) - tap_url = self._tap_url(which_tap) - log.debug(f"Querying from {tap_url}") if authenticated: h = self._get_auth_header() self._session.headers = {**self._session.headers, **h} - tap_service = TAPService(tap_url, session=self._session) + tap_service = TAPService(self._tap_url(which_tap), session=self._session) else: - tap_service = TAPService(tap_url) + tap_service = TAPService(self._tap_url(which_tap)) return tap_service @@ -463,7 +460,7 @@ def list_catalogues(self, all_versions: bool = False, cache: bool = True) -> Lis def _query_on_allowed_values( self, user_params: _UserParams, - query_func=None, + which_tap="tap_obs", ) -> Union[Table, int, str, None]: if user_params.print_help: return self._list_column(user_params.table_name, @@ -473,14 +470,12 @@ def _query_on_allowed_values( raise_if_coords_not_valid(user_params.cone_ra, user_params.cone_dec, user_params.cone_radius) - query = _build_adql_string(user_params) + query_str = _build_adql_string(user_params) if user_params.get_query_payload: - return query + return query_str - if query_func is None: - query_func = self.query_tap - ret_table = query_func(query=query, authenticated=user_params.authenticated) + ret_table = self.query_tap(query_str, which_tap=which_tap, authenticated=user_params.authenticated) return list(ret_table[0].values())[0] if user_params.count_only else ret_table @deprecated_renamed_argument(('open_form', 'cache'), (None, None), @@ -569,7 +564,7 @@ def query_surveys( print_help=help, authenticated=authenticated, ) - t = self._query_on_allowed_values(user_params=user_params) + t = self._query_on_allowed_values(user_params) t = _reorder_columns(t, DEFAULT_LEAD_COLS_PHASE3) return t @@ -1203,6 +1198,7 @@ def query_catalogue( table_name = f"{schema}.{catalogue}" with self._temporary_row_limit(ROW_LIMIT): + which_tap = "tap_cat" user_params = _UserParams(table_name=table_name, column_name=None, allowed_values=None, @@ -1216,10 +1212,10 @@ def query_catalogue( get_query_payload=get_query_payload, print_help=help, authenticated=authenticated, - which_tap="tap_cat" + which_tap=which_tap ) - query_func = functools.partial(self.query_tap, which_tap="tap_cat") - return self._query_on_allowed_values(user_params, query_func=query_func) + + return self._query_on_allowed_values(user_params, which_tap=which_tap) Eso = EsoClass() From 0e2d368208a28b5351df9290ee92338623d945b7 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 19:03:55 +0100 Subject: [PATCH 25/30] updated tests --- .../data/query_catalogues_all_versions.csv | 130 +++++++ .../data/query_catalogues_latest_versions.csv | 87 +++++ .../eso/tests/data/query_list_catalogues.csv | 129 +++++++ astroquery/eso/tests/test_eso_catalogues.py | 348 ++++++++++++++---- .../eso/tests/test_eso_catalogues_remote.py | 266 +++++++++++++ astroquery/eso/utils.py | 1 - 6 files changed, 880 insertions(+), 81 deletions(-) create mode 100644 astroquery/eso/tests/data/query_catalogues_all_versions.csv create mode 100644 astroquery/eso/tests/data/query_catalogues_latest_versions.csv create mode 100644 astroquery/eso/tests/data/query_list_catalogues.csv create mode 100644 astroquery/eso/tests/test_eso_catalogues_remote.py diff --git a/astroquery/eso/tests/data/query_catalogues_all_versions.csv b/astroquery/eso/tests/data/query_catalogues_all_versions.csv new file mode 100644 index 0000000000..fb0c7f8fe0 --- /dev/null +++ b/astroquery/eso/tests/data/query_catalogues_all_versions.csv @@ -0,0 +1,130 @@ +,table_name +0,AMBRE_V1 +1,atlas_er3_ugriz_catMetaData_fits_V2 +2,ATLASGAL_V1 +3,COSMOS2015_Laigle_v1_1b_latestV7_fits_V1 +4,EREBOS_cat_fits_V1 +5,EREBOS_RV_cat_fits_V1 +6,GES_iDR4_PIII2016_Catalogue_v3_fits_V2 +7,GOODS_FORS2_V1 +8,GOODS_ISAAC_V1 +9,GOODS_VIMOS_SPEC_V1 +10,HUGS_GOODSS_K_V1 +11,HUGS_UDS_K_V1 +12,HUGS_UDS_Y_V1 +13,KiDS_DR3_0_ugri_src_fits_V2 +14,KiDS_DR3_1_ugri_shear_fits_V1 +15,legac_DR1_fits_V1 +16,legac_DR2_fits_V2 +17,PESSTO_TRAN_CAT_fits_V2 +18,PESSTO_MPHOT_fits_V2 +19,UltraVISTA_V3 +20,VANDELS_META_SPECTRO_fits_V1 +21,VHS_CAT_V2 +22,video_er3_zyjhks_CDFS_catMetaData_fits_V2 +23,video_er3_zyjhks_ES1_catMetaData_fits_V2 +24,video_er3_zyjhks_XMM_catMetaData_fits_V3 +25,viking_er4_zyjj_1j_2hks_catMetaData_fits_V3 +26,VIPERS_SPECTRO_PDR2_ESO_fits_V1 +27,vmc_er4_ksjy_catMetaData_fits_V3 +28,vmc_er4_j_mPhotMetaData_fits_V3 +29,vmc_er4_ks_mPhotMetaData_fits_V3 +30,vmc_er4_y_mPhotMetaData_fits_V3 +31,vmc_er4_yjks_cepheidCatMetaData_fits_V3 +32,vmc_er4_yjks_eclBinCatMetaData_fits_V2 +33,vmc_er4_yjks_psfCatMetaData_fits_V2 +34,vmc_er4_yjks_rrLyrCatMetaData_fits_V1 +35,vphas_er3_ugr_1r_2ihavphas_catMetaData_fits_V3 +36,VVV_CAT_V2 +37,VVV_MPHOT_Ks_V2 +38,VVV_VAR_V2 +39,XQ_100_summary_fits_V1 +40,ZCOSMOS_V2 +41,VANDELS_META_SPECTRO_fits_V2 +42,gcav_rxcj2129_YJKs_cat_fits_V1 +43,gcav_rxcj1515_YJKs_cat_fits_V1 +44,KiDS_DR4_0_ugriZYJHKs_cat_fits_V3 +45,UVISTA_5band_cat_dr4_rc_v2_fits_V3 +46,atlas_er4_ugriz_catMetaData_fits_V3 +47,VVV_VIRAC_PM_V1 +48,NGTS_SOURCE_CATALOGUE_fits_V1 +49,NGTS_LC_CATALOGUE_fits_V1 +50,MW_BULGE_PSFPHOT_V1 +51,VANDELS_spec_redshift_V3 +52,VEXAS_AllWISE_V1 +53,VEXAS_SMW_V1 +54,VEXAS_21_V1 +55,VEXAS_PS1W_V1 +56,VEXAS_XRAY_V1 +57,VEXAS_SPEC_V1 +58,VEXAS_DESW_V1 +59,viking_er5_zyjj_1j_2hks_catMetaData_fits_V4 +60,VHS_CAT_V3 +61,KiDS_DR4_1_ugriZYJHKs_cat_fits +62,vmc_dr5_sourceCat_yjks_V4 +63,vmc_dr5_var_yjKs_V1 +64,vmc_dr5_mPhotY_V4 +65,vmc_dr5_mPhotJ_V4 +66,vmc_dr5_mPhotKs_V4 +67,vmc_dr5_psf_yjks_V3 +68,NGTS_SOURCE_CAT_V2 +69,NGTS_LC_V2 +70,VVV_bandMergedSourceCat_V3 +71,FDS_SourceCatalogue_V1 +72,VANDELS_SPECTRO_V4 +73,VEXAS_DESW_V2 +74,VEXAS_SMW_V2 +75,VEXAS_PSW_V2 +76,VEXAS_SPEC_GOOD_V2 +77,PESSTO_TRAN_CAT_V3 +78,GNS_catalogue_V1 +79,AMBRE_UVES_V1 +80,AMBRE_HARPS_V1 +81,PESSTO_MPHOT_V3 +82,legac_V3 +83,GES_2021_VRAD +84,VIDEO_CAT_DR5 +85,GES_DR5 +86,COSMOS2020_CLASSIC_V2 +87,COSMOS2020_FARMER_V1 +88,vmc_dr6_yjks_varCat_V2 +89,vmc_dr6_yjks_psf_V4 +90,vmc_dr6_ksjy_V5 +91,vmc_dr6_mPhotJ_V5 +92,vmc_dr6_mPhotKs_V5 +93,vmc_dr6_mPhotY_V5 +94,COSMOS2020_FARMER_V2 +95,AMUSED_MAIN_SOURCE_CAT_V1 +96,UVISTA_5band_cat_dr5_rc_v1_fits_V4 +97,GES_DR5_1_V1 +98,HARPS_RVCAT_V1 +99,INSPIRE_V1 +100,UVISTA_5band_cat_dr6_rc_v1_fits_V5 +101,VVVX_VIRAC_V2_SOURCES +102,VVVX_VIRAC_V2_REJECTED_SOURCES +103,VVVX_VIRAC_V2_OBS +104,VVVX_VIRAC_V2_LC +105,VVVX_VIRAC_V2_LC +106,VVVX_VIRAC_V2_REJECTED_LC +107,VVVX_VIRAC_V2_REJECTED_LC +108,KiDS_DR5_0_ugriZYJHKs_cat_fits +109,PHANGS_DR1_NebCat +110,atlas_er5_ugriz +111,vmc_dr7_ksjy_V6 +112,vmc_dr7_mPhotJ_V6 +113,vmc_dr7_mPhotKs_V6 +114,vmc_dr7_mPhotY_V6 +115,vmc_dr7_yjks_rrLy_V2 +116,vmc_dr7_yjks_agbVar_V1 +117,vmc_dr7_yjks_lpvVar_V1 +118,vmc_dr7_yjks_eclBinVar_V3 +119,vmc_dr7_yjks_chephVar_V4 +120,vmc_dr7_yjks_ysoVar_V1 +121,vmc_dr7_yjks_qsos_V1 +122,vmc_dr7_yjks_extYKs_V1 +123,vmc_dr7_yjks_MlClass_V1 +124,vmc_dr7_yjks_extJKs_V1 +125,vmc_dr7_yjks_pm_V1 +126,vmc_dr7_yjks_psfSrc_V5 +127,vmc_dr7_yjks_back_V1 +128,vmc_dr7_yjks_varCat_V3 diff --git a/astroquery/eso/tests/data/query_catalogues_latest_versions.csv b/astroquery/eso/tests/data/query_catalogues_latest_versions.csv new file mode 100644 index 0000000000..a754df1b3e --- /dev/null +++ b/astroquery/eso/tests/data/query_catalogues_latest_versions.csv @@ -0,0 +1,87 @@ +,table_name +0,AMBRE_V1 +1,ATLASGAL_V1 +2,COSMOS2015_Laigle_v1_1b_latestV7_fits_V1 +3,EREBOS_cat_fits_V1 +4,EREBOS_RV_cat_fits_V1 +5,GOODS_FORS2_V1 +6,GOODS_ISAAC_V1 +7,GOODS_VIMOS_SPEC_V1 +8,HUGS_GOODSS_K_V1 +9,HUGS_UDS_K_V1 +10,HUGS_UDS_Y_V1 +11,KiDS_DR3_0_ugri_src_fits_V2 +12,KiDS_DR3_1_ugri_shear_fits_V1 +13,video_er3_zyjhks_CDFS_catMetaData_fits_V2 +14,video_er3_zyjhks_ES1_catMetaData_fits_V2 +15,video_er3_zyjhks_XMM_catMetaData_fits_V3 +16,VIPERS_SPECTRO_PDR2_ESO_fits_V1 +17,vphas_er3_ugr_1r_2ihavphas_catMetaData_fits_V3 +18,VVV_MPHOT_Ks_V2 +19,VVV_VAR_V2 +20,XQ_100_summary_fits_V1 +21,ZCOSMOS_V2 +22,gcav_rxcj2129_YJKs_cat_fits_V1 +23,gcav_rxcj1515_YJKs_cat_fits_V1 +24,VVV_VIRAC_PM_V1 +25,MW_BULGE_PSFPHOT_V1 +26,VANDELS_spec_redshift_V3 +27,VEXAS_AllWISE_V1 +28,VEXAS_21_V1 +29,VEXAS_XRAY_V1 +30,VEXAS_SPEC_V1 +31,viking_er5_zyjj_1j_2hks_catMetaData_fits_V4 +32,VHS_CAT_V3 +33,KiDS_DR4_1_ugriZYJHKs_cat_fits +34,NGTS_SOURCE_CAT_V2 +35,NGTS_LC_V2 +36,VVV_bandMergedSourceCat_V3 +37,FDS_SourceCatalogue_V1 +38,VANDELS_SPECTRO_V4 +39,VEXAS_DESW_V2 +40,VEXAS_SMW_V2 +41,VEXAS_PSW_V2 +42,VEXAS_SPEC_GOOD_V2 +43,PESSTO_TRAN_CAT_V3 +44,GNS_catalogue_V1 +45,AMBRE_UVES_V1 +46,AMBRE_HARPS_V1 +47,PESSTO_MPHOT_V3 +48,legac_V3 +49,GES_2021_VRAD +50,VIDEO_CAT_DR5 +51,COSMOS2020_CLASSIC_V2 +52,COSMOS2020_FARMER_V2 +53,AMUSED_MAIN_SOURCE_CAT_V1 +54,GES_DR5_1_V1 +55,HARPS_RVCAT_V1 +56,INSPIRE_V1 +57,UVISTA_5band_cat_dr6_rc_v1_fits_V5 +58,VVVX_VIRAC_V2_SOURCES +59,VVVX_VIRAC_V2_REJECTED_SOURCES +60,VVVX_VIRAC_V2_OBS +61,VVVX_VIRAC_V2_LC +62,VVVX_VIRAC_V2_LC +63,VVVX_VIRAC_V2_REJECTED_LC +64,VVVX_VIRAC_V2_REJECTED_LC +65,KiDS_DR5_0_ugriZYJHKs_cat_fits +66,PHANGS_DR1_NebCat +67,atlas_er5_ugriz +68,vmc_dr7_ksjy_V6 +69,vmc_dr7_mPhotJ_V6 +70,vmc_dr7_mPhotKs_V6 +71,vmc_dr7_mPhotY_V6 +72,vmc_dr7_yjks_rrLy_V2 +73,vmc_dr7_yjks_agbVar_V1 +74,vmc_dr7_yjks_lpvVar_V1 +75,vmc_dr7_yjks_eclBinVar_V3 +76,vmc_dr7_yjks_chephVar_V4 +77,vmc_dr7_yjks_ysoVar_V1 +78,vmc_dr7_yjks_qsos_V1 +79,vmc_dr7_yjks_extYKs_V1 +80,vmc_dr7_yjks_MlClass_V1 +81,vmc_dr7_yjks_extJKs_V1 +82,vmc_dr7_yjks_pm_V1 +83,vmc_dr7_yjks_psfSrc_V5 +84,vmc_dr7_yjks_back_V1 +85,vmc_dr7_yjks_varCat_V3 diff --git a/astroquery/eso/tests/data/query_list_catalogues.csv b/astroquery/eso/tests/data/query_list_catalogues.csv new file mode 100644 index 0000000000..369a806eba --- /dev/null +++ b/astroquery/eso/tests/data/query_list_catalogues.csv @@ -0,0 +1,129 @@ +'AMBRE_V1', + 'atlas_er3_ugriz_catMetaData_fits_V2', + 'ATLASGAL_V1', + 'COSMOS2015_Laigle_v1_1b_latestV7_fits_V1', + 'EREBOS_cat_fits_V1', + 'EREBOS_RV_cat_fits_V1', + 'GES_iDR4_PIII2016_Catalogue_v3_fits_V2', + 'GOODS_FORS2_V1', + 'GOODS_ISAAC_V1', + 'GOODS_VIMOS_SPEC_V1', + 'HUGS_GOODSS_K_V1', + 'HUGS_UDS_K_V1', + 'HUGS_UDS_Y_V1', + 'KiDS_DR3_0_ugri_src_fits_V2', + 'KiDS_DR3_1_ugri_shear_fits_V1', + 'legac_DR1_fits_V1', + 'legac_DR2_fits_V2', + 'PESSTO_TRAN_CAT_fits_V2', + 'PESSTO_MPHOT_fits_V2', + 'UltraVISTA_V3', + 'VANDELS_META_SPECTRO_fits_V1', + 'VHS_CAT_V2', + 'video_er3_zyjhks_CDFS_catMetaData_fits_V2', + 'video_er3_zyjhks_ES1_catMetaData_fits_V2', + 'video_er3_zyjhks_XMM_catMetaData_fits_V3', + 'viking_er4_zyjj_1j_2hks_catMetaData_fits_V3', + 'VIPERS_SPECTRO_PDR2_ESO_fits_V1', + 'vmc_er4_ksjy_catMetaData_fits_V3', + 'vmc_er4_j_mPhotMetaData_fits_V3', + 'vmc_er4_ks_mPhotMetaData_fits_V3', + 'vmc_er4_y_mPhotMetaData_fits_V3', + 'vmc_er4_yjks_cepheidCatMetaData_fits_V3', + 'vmc_er4_yjks_eclBinCatMetaData_fits_V2', + 'vmc_er4_yjks_psfCatMetaData_fits_V2', + 'vmc_er4_yjks_rrLyrCatMetaData_fits_V1', + 'vphas_er3_ugr_1r_2ihavphas_catMetaData_fits_V3', + 'VVV_CAT_V2', + 'VVV_MPHOT_Ks_V2', + 'VVV_VAR_V2', + 'XQ_100_summary_fits_V1', + 'ZCOSMOS_V2', + 'VANDELS_META_SPECTRO_fits_V2', + 'gcav_rxcj2129_YJKs_cat_fits_V1', + 'gcav_rxcj1515_YJKs_cat_fits_V1', + 'KiDS_DR4_0_ugriZYJHKs_cat_fits_V3', + 'UVISTA_5band_cat_dr4_rc_v2_fits_V3', + 'atlas_er4_ugriz_catMetaData_fits_V3', + 'VVV_VIRAC_PM_V1', + 'NGTS_SOURCE_CATALOGUE_fits_V1', + 'NGTS_LC_CATALOGUE_fits_V1', + 'MW_BULGE_PSFPHOT_V1', + 'VANDELS_spec_redshift_V3', + 'VEXAS_AllWISE_V1', + 'VEXAS_SMW_V1', + 'VEXAS_21_V1', + 'VEXAS_PS1W_V1', + 'VEXAS_XRAY_V1', + 'VEXAS_SPEC_V1', + 'VEXAS_DESW_V1', + 'viking_er5_zyjj_1j_2hks_catMetaData_fits_V4', + 'VHS_CAT_V3', + 'KiDS_DR4_1_ugriZYJHKs_cat_fits', + 'vmc_dr5_sourceCat_yjks_V4', + 'vmc_dr5_var_yjKs_V1', + 'vmc_dr5_mPhotY_V4', + 'vmc_dr5_mPhotJ_V4', + 'vmc_dr5_mPhotKs_V4', + 'vmc_dr5_psf_yjks_V3', + 'NGTS_SOURCE_CAT_V2', + 'NGTS_LC_V2', + 'VVV_bandMergedSourceCat_V3', + 'FDS_SourceCatalogue_V1', + 'VANDELS_SPECTRO_V4', + 'VEXAS_DESW_V2', + 'VEXAS_SMW_V2', + 'VEXAS_PSW_V2', + 'VEXAS_SPEC_GOOD_V2', + 'PESSTO_TRAN_CAT_V3', + 'GNS_catalogue_V1', + 'AMBRE_UVES_V1', + 'AMBRE_HARPS_V1', + 'PESSTO_MPHOT_V3', + 'legac_V3', + 'GES_2021_VRAD', + 'VIDEO_CAT_DR5', + 'GES_DR5', + 'COSMOS2020_CLASSIC_V2', + 'COSMOS2020_FARMER_V1', + 'vmc_dr6_yjks_varCat_V2', + 'vmc_dr6_yjks_psf_V4', + 'vmc_dr6_ksjy_V5', + 'vmc_dr6_mPhotJ_V5', + 'vmc_dr6_mPhotKs_V5', + 'vmc_dr6_mPhotY_V5', + 'COSMOS2020_FARMER_V2', + 'AMUSED_MAIN_SOURCE_CAT_V1', + 'UVISTA_5band_cat_dr5_rc_v1_fits_V4', + 'GES_DR5_1_V1', + 'HARPS_RVCAT_V1', + 'INSPIRE_V1', + 'UVISTA_5band_cat_dr6_rc_v1_fits_V5', + 'VVVX_VIRAC_V2_SOURCES', + 'VVVX_VIRAC_V2_REJECTED_SOURCES', + 'VVVX_VIRAC_V2_OBS', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'KiDS_DR5_0_ugriZYJHKs_cat_fits', + 'PHANGS_DR1_NebCat', + 'atlas_er5_ugriz', + 'vmc_dr7_ksjy_V6', + 'vmc_dr7_mPhotJ_V6', + 'vmc_dr7_mPhotKs_V6', + 'vmc_dr7_mPhotY_V6', + 'vmc_dr7_yjks_rrLy_V2', + 'vmc_dr7_yjks_agbVar_V1', + 'vmc_dr7_yjks_lpvVar_V1', + 'vmc_dr7_yjks_eclBinVar_V3', + 'vmc_dr7_yjks_chephVar_V4', + 'vmc_dr7_yjks_ysoVar_V1', + 'vmc_dr7_yjks_qsos_V1', + 'vmc_dr7_yjks_extYKs_V1', + 'vmc_dr7_yjks_MlClass_V1', + 'vmc_dr7_yjks_extJKs_V1', + 'vmc_dr7_yjks_pm_V1', + 'vmc_dr7_yjks_psfSrc_V5', + 'vmc_dr7_yjks_back_V1', + 'vmc_dr7_yjks_varCat_V3' \ No newline at end of file diff --git a/astroquery/eso/tests/test_eso_catalogues.py b/astroquery/eso/tests/test_eso_catalogues.py index 51e82a0d1f..c9b84c609a 100644 --- a/astroquery/eso/tests/test_eso_catalogues.py +++ b/astroquery/eso/tests/test_eso_catalogues.py @@ -1,104 +1,292 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst """ =========================== -ESO Astroquery Catalogue tests +ESO Astroquery Module tests =========================== European Southern Observatory (ESO) """ +import os +import shutil +import sys + import pytest +import pyvo from astropy.table import Table +import astropy.io.ascii +from astroquery.utils.mocks import MockResponse from ...eso import Eso +from ...eso.utils import _UserParams, \ + _build_adql_string, _adql_sanitize_op_val, _reorder_columns, \ + DEFAULT_LEAD_COLS_RAW +from ...exceptions import NoResultsWarning, MaxResultsWarning -CATALOGUE_TABLE_NAME = "KiDS_DR4_1_ugriZYJHKs_cat_fits" -CATALOGUE_TABLE_FULL = f"safcat.{CATALOGUE_TABLE_NAME}" - - -def _catalogue_metadata_table(): - return Table({ - "table_name": [CATALOGUE_TABLE_FULL], - }) +DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') +EXPECTED_MAXREC = 1000 +MONKEYPATCH_TABLE_LENGTH = 50 -def monkey_catalogue_tap(query, **kwargs): - _ = kwargs - if "tap_schema.tables" in query.lower(): - return _catalogue_metadata_table() - raise AssertionError(f"Unexpected catalogue query: {query}") +def data_path(filename): + return os.path.join(DATA_DIR, filename) -def test_list_catalogues_returns_table(monkeypatch): - # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html - eso = Eso() - monkeypatch.setattr(eso, "query_tap", monkey_catalogue_tap) - result = eso.list_catalogues() +DATA_FILES = { + 'ADQL': + { + "SELECT table_name FROM TAP_SCHEMA.tables as ref " + "LEFT OUTER JOIN TAP_SCHEMA.keys AS k ON ref.table_name = k.from_table " + "LEFT OUTER JOIN TAP_SCHEMA.key_columns AS kc ON k.key_id = kc.key_id " + "WHERE schema_name='safcat'" + "AND cat_id IN ( " + "SELECT t1.cat_id " + "FROM TAP_SCHEMA.tables t1 " + "LEFT JOIN TAP_SCHEMA.tables t2 ON (t1.title = t2.title AND t1.version < t2.version) " + "WHERE t2.title IS NULL)": + "query_list_catalogues_latest_versions.csv", + + "SELECT table_name FROM TAP_SCHEMA.tables as ref " + "LEFT OUTER JOIN TAP_SCHEMA.keys AS k ON ref.table_name = k.from_table " + "LEFT OUTER JOIN TAP_SCHEMA.key_columns AS kc ON k.key_id = kc.key_id " + "WHERE schema_name='safcat'": + "query_catalogues_all_versions.csv", + } +} - assert isinstance(result, list) - assert len(result) > 0 - assert all(isinstance(value, str) for value in result) - assert CATALOGUE_TABLE_NAME in result +catalogue_list = ['AMBRE_V1', + 'ATLASGAL_V1', + 'COSMOS2015_Laigle_v1_1b_latestV7_fits_V1', + 'EREBOS_cat_fits_V1', + 'EREBOS_RV_cat_fits_V1', + 'GOODS_FORS2_V1', + 'GOODS_ISAAC_V1', + 'GOODS_VIMOS_SPEC_V1', + 'HUGS_GOODSS_K_V1', + 'HUGS_UDS_K_V1', + 'HUGS_UDS_Y_V1', + 'KiDS_DR3_0_ugri_src_fits_V2', + 'KiDS_DR3_1_ugri_shear_fits_V1', + 'video_er3_zyjhks_CDFS_catMetaData_fits_V2', + 'video_er3_zyjhks_ES1_catMetaData_fits_V2', + 'video_er3_zyjhks_XMM_catMetaData_fits_V3', + 'VIPERS_SPECTRO_PDR2_ESO_fits_V1', + 'vphas_er3_ugr_1r_2ihavphas_catMetaData_fits_V3', + 'VVV_MPHOT_Ks_V2', + 'VVV_VAR_V2', + 'XQ_100_summary_fits_V1', + 'ZCOSMOS_V2', + 'gcav_rxcj2129_YJKs_cat_fits_V1', + 'gcav_rxcj1515_YJKs_cat_fits_V1', + 'VVV_VIRAC_PM_V1', + 'MW_BULGE_PSFPHOT_V1', + 'VANDELS_spec_redshift_V3', + 'VEXAS_AllWISE_V1', + 'VEXAS_21_V1', + 'VEXAS_XRAY_V1', + 'VEXAS_SPEC_V1', + 'viking_er5_zyjj_1j_2hks_catMetaData_fits_V4', + 'VHS_CAT_V3', + 'KiDS_DR4_1_ugriZYJHKs_cat_fits', + 'NGTS_SOURCE_CAT_V2', + 'NGTS_LC_V2', + 'VVV_bandMergedSourceCat_V3', + 'FDS_SourceCatalogue_V1', + 'VANDELS_SPECTRO_V4', + 'VEXAS_DESW_V2', + 'VEXAS_SMW_V2', + 'VEXAS_PSW_V2', + 'VEXAS_SPEC_GOOD_V2', + 'PESSTO_TRAN_CAT_V3', + 'GNS_catalogue_V1', + 'AMBRE_UVES_V1', + 'AMBRE_HARPS_V1', + 'PESSTO_MPHOT_V3', + 'legac_V3', + 'GES_2021_VRAD', + 'VIDEO_CAT_DR5', + 'COSMOS2020_CLASSIC_V2', + 'COSMOS2020_FARMER_V2', + 'AMUSED_MAIN_SOURCE_CAT_V1', + 'GES_DR5_1_V1', + 'HARPS_RVCAT_V1', + 'INSPIRE_V1', + 'UVISTA_5band_cat_dr6_rc_v1_fits_V5', + 'VVVX_VIRAC_V2_SOURCES', + 'VVVX_VIRAC_V2_REJECTED_SOURCES', + 'VVVX_VIRAC_V2_OBS', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'KiDS_DR5_0_ugriZYJHKs_cat_fits', + 'PHANGS_DR1_NebCat', + 'atlas_er5_ugriz', + 'vmc_dr7_ksjy_V6', + 'vmc_dr7_mPhotJ_V6', + 'vmc_dr7_mPhotKs_V6', + 'vmc_dr7_mPhotY_V6', + 'vmc_dr7_yjks_rrLy_V2', + 'vmc_dr7_yjks_agbVar_V1', + 'vmc_dr7_yjks_lpvVar_V1', + 'vmc_dr7_yjks_eclBinVar_V3', + 'vmc_dr7_yjks_chephVar_V4', + 'vmc_dr7_yjks_ysoVar_V1', + 'vmc_dr7_yjks_qsos_V1', + 'vmc_dr7_yjks_extYKs_V1', + 'vmc_dr7_yjks_MlClass_V1', + 'vmc_dr7_yjks_extJKs_V1', + 'vmc_dr7_yjks_pm_V1', + 'vmc_dr7_yjks_psfSrc_V5', + 'vmc_dr7_yjks_back_V1', + 'vmc_dr7_yjks_varCat_V3'] +catalogue_list_all = ['AMBRE_V1', + 'atlas_er3_ugriz_catMetaData_fits_V2', + 'ATLASGAL_V1', + 'COSMOS2015_Laigle_v1_1b_latestV7_fits_V1', + 'EREBOS_cat_fits_V1', + 'EREBOS_RV_cat_fits_V1', + 'GES_iDR4_PIII2016_Catalogue_v3_fits_V2', + 'GOODS_FORS2_V1', + 'GOODS_ISAAC_V1', + 'GOODS_VIMOS_SPEC_V1', + 'HUGS_GOODSS_K_V1', + 'HUGS_UDS_K_V1', + 'HUGS_UDS_Y_V1', + 'KiDS_DR3_0_ugri_src_fits_V2', + 'KiDS_DR3_1_ugri_shear_fits_V1', + 'legac_DR1_fits_V1', + 'legac_DR2_fits_V2', + 'PESSTO_TRAN_CAT_fits_V2', + 'PESSTO_MPHOT_fits_V2', + 'UltraVISTA_V3', + 'VANDELS_META_SPECTRO_fits_V1', + 'VHS_CAT_V2', + 'video_er3_zyjhks_CDFS_catMetaData_fits_V2', + 'video_er3_zyjhks_ES1_catMetaData_fits_V2', + 'video_er3_zyjhks_XMM_catMetaData_fits_V3', + 'viking_er4_zyjj_1j_2hks_catMetaData_fits_V3', + 'VIPERS_SPECTRO_PDR2_ESO_fits_V1', + 'vmc_er4_ksjy_catMetaData_fits_V3', + 'vmc_er4_j_mPhotMetaData_fits_V3', + 'vmc_er4_ks_mPhotMetaData_fits_V3', + 'vmc_er4_y_mPhotMetaData_fits_V3', + 'vmc_er4_yjks_cepheidCatMetaData_fits_V3', + 'vmc_er4_yjks_eclBinCatMetaData_fits_V2', + 'vmc_er4_yjks_psfCatMetaData_fits_V2', + 'vmc_er4_yjks_rrLyrCatMetaData_fits_V1', + 'vphas_er3_ugr_1r_2ihavphas_catMetaData_fits_V3', + 'VVV_CAT_V2', + 'VVV_MPHOT_Ks_V2', + 'VVV_VAR_V2', + 'XQ_100_summary_fits_V1', + 'ZCOSMOS_V2', + 'VANDELS_META_SPECTRO_fits_V2', + 'gcav_rxcj2129_YJKs_cat_fits_V1', + 'gcav_rxcj1515_YJKs_cat_fits_V1', + 'KiDS_DR4_0_ugriZYJHKs_cat_fits_V3', + 'UVISTA_5band_cat_dr4_rc_v2_fits_V3', + 'atlas_er4_ugriz_catMetaData_fits_V3', + 'VVV_VIRAC_PM_V1', + 'NGTS_SOURCE_CATALOGUE_fits_V1', + 'NGTS_LC_CATALOGUE_fits_V1', + 'MW_BULGE_PSFPHOT_V1', + 'VANDELS_spec_redshift_V3', + 'VEXAS_AllWISE_V1', + 'VEXAS_SMW_V1', + 'VEXAS_21_V1', + 'VEXAS_PS1W_V1', + 'VEXAS_XRAY_V1', + 'VEXAS_SPEC_V1', + 'VEXAS_DESW_V1', + 'viking_er5_zyjj_1j_2hks_catMetaData_fits_V4', + 'VHS_CAT_V3', + 'KiDS_DR4_1_ugriZYJHKs_cat_fits', + 'vmc_dr5_sourceCat_yjks_V4', + 'vmc_dr5_var_yjKs_V1', + 'vmc_dr5_mPhotY_V4', + 'vmc_dr5_mPhotJ_V4', + 'vmc_dr5_mPhotKs_V4', + 'vmc_dr5_psf_yjks_V3', + 'NGTS_SOURCE_CAT_V2', + 'NGTS_LC_V2', + 'VVV_bandMergedSourceCat_V3', + 'FDS_SourceCatalogue_V1', + 'VANDELS_SPECTRO_V4', + 'VEXAS_DESW_V2', + 'VEXAS_SMW_V2', + 'VEXAS_PSW_V2', + 'VEXAS_SPEC_GOOD_V2', + 'PESSTO_TRAN_CAT_V3', + 'GNS_catalogue_V1', + 'AMBRE_UVES_V1', + 'AMBRE_HARPS_V1', + 'PESSTO_MPHOT_V3', + 'legac_V3', + 'GES_2021_VRAD', + 'VIDEO_CAT_DR5', + 'GES_DR5', + 'COSMOS2020_CLASSIC_V2', + 'COSMOS2020_FARMER_V1', + 'vmc_dr6_yjks_varCat_V2', + 'vmc_dr6_yjks_psf_V4', + 'vmc_dr6_ksjy_V5', + 'vmc_dr6_mPhotJ_V5', + 'vmc_dr6_mPhotKs_V5', + 'vmc_dr6_mPhotY_V5', + 'COSMOS2020_FARMER_V2', + 'AMUSED_MAIN_SOURCE_CAT_V1', + 'UVISTA_5band_cat_dr5_rc_v1_fits_V4', + 'GES_DR5_1_V1', + 'HARPS_RVCAT_V1', + 'INSPIRE_V1', + 'UVISTA_5band_cat_dr6_rc_v1_fits_V5', + 'VVVX_VIRAC_V2_SOURCES', + 'VVVX_VIRAC_V2_REJECTED_SOURCES', + 'VVVX_VIRAC_V2_OBS', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'KiDS_DR5_0_ugriZYJHKs_cat_fits', + 'PHANGS_DR1_NebCat', + 'atlas_er5_ugriz', + 'vmc_dr7_ksjy_V6', + 'vmc_dr7_mPhotJ_V6', + 'vmc_dr7_mPhotKs_V6', + 'vmc_dr7_mPhotY_V6', + 'vmc_dr7_yjks_rrLy_V2', + 'vmc_dr7_yjks_agbVar_V1', + 'vmc_dr7_yjks_lpvVar_V1', + 'vmc_dr7_yjks_eclBinVar_V3', + 'vmc_dr7_yjks_chephVar_V4', + 'vmc_dr7_yjks_ysoVar_V1', + 'vmc_dr7_yjks_qsos_V1', + 'vmc_dr7_yjks_extYKs_V1', + 'vmc_dr7_yjks_MlClass_V1', + 'vmc_dr7_yjks_extJKs_V1', + 'vmc_dr7_yjks_pm_V1', + 'vmc_dr7_yjks_psfSrc_V5', + 'vmc_dr7_yjks_back_V1', + 'vmc_dr7_yjks_varCat_V3'] -def test_query_catalogues_builds_expected_adql_with_columns_and_filters(monkeypatch): - # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html - eso = Eso() - monkeypatch.setattr(eso, "list_catalogues", lambda *args, **kwargs: [CATALOGUE_TABLE_NAME]) - - query = eso.query_catalogue( - catalogue=CATALOGUE_TABLE_NAME, - columns=["colA", "colB"], - column_filters={"colC": "> 0", "colD": "foo"}, - get_query_payload=True, - ) - - assert f"from {CATALOGUE_TABLE_FULL}" in query - assert "select colA, colB" in query - assert "colC > 0" in query - assert "colD = 'foo'" in query - - -def test_query_catalogues_unknown_collection_raises(monkeypatch): - # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html - eso = Eso() - - monkeypatch.setattr(eso, "list_catalogues", lambda *args, **kwargs: [CATALOGUE_TABLE_NAME]) - - with pytest.raises(ValueError): - eso.query_catalogue(catalogue="NO_SUCH_COLLECTION") - +def monkey_tap(query, **kwargs): + _ = kwargs + table_file = data_path(DATA_FILES['ADQL'][query]) + table = astropy.io.ascii.read(table_file, format='csv', header_start=0, data_start=1) + return table -def test_query_catalogues_help_returns_table(monkeypatch): +def test_list_catalogues_latest_versions(monkeypatch): eso = Eso() - monkeypatch.setattr(eso, "list_catalogues", lambda *args, **kwargs: [CATALOGUE_TABLE_NAME]) - - columns = Table({ - "column_name": ["col_ra", "col_dec"], - "datatype": ["double", "double"], - "unit": ["deg", "deg"], - "ucd": ["pos.eq.ra;meta.main", "pos.eq.dec;meta.main"], - }) - monkeypatch.setattr(eso, "_columns_table", lambda *args, **kwargs: columns) - monkeypatch.setattr(eso, "query_tap", lambda *args, **kwargs: Table({"count": [1]})) + monkeypatch.setattr(eso, 'query_tap', monkey_tap) + saved_list = eso.list_catalogues(all_versions=False) + assert isinstance(saved_list, list) + assert set(catalogue_list) <= set(saved_list) - result = eso.query_catalogue(catalogue=CATALOGUE_TABLE_NAME, help=True) - - assert isinstance(result, Table) - assert "column_name" in result.colnames - - -def test_query_catalogues_cone_uses_ucd_columns(monkeypatch): +def test_list_catalogues_all_versions(monkeypatch): eso = Eso() - monkeypatch.setattr(eso, "list_catalogues", lambda *args, **kwargs: [CATALOGUE_TABLE_NAME]) - monkeypatch.setattr(eso, "_catalogue_radec_columns", lambda *args, **kwargs: ("col_ra", "col_dec")) - - query = eso.query_catalogue( - catalogue=CATALOGUE_TABLE_NAME, - cone_ra=41.2863, - cone_dec=-55.7406, - cone_radius=0.04, - get_query_payload=True, - ) - - assert "CONTAINS(point('', col_ra, col_dec), circle('', 41.2863, -55.7406, 0.04)) = 1" in query + monkeypatch.setattr(eso, 'query_tap', monkey_tap) + saved_list = eso.list_catalogues(all_versions=True) + assert isinstance(saved_list, list) + assert len(saved_list) >= len(catalogue_list_all) \ No newline at end of file diff --git a/astroquery/eso/tests/test_eso_catalogues_remote.py b/astroquery/eso/tests/test_eso_catalogues_remote.py new file mode 100644 index 0000000000..9dfc274ba9 --- /dev/null +++ b/astroquery/eso/tests/test_eso_catalogues_remote.py @@ -0,0 +1,266 @@ +# Licensed under a 3-clause BSD style license - see LICENSE.rst +""" +=========================== +ESO Astroquery Module tests +=========================== + +European Southern Observatory (ESO) + +""" + +from collections import Counter +import pytest + +from astropy.table import Table +from astroquery.exceptions import NoResultsWarning, MaxResultsWarning +from astroquery.eso import Eso + +catalogue_list = ['AMBRE_V1', + 'ATLASGAL_V1', + 'COSMOS2015_Laigle_v1_1b_latestV7_fits_V1', + 'EREBOS_cat_fits_V1', + 'EREBOS_RV_cat_fits_V1', + 'GOODS_FORS2_V1', + 'GOODS_ISAAC_V1', + 'GOODS_VIMOS_SPEC_V1', + 'HUGS_GOODSS_K_V1', + 'HUGS_UDS_K_V1', + 'HUGS_UDS_Y_V1', + 'KiDS_DR3_0_ugri_src_fits_V2', + 'KiDS_DR3_1_ugri_shear_fits_V1', + 'video_er3_zyjhks_CDFS_catMetaData_fits_V2', + 'video_er3_zyjhks_ES1_catMetaData_fits_V2', + 'video_er3_zyjhks_XMM_catMetaData_fits_V3', + 'VIPERS_SPECTRO_PDR2_ESO_fits_V1', + 'vphas_er3_ugr_1r_2ihavphas_catMetaData_fits_V3', + 'VVV_MPHOT_Ks_V2', + 'VVV_VAR_V2', + 'XQ_100_summary_fits_V1', + 'ZCOSMOS_V2', + 'gcav_rxcj2129_YJKs_cat_fits_V1', + 'gcav_rxcj1515_YJKs_cat_fits_V1', + 'VVV_VIRAC_PM_V1', + 'MW_BULGE_PSFPHOT_V1', + 'VANDELS_spec_redshift_V3', + 'VEXAS_AllWISE_V1', + 'VEXAS_21_V1', + 'VEXAS_XRAY_V1', + 'VEXAS_SPEC_V1', + 'viking_er5_zyjj_1j_2hks_catMetaData_fits_V4', + 'VHS_CAT_V3', + 'KiDS_DR4_1_ugriZYJHKs_cat_fits', + 'NGTS_SOURCE_CAT_V2', + 'NGTS_LC_V2', + 'VVV_bandMergedSourceCat_V3', + 'FDS_SourceCatalogue_V1', + 'VANDELS_SPECTRO_V4', + 'VEXAS_DESW_V2', + 'VEXAS_SMW_V2', + 'VEXAS_PSW_V2', + 'VEXAS_SPEC_GOOD_V2', + 'PESSTO_TRAN_CAT_V3', + 'GNS_catalogue_V1', + 'AMBRE_UVES_V1', + 'AMBRE_HARPS_V1', + 'PESSTO_MPHOT_V3', + 'legac_V3', + 'GES_2021_VRAD', + 'VIDEO_CAT_DR5', + 'COSMOS2020_CLASSIC_V2', + 'COSMOS2020_FARMER_V2', + 'AMUSED_MAIN_SOURCE_CAT_V1', + 'GES_DR5_1_V1', + 'HARPS_RVCAT_V1', + 'INSPIRE_V1', + 'UVISTA_5band_cat_dr6_rc_v1_fits_V5', + 'VVVX_VIRAC_V2_SOURCES', + 'VVVX_VIRAC_V2_REJECTED_SOURCES', + 'VVVX_VIRAC_V2_OBS', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'KiDS_DR5_0_ugriZYJHKs_cat_fits', + 'PHANGS_DR1_NebCat', + 'atlas_er5_ugriz', + 'vmc_dr7_ksjy_V6', + 'vmc_dr7_mPhotJ_V6', + 'vmc_dr7_mPhotKs_V6', + 'vmc_dr7_mPhotY_V6', + 'vmc_dr7_yjks_rrLy_V2', + 'vmc_dr7_yjks_agbVar_V1', + 'vmc_dr7_yjks_lpvVar_V1', + 'vmc_dr7_yjks_eclBinVar_V3', + 'vmc_dr7_yjks_chephVar_V4', + 'vmc_dr7_yjks_ysoVar_V1', + 'vmc_dr7_yjks_qsos_V1', + 'vmc_dr7_yjks_extYKs_V1', + 'vmc_dr7_yjks_MlClass_V1', + 'vmc_dr7_yjks_extJKs_V1', + 'vmc_dr7_yjks_pm_V1', + 'vmc_dr7_yjks_psfSrc_V5', + 'vmc_dr7_yjks_back_V1', + 'vmc_dr7_yjks_varCat_V3'] + +catalogue_list_all = ['AMBRE_V1', + 'atlas_er3_ugriz_catMetaData_fits_V2', + 'ATLASGAL_V1', + 'COSMOS2015_Laigle_v1_1b_latestV7_fits_V1', + 'EREBOS_cat_fits_V1', + 'EREBOS_RV_cat_fits_V1', + 'GES_iDR4_PIII2016_Catalogue_v3_fits_V2', + 'GOODS_FORS2_V1', + 'GOODS_ISAAC_V1', + 'GOODS_VIMOS_SPEC_V1', + 'HUGS_GOODSS_K_V1', + 'HUGS_UDS_K_V1', + 'HUGS_UDS_Y_V1', + 'KiDS_DR3_0_ugri_src_fits_V2', + 'KiDS_DR3_1_ugri_shear_fits_V1', + 'legac_DR1_fits_V1', + 'legac_DR2_fits_V2', + 'PESSTO_TRAN_CAT_fits_V2', + 'PESSTO_MPHOT_fits_V2', + 'UltraVISTA_V3', + 'VANDELS_META_SPECTRO_fits_V1', + 'VHS_CAT_V2', + 'video_er3_zyjhks_CDFS_catMetaData_fits_V2', + 'video_er3_zyjhks_ES1_catMetaData_fits_V2', + 'video_er3_zyjhks_XMM_catMetaData_fits_V3', + 'viking_er4_zyjj_1j_2hks_catMetaData_fits_V3', + 'VIPERS_SPECTRO_PDR2_ESO_fits_V1', + 'vmc_er4_ksjy_catMetaData_fits_V3', + 'vmc_er4_j_mPhotMetaData_fits_V3', + 'vmc_er4_ks_mPhotMetaData_fits_V3', + 'vmc_er4_y_mPhotMetaData_fits_V3', + 'vmc_er4_yjks_cepheidCatMetaData_fits_V3', + 'vmc_er4_yjks_eclBinCatMetaData_fits_V2', + 'vmc_er4_yjks_psfCatMetaData_fits_V2', + 'vmc_er4_yjks_rrLyrCatMetaData_fits_V1', + 'vphas_er3_ugr_1r_2ihavphas_catMetaData_fits_V3', + 'VVV_CAT_V2', + 'VVV_MPHOT_Ks_V2', + 'VVV_VAR_V2', + 'XQ_100_summary_fits_V1', + 'ZCOSMOS_V2', + 'VANDELS_META_SPECTRO_fits_V2', + 'gcav_rxcj2129_YJKs_cat_fits_V1', + 'gcav_rxcj1515_YJKs_cat_fits_V1', + 'KiDS_DR4_0_ugriZYJHKs_cat_fits_V3', + 'UVISTA_5band_cat_dr4_rc_v2_fits_V3', + 'atlas_er4_ugriz_catMetaData_fits_V3', + 'VVV_VIRAC_PM_V1', + 'NGTS_SOURCE_CATALOGUE_fits_V1', + 'NGTS_LC_CATALOGUE_fits_V1', + 'MW_BULGE_PSFPHOT_V1', + 'VANDELS_spec_redshift_V3', + 'VEXAS_AllWISE_V1', + 'VEXAS_SMW_V1', + 'VEXAS_21_V1', + 'VEXAS_PS1W_V1', + 'VEXAS_XRAY_V1', + 'VEXAS_SPEC_V1', + 'VEXAS_DESW_V1', + 'viking_er5_zyjj_1j_2hks_catMetaData_fits_V4', + 'VHS_CAT_V3', + 'KiDS_DR4_1_ugriZYJHKs_cat_fits', + 'vmc_dr5_sourceCat_yjks_V4', + 'vmc_dr5_var_yjKs_V1', + 'vmc_dr5_mPhotY_V4', + 'vmc_dr5_mPhotJ_V4', + 'vmc_dr5_mPhotKs_V4', + 'vmc_dr5_psf_yjks_V3', + 'NGTS_SOURCE_CAT_V2', + 'NGTS_LC_V2', + 'VVV_bandMergedSourceCat_V3', + 'FDS_SourceCatalogue_V1', + 'VANDELS_SPECTRO_V4', + 'VEXAS_DESW_V2', + 'VEXAS_SMW_V2', + 'VEXAS_PSW_V2', + 'VEXAS_SPEC_GOOD_V2', + 'PESSTO_TRAN_CAT_V3', + 'GNS_catalogue_V1', + 'AMBRE_UVES_V1', + 'AMBRE_HARPS_V1', + 'PESSTO_MPHOT_V3', + 'legac_V3', + 'GES_2021_VRAD', + 'VIDEO_CAT_DR5', + 'GES_DR5', + 'COSMOS2020_CLASSIC_V2', + 'COSMOS2020_FARMER_V1', + 'vmc_dr6_yjks_varCat_V2', + 'vmc_dr6_yjks_psf_V4', + 'vmc_dr6_ksjy_V5', + 'vmc_dr6_mPhotJ_V5', + 'vmc_dr6_mPhotKs_V5', + 'vmc_dr6_mPhotY_V5', + 'COSMOS2020_FARMER_V2', + 'AMUSED_MAIN_SOURCE_CAT_V1', + 'UVISTA_5band_cat_dr5_rc_v1_fits_V4', + 'GES_DR5_1_V1', + 'HARPS_RVCAT_V1', + 'INSPIRE_V1', + 'UVISTA_5band_cat_dr6_rc_v1_fits_V5', + 'VVVX_VIRAC_V2_SOURCES', + 'VVVX_VIRAC_V2_REJECTED_SOURCES', + 'VVVX_VIRAC_V2_OBS', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'VVVX_VIRAC_V2_REJECTED_LC', + 'KiDS_DR5_0_ugriZYJHKs_cat_fits', + 'PHANGS_DR1_NebCat', + 'atlas_er5_ugriz', + 'vmc_dr7_ksjy_V6', + 'vmc_dr7_mPhotJ_V6', + 'vmc_dr7_mPhotKs_V6', + 'vmc_dr7_mPhotY_V6', + 'vmc_dr7_yjks_rrLy_V2', + 'vmc_dr7_yjks_agbVar_V1', + 'vmc_dr7_yjks_lpvVar_V1', + 'vmc_dr7_yjks_eclBinVar_V3', + 'vmc_dr7_yjks_chephVar_V4', + 'vmc_dr7_yjks_ysoVar_V1', + 'vmc_dr7_yjks_qsos_V1', + 'vmc_dr7_yjks_extYKs_V1', + 'vmc_dr7_yjks_MlClass_V1', + 'vmc_dr7_yjks_extJKs_V1', + 'vmc_dr7_yjks_pm_V1', + 'vmc_dr7_yjks_psfSrc_V5', + 'vmc_dr7_yjks_back_V1', + 'vmc_dr7_yjks_varCat_V3'] + +@pytest.mark.remote_data +class TestEso: + @pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning") + def test_list_instruments(self): + eso = Eso() + t = eso.list_instruments(all_versions=False) + t_all = eso.list_instruments(all_versions=True) + lt = len(t) + lt_all = len(t_all) + + assert isinstance(t, list), f"Expected type {type(list)}; Obtained {type(t)}" + assert lt > 0, "Expected non-empty list of instruments" + assert set (t) <= set(catalogue_list), "Expected different list of instruments" + assert set(t_all) <= set(catalogue_list_all), "Expected different list of instruments" + assert lt_all >= lt, "Expected all_versions=True to return equal or more instruments than all_versions=False" + + @pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning") + @pytest.mark.parametrize('catalogue', catalogue_list) + def test_query_catalogue(self, catalogue): + eso = Eso() + t = eso.query_catalogue(catalogue, ROW_LIMIT=5) + + assert isinstance(t, Table), f"Expected type {type(Table)}; Obtained {type(t)}" + assert len(t) <= 5, f"Expected max 5 records; Obtained {len(t)}" + assert len(t) > 0, "Expected non-empty table" + + @pytest.mark.parametrize('catalogue', catalogue_list) + def test_query_catalogue_help(self, catalogue): + eso = Eso() + eso.query_catalogue(catalogue, help=True) + + diff --git a/astroquery/eso/utils.py b/astroquery/eso/utils.py index 374883e7af..a445377615 100644 --- a/astroquery/eso/utils.py +++ b/astroquery/eso/utils.py @@ -3,7 +3,6 @@ """ from dataclasses import dataclass from typing import Dict, List, Optional, Union - from astropy.table import Table DEFAULT_LEAD_COLS_RAW = ['object', 'ra', 'dec', 'dp_id', 'date_obs', 'prog_id'] From af686fcef2b325317c8b371146cc5e90ee8e2287 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 19:46:13 +0100 Subject: [PATCH 26/30] updated test data --- ...es_all_versions.csv => query_list_catalogues_all_versions.csv} | 0 ...est_versions.csv => query_list_catalogues_latest_versions.csv} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename astroquery/eso/tests/data/{query_catalogues_all_versions.csv => query_list_catalogues_all_versions.csv} (100%) rename astroquery/eso/tests/data/{query_catalogues_latest_versions.csv => query_list_catalogues_latest_versions.csv} (100%) diff --git a/astroquery/eso/tests/data/query_catalogues_all_versions.csv b/astroquery/eso/tests/data/query_list_catalogues_all_versions.csv similarity index 100% rename from astroquery/eso/tests/data/query_catalogues_all_versions.csv rename to astroquery/eso/tests/data/query_list_catalogues_all_versions.csv diff --git a/astroquery/eso/tests/data/query_catalogues_latest_versions.csv b/astroquery/eso/tests/data/query_list_catalogues_latest_versions.csv similarity index 100% rename from astroquery/eso/tests/data/query_catalogues_latest_versions.csv rename to astroquery/eso/tests/data/query_list_catalogues_latest_versions.csv From eb34c4d2b0c66a92dc1681572cb55f7f3588b915 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Wed, 28 Jan 2026 20:33:11 +0100 Subject: [PATCH 27/30] typo change --- astroquery/eso/tests/test_eso_catalogues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astroquery/eso/tests/test_eso_catalogues.py b/astroquery/eso/tests/test_eso_catalogues.py index c9b84c609a..8de1514b4b 100644 --- a/astroquery/eso/tests/test_eso_catalogues.py +++ b/astroquery/eso/tests/test_eso_catalogues.py @@ -50,7 +50,7 @@ def data_path(filename): "LEFT OUTER JOIN TAP_SCHEMA.keys AS k ON ref.table_name = k.from_table " "LEFT OUTER JOIN TAP_SCHEMA.key_columns AS kc ON k.key_id = kc.key_id " "WHERE schema_name='safcat'": - "query_catalogues_all_versions.csv", + "query_list_catalogues_all_versions.csv", } } From d4e28672b98f6909139480709534bc8aefdb6e51 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Thu, 29 Jan 2026 15:13:41 +0100 Subject: [PATCH 28/30] update _try_download_pyvo_table error --- astroquery/eso/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index decbbc6222..06f7eb7533 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -264,11 +264,12 @@ def _try_download_pyvo_table(self, table_with_an_extra_row = Table() def message(query_str): + which_tap = tap.baseurl.split("/")[-1] 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 method:\n\n" - f' >>> Eso().query_tap( "{query_str}" )\n\n') + f' >>> Eso().query_tap( "{query_str}", which_tap="{which_tap}")\n\n') try: row_limit_plus_one = self.ROW_LIMIT From ddf82fb1743c86552905a6cc02f8c7adb3e44f31 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:19:34 +0100 Subject: [PATCH 29/30] updated max_row_limit to 15000000 --- astroquery/eso/__init__.py | 6 ++++-- astroquery/eso/core.py | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/astroquery/eso/__init__.py b/astroquery/eso/__init__.py index 26eee10300..7697944c78 100644 --- a/astroquery/eso/__init__.py +++ b/astroquery/eso/__init__.py @@ -9,10 +9,12 @@ class Conf(_config.ConfigNamespace): """ Configuration parameters for `astroquery.eso`. """ - + MAX_ROW_LIMIT = _config.ConfigItem( + 15000000, + 'Maximum number of rows allowed by the TAP service.') ROW_LIMIT = _config.ConfigItem( 1000, - 'Maximum number of rows returned (set to -1 for unlimited).') + 'Maximum number of rows returned (set to -1 for maximum allowed via TAP service).') username = _config.ConfigItem( "", 'Optional default username for ESO archive.') diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 06f7eb7533..dd6c504ed9 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -96,7 +96,7 @@ def wrapper(self, *args, **kwargs): tmpvar = self.ROW_LIMIT try: - self.ROW_LIMIT = sys.maxsize + self.ROW_LIMIT = conf.MAX_ROW_LIMIT result = func(self, *args, **kwargs) finally: self.ROW_LIMIT = tmpvar @@ -136,9 +136,11 @@ def ROW_LIMIT(self, value): # type check if not (value is None or isinstance(value, int)): raise TypeError(f"ROW_LIMIT attribute must be of type int or None; found {type(value)}") + elif value > conf.MAX_ROW_LIMIT: + raise ValueError(f"ROW_LIMIT cannot be higher than {conf.MAX_ROW_LIMIT}; found {value}") if value is None or value < 1: - mr = sys.maxsize + mr = conf.MAX_ROW_LIMIT else: mr = value @@ -446,7 +448,7 @@ def list_catalogues(self, all_versions: bool = False, cache: bool = True) -> Lis query_str = (f"SELECT table_name FROM TAP_SCHEMA.tables as ref " "LEFT OUTER JOIN TAP_SCHEMA.keys AS k ON ref.table_name = k.from_table " "LEFT OUTER JOIN TAP_SCHEMA.key_columns AS kc ON k.key_id = kc.key_id " - f"WHERE schema_name='{schema}'") + f"WHERE schema_name='{schema}' ") if not all_versions: query_str += ("AND cat_id IN ( " From 10a0d9e53a9f036e5a9f2efa31edb808d032f3f8 Mon Sep 17 00:00:00 2001 From: Ashley Barnes <30494539+ashleythomasbarnes@users.noreply.github.com> Date: Thu, 29 Jan 2026 16:27:07 +0100 Subject: [PATCH 30/30] updated tests --- astroquery/eso/tests/data/kids_dr4_sample.csv | 6 ++++++ astroquery/eso/tests/test_eso_catalogues.py | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 astroquery/eso/tests/data/kids_dr4_sample.csv diff --git a/astroquery/eso/tests/data/kids_dr4_sample.csv b/astroquery/eso/tests/data/kids_dr4_sample.csv new file mode 100644 index 0000000000..644cbb9e2c --- /dev/null +++ b/astroquery/eso/tests/data/kids_dr4_sample.csv @@ -0,0 +1,6 @@ +Level,ALPHA_J2000,A_IMAGE,A_WORLD,Agaper,Agaper_0p7,Agaper_1p0,BPZ_FILT,BPZ_FLAGFILT,BPZ_NONDETFILT,B_IMAGE,B_WORLD,BackGr,Bgaper,Bgaper_0p7,Bgaper_1p0,CHI_SQUARED_BPZ,CLASS_STAR,COLOUR_GAAP_H_Ks,COLOUR_GAAP_J_H,COLOUR_GAAP_Y_J,COLOUR_GAAP_Z_Y,COLOUR_GAAP_g_r,COLOUR_GAAP_i_Z,COLOUR_GAAP_r_i,COLOUR_GAAP_u_g,CXX_WORLD,CXY_WORLD,CYY_WORLD,DECJ2000,DELTA_J2000,ERRA_IMAGE,ERRA_WORLD,ERRB_IMAGE,ERRB_WORLD,ERRCXX_WORLD,ERRCXY_WORLD,ERRCYY_WORLD,ERRTHETA_J2000,ERRTHETA_WORLD,ERRX2_WORLD,ERRXY_WORLD,ERRY2_WORLD,EXTINCTION_H,EXTINCTION_J,EXTINCTION_Ks,EXTINCTION_Y,EXTINCTION_Z,EXTINCTION_g,EXTINCTION_i,EXTINCTION_r,EXTINCTION_u,FIELD_POS,FLAG_GAAP_0p7_H,FLAG_GAAP_0p7_J,FLAG_GAAP_0p7_Ks,FLAG_GAAP_0p7_Y,FLAG_GAAP_0p7_Z,FLAG_GAAP_0p7_g,FLAG_GAAP_0p7_i,FLAG_GAAP_0p7_r,FLAG_GAAP_0p7_u,FLAG_GAAP_1p0_H,FLAG_GAAP_1p0_J,FLAG_GAAP_1p0_Ks,FLAG_GAAP_1p0_Y,FLAG_GAAP_1p0_Z,FLAG_GAAP_1p0_g,FLAG_GAAP_1p0_i,FLAG_GAAP_1p0_r,FLAG_GAAP_1p0_u,FLAG_GAAP_H,FLAG_GAAP_J,FLAG_GAAP_Ks,FLAG_GAAP_Y,FLAG_GAAP_Z,FLAG_GAAP_g,FLAG_GAAP_i,FLAG_GAAP_r,FLAG_GAAP_u,FLUXERR_APER_10,FLUXERR_APER_100,FLUXERR_APER_14,FLUXERR_APER_20,FLUXERR_APER_30,FLUXERR_APER_4,FLUXERR_APER_40,FLUXERR_APER_6,FLUXERR_APER_60,FLUXERR_APER_8,FLUXERR_AUTO,FLUXERR_GAAP_0p7_H,FLUXERR_GAAP_0p7_J,FLUXERR_GAAP_0p7_Ks,FLUXERR_GAAP_0p7_Y,FLUXERR_GAAP_0p7_Z,FLUXERR_GAAP_0p7_g,FLUXERR_GAAP_0p7_i,FLUXERR_GAAP_0p7_r,FLUXERR_GAAP_0p7_u,FLUXERR_GAAP_1p0_H,FLUXERR_GAAP_1p0_J,FLUXERR_GAAP_1p0_Ks,FLUXERR_GAAP_1p0_Y,FLUXERR_GAAP_1p0_Z,FLUXERR_GAAP_1p0_g,FLUXERR_GAAP_1p0_i,FLUXERR_GAAP_1p0_r,FLUXERR_GAAP_1p0_u,FLUXERR_GAAP_H,FLUXERR_GAAP_J,FLUXERR_GAAP_Ks,FLUXERR_GAAP_Y,FLUXERR_GAAP_Z,FLUXERR_GAAP_g,FLUXERR_GAAP_i,FLUXERR_GAAP_r,FLUXERR_GAAP_u,FLUXERR_ISO,FLUXERR_ISOCOR,FLUX_APER_10,FLUX_APER_100,FLUX_APER_14,FLUX_APER_20,FLUX_APER_30,FLUX_APER_4,FLUX_APER_40,FLUX_APER_6,FLUX_APER_60,FLUX_APER_8,FLUX_AUTO,FLUX_GAAP_0p7_H,FLUX_GAAP_0p7_J,FLUX_GAAP_0p7_Ks,FLUX_GAAP_0p7_Y,FLUX_GAAP_0p7_Z,FLUX_GAAP_0p7_g,FLUX_GAAP_0p7_i,FLUX_GAAP_0p7_r,FLUX_GAAP_0p7_u,FLUX_GAAP_1p0_H,FLUX_GAAP_1p0_J,FLUX_GAAP_1p0_Ks,FLUX_GAAP_1p0_Y,FLUX_GAAP_1p0_Z,FLUX_GAAP_1p0_g,FLUX_GAAP_1p0_i,FLUX_GAAP_1p0_r,FLUX_GAAP_1p0_u,FLUX_GAAP_H,FLUX_GAAP_J,FLUX_GAAP_Ks,FLUX_GAAP_Y,FLUX_GAAP_Z,FLUX_GAAP_g,FLUX_GAAP_i,FLUX_GAAP_r,FLUX_GAAP_u,FLUX_ISO,FLUX_ISOCOR,FLUX_RADIUS,FWHM_IMAGE,FWHM_WORLD,Flag,HTM,ID,IMAFLAGS_ISO,ISO0,ISO1,ISO2,ISO3,ISO4,ISO5,ISO6,ISO7,ISOAREA_WORLD,KIDS_TILE,KRON_RADIUS,MAGERR_APER_10,MAGERR_APER_100,MAGERR_APER_14,MAGERR_APER_20,MAGERR_APER_4,MAGERR_APER_40,MAGERR_APER_6,MAGERR_APER_60,MAGERR_APER_8,MAGERR_AUTO,MAGERR_GAAP_0p7_H,MAGERR_GAAP_0p7_J,MAGERR_GAAP_0p7_Ks,MAGERR_GAAP_0p7_Y,MAGERR_GAAP_0p7_Z,MAGERR_GAAP_0p7_g,MAGERR_GAAP_0p7_i,MAGERR_GAAP_0p7_r,MAGERR_GAAP_0p7_u,MAGERR_GAAP_1p0_H,MAGERR_GAAP_1p0_J,MAGERR_GAAP_1p0_Ks,MAGERR_GAAP_1p0_Y,MAGERR_GAAP_1p0_Z,MAGERR_GAAP_1p0_g,MAGERR_GAAP_1p0_i,MAGERR_GAAP_1p0_r,MAGERR_GAAP_1p0_u,MAGERR_GAAP_H,MAGERR_GAAP_J,MAGERR_GAAP_Ks,MAGERR_GAAP_Y,MAGERR_GAAP_Z,MAGERR_GAAP_g,MAGERR_GAAP_i,MAGERR_GAAP_r,MAGERR_GAAP_u,MAGERR_ISO,MAGERR_ISOCOR,MAGGERR_APER_30,MAG_APER_10,MAG_APER_100,MAG_APER_14,MAG_APER_20,MAG_APER_30,MAG_APER_4,MAG_APER_40,MAG_APER_6,MAG_APER_60,MAG_APER_8,MAG_AUTO,MAG_GAAP_0p7_H,MAG_GAAP_0p7_J,MAG_GAAP_0p7_Ks,MAG_GAAP_0p7_Y,MAG_GAAP_0p7_Z,MAG_GAAP_0p7_g,MAG_GAAP_0p7_i,MAG_GAAP_0p7_r,MAG_GAAP_0p7_u,MAG_GAAP_1p0_H,MAG_GAAP_1p0_J,MAG_GAAP_1p0_Ks,MAG_GAAP_1p0_Y,MAG_GAAP_1p0_Z,MAG_GAAP_1p0_g,MAG_GAAP_1p0_i,MAG_GAAP_1p0_r,MAG_GAAP_1p0_u,MAG_GAAP_H,MAG_GAAP_J,MAG_GAAP_Ks,MAG_GAAP_Y,MAG_GAAP_Z,MAG_GAAP_g,MAG_GAAP_i,MAG_GAAP_r,MAG_GAAP_u,MAG_ISO,MAG_ISOCOR,MAG_LIM_H,MAG_LIM_J,MAG_LIM_Ks,MAG_LIM_Y,MAG_LIM_Z,MAG_LIM_g,MAG_LIM_i,MAG_LIM_r,MAG_LIM_u,MASK,MU_MAX,MU_THRESHOLD,M_0,MaxVal,NBPZ_FILT,NBPZ_FLAGFILT,NBPZ_NONDETFILT,NIMAFLAGS_ISO,ODDS,PAgaap,RAJ2000,SG2DPHOT,SG_FLAG,SID,SLID,S_ELLIPTICITY,S_ELONGATION,SeqNr,THELI_NAME,THETA_J2000,THETA_WORLD,T_B,T_ML,X2_WORLD,XMAX_IMAGE,XMIN_IMAGE,XY_WORLD,X_WORLD,Xpos,Y2_WORLD,YMAX_IMAGE,YMIN_IMAGE,Y_WORLD,Ypos,Z_B,Z_B_MAX,Z_B_MIN,Z_ML +0.03316526114940643,5.079035,1.023542,6.084905908210203e-05,0.7300000190734863,0.7300000190734863,1.0199999809265137,511,0,0,0.7522829999999999,4.469737905310467e-05,-0.0017154590459540486,0.7200000286102295,0.7200000286102295,1.0099999904632568,0.729,0.464847594499588,0.2999153137207031,0.49968910217285156,0.14684677124023438,0.406768798828125,1.3296089172363281,0.9521522521972656,0.38743019104003906,-0.6200618743896484,0.0036126889754086733,-0.000762108713388443,0.002087776083499193,-28.686515,-28.686515,0.15672509372234344,9.317543117504101e-06,0.11101970076560974,6.595674221898662e-06,8.399833313887939e-05,-2.136586954293307e-05,4.6321190893650055e-05,14.778429985046387,75.22157287597656,4.632118993930234e-11,1.0683040389813936e-11,8.39983291256452e-11,0.007836037315428257,0.012345454655587673,0.005248666275292635,0.01899869367480278,0.022029614076018333,0.057601768523454666,0.02961180917918682,0.03984864056110382,0.07392487674951553,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1980980932712555,1.9727469682693481,0.2766576111316681,0.39451149106025696,0.5913798809051514,0.08062147349119186,0.7879332900047302,0.11983469873666763,1.1810959577560425,0.15883159637451172,0.2735537886619568,196.6279754638672,124.66181182861328,238.99668884277344,158.6905059814453,69.5469970703125,2.6999999458432455e-11,1.7100000582193076e-10,4.109999840462564e-11,6.479999870023789e-11,251.62139892578125,156.7567138671875,308.53338623046875,190.8169403076172,85.86070251464844,3.0600001699188084e-11,2.0700000047391143e-10,4.609999881832749e-11,7.229999932079068e-11,196.6279754638672,124.66181182861328,238.99668884277344,158.6905059814453,69.5469970703125,2.6999999458432455e-11,1.7100000582193076e-10,4.109999840462564e-11,6.479999870023789e-11,0.0746077224612236,0.1772087961435318,1.596519947052002,2.49216890335083,2.030400037765503,2.7329230308532715,4.337295055389404,0.5427271127700806,4.349409103393555,0.908402681350708,3.3192410469055176,1.28159499168396,1.8628959655761719,2737.440185546875,1720.6212158203125,3617.1357421875,1493.7296142578125,1024.1282958984375,7.939399832013194e-11,4.504099870850098e-10,3.074500098954047e-10,1.2166000151747625e-10,3256.905029296875,2114.560302734375,4415.322265625,1885.77685546875,1198.38671875,9.303999931598028e-11,3.9882999680607156e-10,3.5764000094751225e-10,9.228499908697785e-11,2737.440185546875,1720.6212158203125,3617.1357421875,1493.7296142578125,1024.1282958984375,7.939399832013194e-11,4.504099870850098e-10,3.074500098954047e-10,1.2166000151747625e-10,0.49366798996925354,1.1097660064697266,3.0711519718170166,4.069960117340088,0.00024193650460802019,2,1405256194,KiDSDR4 J002018.968-284111.45,0,8,7,7,6,5,4,4,3,2.826913991782476e-08,KIDS_5.6_-28.2,7.95773983001709,0.13475219905376434,0.8596541881561279,0.14797580242156982,0.15676969289779663,0.16132399439811707,0.19673840701580048,0.14326299726963043,0.3864349126815796,0.1345909982919693,0.15947189927101135,0.07798749953508377,0.0786634013056755,0.07173839956521988,0.11534599959850311,0.0737306997179985,0.3692328929901123,0.41220420598983765,0.14514149725437164,0.5782977342605591,0.08388160169124603,0.08048789948225021,0.07586889714002609,0.10986299812793732,0.07778959721326828,0.3570886552333832,0.5635167360305786,0.13995201885700226,0.8506119847297668,0.07798749953508377,0.0786634013056755,0.07173839956521988,0.11534599959850311,0.0737306997179985,0.3692328929901123,0.41220420598983765,0.14514149725437164,0.5782977342605591,0.16412639617919922,0.17341390252113342,0.1480734944343567,24.15205955505371,23.668560028076172,23.891050338745117,23.568429946899414,23.06694984436035,25.323549270629883,23.063919067382812,24.764299392700195,23.35740089416504,24.3906192779541,23.984529495239258,21.406600952148438,21.91080093383789,21.10409927368164,22.064300537109375,22.47410011291504,25.178863525390625,23.433834075927734,23.831501007080078,24.575124740600586,21.218000411987305,21.686899185180664,20.88759994506836,21.81130027770996,22.303499221801758,25.00748062133789,23.570972442626953,23.669971466064453,24.882030487060547,21.398765563964844,21.898454666137695,21.09885025024414,22.04530143737793,22.452070236206055,25.121261596679688,23.40422248840332,23.79165267944336,24.50119972229004,25.426410675048828,24.546920776367188,24.265886306762695,24.760665893554688,24.054019927978516,24.49862289428711,25.394304275512695,26.34992218017578,24.485366821289062,26.016332626342773,25.259056091308594,0,24.143320083618164,25.12795066833496,23.523,0.07370539754629135,9,0,0,0,0.61812,-76.69999694824219,5.079035,0,1.0,4343,60513621,0.2650201916694641,1.3605819940567017,4344,KIDS_5p6_m28p2,13.277409553527832,76.72258758544922,1.6360000000000001,1.6360000000000001,2.0877759521198413e-09,18819,18817,3.8105821276168683e-10,5.079035,18817.859375,3.6126890368137765e-09,2168,2165,-28.686515,2166.279052734375,0.7899999999999999,0.97,0.6699999999999999,0.7799999999999999 +0.0331641286611557,5.127818,2.087884,0.00012409189366735518,0.8299999833106995,0.8299999833106995,1.100000023841858,511,0,0,1.929386,0.00011468859884189442,0.0009604087099432945,0.8100000023841858,0.8100000023841858,1.0800000429153442,3.303,0.017473550513386726,0.4565296173095703,0.1604766845703125,0.12378120422363281,0.1814556121826172,0.7199001312255859,0.5032062530517578,0.6213703155517578,0.6133289337158203,0.01324538979679346,-0.0008897571824491024,0.01530689001083374,-28.686661,-28.686661,0.08034873753786087,4.775493835040834e-06,0.07493723183870316,4.454465852177236e-06,1.9969149434473366e-05,-1.1997229876214988e-06,2.2678470486425795e-05,78.05769348144531,11.942299842834473,2.267847021286684e-11,5.998674864129971e-13,1.9969149597787172e-11,0.008384065702557564,0.013208858668804169,0.005615742411464453,0.020327404141426086,0.02357029914855957,0.061630260199308395,0.031682759523391724,0.04263553023338318,0.07909496128559113,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.2021384984254837,1.967947006225586,0.27962151169776917,0.39648279547691345,0.5924813747406006,0.08512426912784576,0.7888457775115967,0.12468740344047546,1.1816530227661133,0.16327069699764252,0.40961921215057373,251.87571716308594,167.1168975830078,208.3955841064453,143.0128631591797,52.4952278137207,2.730000080164441e-11,1.340000055360946e-10,4.210000056903418e-11,6.539999791721485e-11,309.8416748046875,204.4779510498047,258.7093811035156,170.1577606201172,63.23879623413086,3.13000007856612e-11,1.5999999936067155e-10,4.7899999938705307e-11,7.429999671071386e-11,251.87571716308594,167.1168975830078,208.3955841064453,143.0128631591797,52.4952278137207,2.730000080164441e-11,1.340000055360946e-10,4.210000056903418e-11,6.539999791721485e-11,0.18546420335769653,0.29874908924102783,5.327457904815674,5.995962142944336,6.273825168609619,6.970154762268066,7.856791973114014,1.679190993309021,7.93869686126709,3.189857006072998,6.079957008361816,4.419428825378418,7.018610000610352,4051.90087890625,3479.613037109375,6185.0205078125,3084.215087890625,2601.79443359375,4.301299871833919e-10,1.7293999565737295e-09,9.510400245105188e-10,2.114200065017613e-10,4348.30419921875,3868.227783203125,6566.3017578125,3274.38037109375,2917.63671875,4.848499934873018e-10,1.8596999495912314e-09,9.914600251903494e-10,2.552000000211052e-10,4051.90087890625,3479.613037109375,6185.0205078125,3084.215087890625,2601.79443359375,4.301299871833919e-10,1.7293999565737295e-09,9.510400245105188e-10,2.114200065017613e-10,5.152454853057861,6.596183776855469,3.2383029460906982,7.050258159637451,0.00041909870924428105,0,1940157430,KiDSDR4 J002030.676-284111.97,0,59,57,50,42,30,24,15,5,2.0848490578373458e-07,KIDS_5.6_-28.2,5.154382228851318,0.041205838322639465,0.35643818974494934,0.04840252920985222,0.0617748498916626,0.05505327880382538,0.10791269689798355,0.042450349777936935,0.21106639504432678,0.040121011435985565,0.06338100135326385,0.06749189645051956,0.0521451011300087,0.036582399159669876,0.0503447987139225,0.021906400099396706,0.06891079246997833,0.08412666618824005,0.04806263744831085,0.33585819602012634,0.07736489921808243,0.05739299952983856,0.04277750104665756,0.05642180144786835,0.02353299967944622,0.07009083777666092,0.09341172873973846,0.05245472490787506,0.31610578298568726,0.06749189645051956,0.0521451011300087,0.036582399159669876,0.0503447987139225,0.021906400099396706,0.06891079246997833,0.08412666618824005,0.04806263744831085,0.33585819602012634,0.039090901613235474,0.04918624088168144,0.08189535140991211,22.843700408935547,22.715349197387695,22.666170120239258,22.551889419555664,22.421890258789062,24.09724998474121,22.410629272460938,23.400569915771484,22.70025062561035,23.04659080505371,22.544370651245117,20.980899810791016,21.14620018005371,20.5216007232666,21.277099609375,21.46179962158203,23.344335556030273,21.97311782836914,22.605440139770508,23.975130081176758,20.904199600219727,21.031200408935547,20.45669937133789,21.212200164794922,21.337400436401367,23.215137481689453,21.899335861206055,22.562896728515625,23.77765655517578,20.972515106201172,21.132991790771484,20.5159854888916,21.256772994995117,21.438228607177734,23.282705307006836,21.941434860229492,22.56280517578125,23.896034240722656,22.879959106445312,22.611770629882812,23.997034072875977,24.44244956970215,24.202777862548828,24.611562728881836,25.69969940185547,26.33792495727539,24.750093460083008,25.990232467651367,25.24905014038086,12292,23.234149932861328,25.12795066833496,21.844,0.17028109729290009,9,0,0,0,0.95672,-11.699999809265137,5.127818,0,1.0,4349,60513621,0.07591354846954346,1.0821499824523926,4350,KIDS_5p6_m28p2,78.32723999023438,11.672760009765625,2.818,2.818,1.530688997775087e-08,18102,18093,4.44882991557094e-10,5.127818,18097.859375,1.3245379903992216e-08,2171,2162,-28.686661,2167.06591796875,0.8300000000000001,0.92,0.7899999999999999,0.8300000000000001 +0.03320556879043579,5.171088,2.6607149999999997,0.0001581599935889244,0.8999999761581421,0.8999999761581421,1.149999976158142,511,0,0,2.431581,0.00014451940660364926,-0.0012118120212107897,0.8700000047683716,0.8700000047683716,1.1299999952316284,4.211,0.023555999621748924,0.26761817932128906,0.28167724609375,0.21369171142578125,0.12752342224121094,0.5717144012451172,0.3171119689941406,0.5846939086914062,0.40755653381347656,0.02248905971646309,0.004024359863251448,0.02341138944029808,-28.68675,-28.68675,0.06320922076702118,3.757583954211441e-06,0.0549326092004776,3.264565066274372e-06,1.1484959941299167e-05,2.953092916868627e-06,1.3291860341269057e-05,-60.73038101196289,-29.269620895385742,1.3291859800312888e-11,-1.4765609524999834e-12,1.1484959684671114e-11,0.008726082742214203,0.01374769676476717,0.005844829138368368,0.021156635135412216,0.02453181892633438,0.06414438784122467,0.03297523036599159,0.04437479004263878,0.08232153952121735,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.20699100196361542,1.980178952217102,0.2839707136154175,0.4002367854118347,0.5956223011016846,0.08929155021905899,0.792570173740387,0.12924690544605255,1.1906169652938843,0.16821430623531342,0.4653717875480652,266.2980041503906,146.86647033691406,284.1306457519531,170.8724822998047,77.06451416015625,2.7900000018621363e-11,1.4100000333971963e-10,4.289999952500345e-11,6.510000177817332e-11,325.5726623535156,176.05889892578125,346.78216552734375,201.66734313964844,91.30030822753906,3.199999987213431e-11,1.660000054082289e-10,4.879999876417074e-11,7.420000031066465e-11,266.2980041503906,146.86647033691406,284.1306457519531,170.8724822998047,77.06451416015625,2.7900000018621363e-11,1.4100000333971963e-10,4.289999952500345e-11,6.510000177817332e-11,0.2510314881801605,0.35853201150894165,10.1139497756958,9.025279998779297,12.638589859008789,14.521349906921387,15.874529838562012,3.0002949237823486,16.144920349121094,5.660746097564697,17.23090934753418,8.114038467407227,15.060689926147461,7332.3759765625,5630.73046875,9407.111328125,4593.22998046875,4071.43408203125,9.458900329661901e-10,3.211299892669217e-09,1.8258999867626358e-09,5.615800047209518e-10,7973.56201171875,6089.32763671875,9826.095703125,4967.423828125,4375.4306640625,1.038599983793631e-09,3.5336999992807705e-09,1.9852999244562852e-09,6.130200236320604e-10,7332.3759765625,5630.73046875,9407.111328125,4593.22998046875,4071.43408203125,9.458900329661901e-10,3.211299892669217e-09,1.8258999867626358e-09,5.615800047209518e-10,12.042059898376465,14.088139533996582,3.7381560802459717,7.203877925872803,0.00042823050171136856,0,1641070272,KiDSDR4 J002041.061-284112.29,0,109,104,87,64,49,35,20,11,3.851669987398054e-07,KIDS_5.6_-28.2,4.601593971252441,0.022225959226489067,0.2382722944021225,0.024400850757956505,0.029932279139757156,0.03232036158442497,0.053312819451093674,0.02479569986462593,0.07504016906023026,0.022514160722494125,0.03355715051293373,0.03943189978599548,0.02831929922103882,0.032793398946523666,0.04039039835333824,0.02055089920759201,0.03202490508556366,0.04767191410064697,0.025509655475616455,0.12586171925067902,0.04433229938149452,0.03139159828424454,0.03831779956817627,0.04407870024442673,0.022655600681900978,0.03345229849219322,0.051003821194171906,0.026688121259212494,0.13141760230064392,0.03943189978599548,0.02831929922103882,0.032793398946523666,0.04039039835333824,0.02055089920759201,0.03202490508556366,0.04767191410064697,0.025509655475616455,0.12586171925067902,0.022638989612460136,0.027637850493192673,0.04074741154909134,22.1476993560791,22.271350860595703,21.905750274658203,21.754980087280273,21.65825080871582,23.467090606689453,21.639909744262695,22.777809143066406,21.569229125976562,22.38690948486328,21.715389251708984,20.33690071105957,20.623600006103516,20.0664005279541,20.84469985961914,20.97559928894043,22.488731384277344,21.30115509033203,21.897247314453125,22.914464950561523,20.245899200439453,20.53860092163086,20.018999099731445,20.759700775146484,20.89739990234375,22.38803482055664,21.202369689941406,21.80902099609375,22.826169967651367,20.328174591064453,20.609851837158203,20.060556411743164,20.823543548583984,20.951066970825195,22.42458724975586,21.268178939819336,21.852872848510742,22.832143783569336,21.958250045776367,21.787870407104492,23.936580657958984,24.582693099975586,23.8662052154541,24.418319702148438,25.28286361694336,26.31432342529297,24.694807052612305,25.96979331970215,25.254039764404297,16,22.62466049194336,25.12795066833496,21.049,0.2985140085220337,9,0,0,0,0.99565,38.5,5.171088,0,1.0,4358,60513621,0.08611738681793213,1.0942319631576538,4359,KIDS_5p6_m28p2,-51.45418167114258,-38.54581832885742,3.364,3.364,2.3411390159822076e-08,17466,17453,-2.012199962209138e-09,5.171088,17459.23046875,2.2489059503527642e-08,2174,2163,-28.68675,2168.2099609375,0.8600000000000001,0.89,0.7899999999999999,0.8600000000000001 +0.025127040222287178,5.912251,201.661499,0.011986199766397476,2.0,2.0,2.0,510,0,1,102.667236,0.006104231812059879,0.20623379945755005,2.0,2.0,2.0,222.029,0.0003681149100884795,-0.9134559631347656,0.07864570617675781,-0.4123420715332031,0.9540748596191406,0.3177051544189453,0.9476261138916016,0.001316070556640625,,38.00328826904297,17.704729080200195,142.92750549316406,-28.648329,-28.648329,0.0652417466044426,3.877772087435005e-06,0.030923010781407356,1.8386889450994204e-06,3.465592044449295e-06,1.981326022360008e-06,1.4952300261938944e-05,-85.1066665649414,-4.893333911895752,1.4952299814963155e-11,-9.906730383951734e-13,3.4655919627091247e-12,0.006526535842567682,0.010282372124493122,0.004371547605842352,0.015823770314455032,0.01834818534553051,0.04797577112913132,0.02466329000890255,0.03318941965699196,0.061571091413497925,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.23805120587348938,2.215264081954956,0.35368359088897705,0.525692880153656,0.8124848008155823,0.08366984128952026,1.0661189556121826,0.1278619021177292,1.4753819704055786,0.18171200156211853,17.696800231933594,855.2486572265625,400.5097961425781,950.0929565429688,484.01983642578125,235.7167205810547,3.769999937230928e-11,2.2299999347108468e-10,6.559999765620717e-11,,855.2486572265625,400.5097961425781,950.0929565429688,484.01983642578125,235.7167205810547,3.769999937230928e-11,2.2299999347108468e-10,6.559999765620717e-11,,855.2486572265625,400.5097961425781,950.0929565429688,484.01983642578125,235.7167205810547,3.769999937230928e-11,2.2299999347108468e-10,6.559999765620717e-11,,11.132800102233887,12.957690238952637,15.784859657287598,1704.470947265625,32.00090026855469,66.90850830078125,152.60589599609375,2.4939560890197754,275.4986877441406,5.55715799331665,624.2496948242188,9.973380088806152,66054.453125,23248.056640625,21549.865234375,10043.4482421875,31343.283203125,12986.73828125,3.6842000561421173e-09,5.742299968858333e-09,5.602499797419114e-09,,23248.056640625,21549.865234375,10043.4482421875,31343.283203125,12986.73828125,3.6842000561421173e-09,5.742299968858333e-09,5.602499797419114e-09,,23248.056640625,21549.865234375,10043.4482421875,31343.283203125,12986.73828125,3.6842000561421173e-09,5.742299968858333e-09,5.602499797419114e-09,,44497.80859375,47288.671875,221.34500122070312,863.8519287109375,0.051351189613342285,145,1800316701,KiDSDR4 J002338.940-283853.98,1,-31269,2976,12006,-21012,-30571,8706,657,34,0.0010474099544808269,KIDS_5.6_-28.2,3.6439590454101562,0.016377950087189674,0.0014114510267972946,0.012002799659967422,0.008532585576176643,0.03643425926566124,0.004202578216791153,0.02498723939061165,0.002566705923527479,0.019786600023508072,0.00029095279751345515,0.039942000061273575,0.020178699865937233,0.10270900279283524,0.0167664997279644,0.01970669999718666,0.0111102145165205,0.042164143174886703,0.012712948024272919,,0.039942000061273575,0.020178699865937233,0.10270900279283524,0.0167664997279644,0.01970669999718666,0.0111102145165205,0.042164143174886703,0.012712948024272919,,0.039942000061273575,0.020178699865937233,0.10270900279283524,0.0167664997279644,0.01970669999718666,0.0111102145165205,0.042164143174886703,0.012712948024272919,,0.0002717036986723542,0.0002975777897518128,0.00578194297850132,21.664400100708008,16.581029891967773,20.897090911865234,20.09630012512207,19.20107078552246,23.66777992248535,18.55970001220703,22.797870635986328,17.671600341796875,22.16288948059082,12.61023998260498,19.083999633789062,19.166400909423828,19.99530029296875,18.759599685668945,19.71619987487793,21.012474060058594,20.670141220092773,20.679983139038086,,19.083999633789062,19.166400909423828,19.99530029296875,18.759599685668945,19.71619987487793,21.013296127319336,20.675228118896484,20.68263053894043,,19.077472686767578,19.156118392944336,19.990928649902344,18.743776321411133,19.697851181030273,20.96449851989746,20.645477294921875,20.646793365478516,,13.03915023803711,12.97311019897461,22.669769287109375,23.493467330932617,22.555583953857422,23.287841796875,24.06902313232422,25.98748016357422,24.197093963623047,25.508678436279297,24.940444946289062,14356,20.47719955444336,25.12795066833496,12.547,2.1574931144714355,8,0,1,822,1.0,4.800000190734863,5.912251,0,1.0,4359,60513621,0.4908931851387024,1.9642239809036255,4360,KIDS_5p6_m28p2,-85.21106719970703,-4.788931846618652,1.0,1.0,0.00014292749983724207,7492,5552,-8.852452083374374e-06,5.912251,6519.47998046875,3.800329068326391e-05,3196,2168,-28.648329,2823.85302734375,0.01,0.04,0.01,0.01 +0.042013488709926605,6.206854,3.289606,0.00019556870392989367,0.9900000095367432,0.9900000095367432,1.2200000286102295,511,0,0,2.669323,0.0001586083963047713,0.00567405391484499,0.8999999761581421,0.8999999761581421,1.149999976158142,1.1,0.013172520324587822,-0.266632080078125,0.405914306640625,0.09042930603027344,-0.15038299560546875,0.5065250396728516,0.16477203369140625,0.12359428405761719,0.813262939453125,0.027990849688649178,-0.010782940313220024,0.03541288897395134,-28.686387,-28.686387,0.07346581667661667,4.36771097156452e-06,0.05782262980937958,3.4355250591033837e-06,1.3084840247756802e-05,-5.543181032408029e-06,1.779488957254216e-05,65.17716979980469,24.822830200195312,1.7794890561084742e-11,2.771618004548948e-12,1.3084839635413292e-11,0.007971487008035183,0.012558851391077042,0.005339391995221376,0.01932709477841854,0.022410405799746513,0.05859743058681488,0.03012366034090519,0.04053743928670883,0.07520270347595215,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.2625320851802826,2.757617950439453,0.36180469393730164,0.5104584097862244,0.7598472237586975,0.11131899803876877,1.010071039199829,0.16186439990997314,1.5659099817276,0.2128363996744156,0.9226744771003723,377.9237060546875,172.92108154296875,490.3476867675781,239.10488891601562,113.69266510009766,3.529999903495451e-11,1.4699999550948917e-10,5.740000141862822e-11,7.070000140885213e-11,449.18890380859375,202.87725830078125,569.6578979492188,271.0382385253906,127.95698547363281,4.009999970966405e-11,1.7100000582193076e-10,6.530000151716564e-11,7.999999968033578e-11,377.9237060546875,172.92108154296875,490.3476867675781,239.10488891601562,113.69266510009766,3.529999903495451e-11,1.4699999550948917e-10,5.740000141862822e-11,7.070000140885213e-11,0.34884360432624817,0.5749511122703552,9.5691499710083,60.65951919555664,13.21718978881836,16.888919830322266,21.595380783081055,2.4568400382995605,26.476560592651367,4.867195129394531,36.438621520996094,7.279531002044678,24.22311019897461,3070.866943359375,2104.077880859375,2408.064208984375,1923.9056396484375,2203.45068359375,9.594499639220544e-10,2.0010999524089357e-09,1.7414000241799954e-09,3.9258998829616587e-10,3382.674072265625,2345.5068359375,2576.024169921875,2025.1239013671875,2325.28173828125,1.0473999445537174e-09,2.1263999450127358e-09,1.92710003510399e-09,4.266300090982611e-10,3070.866943359375,2104.077880859375,2408.064208984375,1923.9056396484375,2203.45068359375,9.594499639220544e-10,2.0010999524089357e-09,1.7414000241799954e-09,3.9258998829616587e-10,13.420519828796387,17.619949340820312,6.339869022369385,10.838139533996582,0.00064426742028445,0,-1276785327,KiDSDR4 J002449.644-284110.99,0,136,128,112,89,63,38,20,8,4.805752951142495e-07,KIDS_5.6_-28.2,6.1619791984558105,0.029794689267873764,0.04937019944190979,0.029727939516305923,0.03282376006245613,0.04920646920800209,0.04143049940466881,0.036116231232881546,0.046669669449329376,0.0317520909011364,0.041366469115018845,0.13361899554729462,0.08922989666461945,0.22108599543571472,0.13493600487709045,0.056021299213171005,0.039946310222148895,0.07975773513317108,0.03578801825642586,0.19552600383758545,0.14417600631713867,0.09391199797391891,0.2400979995727539,0.14531299471855164,0.059746500104665756,0.04156770929694176,0.08731231093406677,0.03679029271006584,0.20359301567077637,0.13361899554729462,0.08922989666461945,0.22108599543571472,0.13493600487709045,0.056021299213171005,0.039946310222148895,0.07975773513317108,0.03578801825642586,0.19552600383758545,0.028228729963302612,0.035436928272247314,0.03821159154176712,22.207820892333984,20.202749252319336,21.857149124145508,21.590999603271484,21.324100494384766,23.684059143066406,21.10284996032715,22.94179916381836,20.756099700927734,22.50473976135254,21.199420928955078,21.28179931640625,21.69230079650879,21.545799255371094,21.789499282836914,21.642200469970703,22.473278045654297,21.81468391418457,21.948692321777344,23.303146362304688,21.176799774169922,21.574399948120117,21.47260093688965,21.73390007019043,21.583799362182617,22.378873825073242,21.753829956054688,21.841323852539062,23.219728469848633,21.273828506469727,21.67974281311035,21.54046058654785,21.770172119140625,21.619789123535156,22.41468048095703,21.784561157226562,21.90815544128418,23.227943420410156,21.840579986572266,21.54499053955078,23.556489944458008,24.405380249023438,23.273738861083984,24.05352783203125,24.860668182373047,26.058897018432617,24.64956283569336,25.653657913208008,25.164445877075195,0,22.76590919494629,25.12795066833496,21.001,0.2620980143547058,9,0,0,0,0.84319,-27.700000762939453,6.206854,0,1.0,4363,60513621,0.18855850398540497,1.2323750257492065,4364,KIDS_5p6_m28p2,62.26993942260742,27.730060577392578,5.455,5.455,3.541288862152214e-08,2182,2166,5.391522783781966e-09,6.206854,2172.93798828125,2.7990850526293798e-08,2175,2162,-28.686387,2168.39208984375,0.27,0.35,0.23,0.27 diff --git a/astroquery/eso/tests/test_eso_catalogues.py b/astroquery/eso/tests/test_eso_catalogues.py index 8de1514b4b..b606d935b8 100644 --- a/astroquery/eso/tests/test_eso_catalogues.py +++ b/astroquery/eso/tests/test_eso_catalogues.py @@ -51,6 +51,9 @@ def data_path(filename): "LEFT OUTER JOIN TAP_SCHEMA.key_columns AS kc ON k.key_id = kc.key_id " "WHERE schema_name='safcat'": "query_list_catalogues_all_versions.csv", + + "SELECT * FROM KiDS_DR4_1_ugriZYJHKs_cat_fits": + "kids_dr4_sample.csv", } } @@ -289,4 +292,11 @@ def test_list_catalogues_all_versions(monkeypatch): monkeypatch.setattr(eso, 'query_tap', monkey_tap) saved_list = eso.list_catalogues(all_versions=True) assert isinstance(saved_list, list) - assert len(saved_list) >= len(catalogue_list_all) \ No newline at end of file + assert len(saved_list) >= len(catalogue_list_all) + +def test_query_catalogues(monkeypatch): + eso = Eso() + monkeypatch.setattr(eso, 'query_tap', monkey_tap) + result = eso.query_catalogue("KiDS_DR4_1_ugriZYJHKs_cat_fits", ROW_LIMIT=5) + assert isinstance(result, Table) + assert len(result) <= 5 \ No newline at end of file