From 6c70986869213b551fe810849400224e30a7cc26 Mon Sep 17 00:00:00 2001 From: Enriquerzrz Date: Tue, 26 May 2026 14:29:00 +0200 Subject: [PATCH 1/6] [EUCLIDPCR-2075] update get_product_list get_scientific_product_list get_tile_catalogue_list methods for TAP 10 array handling --- CHANGES.rst | 2 ++ astroquery/esa/euclid/core.py | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 671795e4bd..43cbfd8bb5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -60,6 +60,8 @@ esa.euclid BASIC_DOWNLOAD_DATA_PRODUCTS. [#3562] - The method ``get_spectrum`` accepts a single source_id or designation or multiple values separated by commas or a list. [#3570] +- Removed unnecessary CAST(... AS text) from array columns in ``get_product_list``, ``get_scientific_product_list`` and + ``__get_tile_catalogue_list``, as TAP 10.x now returns proper arrays. [#] vizier diff --git a/astroquery/esa/euclid/core.py b/astroquery/esa/euclid/core.py index 449a83fb43..cd5e4abab4 100644 --- a/astroquery/esa/euclid/core.py +++ b/astroquery/esa/euclid/core.py @@ -1015,10 +1015,10 @@ def __get_tile_catalogue_list(self, *, tile_index, product_type, verbose=False): if product_type in conf.BASIC_DOWNLOAD_DATA_PRODUCTS: query = ( f"SELECT basic_download_data.basic_download_data_oid, basic_download_data.product_type, " - f"basic_download_data.product_id, CAST(basic_download_data.observation_id_list as text) AS " - f"observation_id_list, CAST(basic_download_data.tile_index_list as text) AS tile_index_list, " - f"CAST(basic_download_data.patch_id_list as text) AS patch_id_list, " - f"CAST(basic_download_data.filter_name as text) AS filter_name, basic_download_data.release_name FROM " + f"basic_download_data.product_id, basic_download_data.observation_id_list AS " + f"observation_id_list, basic_download_data.tile_index_list AS tile_index_list, " + f"basic_download_data.patch_id_list AS patch_id_list, " + f"basic_download_data.filter_name AS filter_name, basic_download_data.release_name FROM " f"sedm.basic_download_data WHERE '{tile_index}'=ANY(tile_index_list) AND product_type = '" f"{product_type}' " f"ORDER BY observation_id_list ASC;") @@ -1036,7 +1036,7 @@ def __get_tile_catalogue_list(self, *, tile_index, product_type, verbose=False): f"SELECT mer_segmentation_map.file_name, mer_segmentation_map.segmentation_map_oid, " f"mer_segmentation_map.ra, mer_segmentation_map.dec, mer_segmentation_map.stc_s, " f"mer_segmentation_map.tile_index, " - f"CAST(mer_segmentation_map.observation_id_list as TEXT) AS observation_id_list, " + f"mer_segmentation_map.observation_id_list AS observation_id_list, " f"mer_segmentation_map.product_type, mer_segmentation_map.product_id FROM sedm.mer_segmentation_map " f"WHERE mer_segmentation_map.tile_index = '{tile_index}' AND " f"mer_segmentation_map.product_type = '{product_type}';") @@ -1189,12 +1189,12 @@ def get_product_list(self, *, observation_id=None, tile_index=None, product_type extra_condition = '' if dsr_condition is None else f'AND {dsr_condition}' query = ( - f"SELECT CAST(basic_download_data.file_name_list AS text) AS file_name_list, " + f"SELECT basic_download_data.file_name_list AS file_name_list, " f"basic_download_data.basic_download_data_oid, basic_download_data.product_type, " - f"basic_download_data.product_id, CAST(basic_download_data.observation_id_list as text) AS " - f"observation_id_list, CAST(basic_download_data.tile_index_list as text) AS tile_index_list, " - f"CAST(basic_download_data.patch_id_list as text) AS patch_id_list, " - f"CAST(basic_download_data.filter_name as text) AS filter_name, basic_download_data.release_name, " + f"basic_download_data.product_id, basic_download_data.observation_id_list AS " + f"observation_id_list, basic_download_data.tile_index_list AS tile_index_list, " + f"basic_download_data.patch_id_list AS patch_id_list, " + f"basic_download_data.filter_name AS filter_name, basic_download_data.release_name, " f"basic_download_data.{self.dsr_1}, basic_download_data.{self.dsr_2}, basic_download_data.{self.dsr_3} " f"FROM {table} WHERE '{observation_id}'=ANY(observation_id_list) AND product_type = '" f"{product_type}' {extra_condition}" @@ -1216,7 +1216,7 @@ def get_product_list(self, *, observation_id=None, tile_index=None, product_type f"mer_segmentation_map.{self.dsr_2}, mer_segmentation_map.{self.dsr_3} FROM {table} " f"WHERE ( observation_id_list = '{observation_id}' OR observation_id_list like '{observation_id}," f"%' OR observation_id_list " - f"like '%,{observation_id}' OR CAST(observation_id_list as TEXT) like '%,{observation_id},%' ) AND " + f"like '%,{observation_id}' OR observation_id_list like '%,{observation_id},%' ) AND " f"mer_segmentation_map.product_type = '{product_type}' {extra_condition};") if product_type in conf.RAW_FRAME_PRODUCTS: @@ -1842,10 +1842,10 @@ def get_scientific_product_list(self, *, observation_id=None, tile_index=None, c table = 'sedm.basic_download_data' query = ( f"SELECT basic_download_data.basic_download_data_oid, basic_download_data.product_type, " - f"basic_download_data.product_id, CAST(basic_download_data.observation_id_list as text) AS " - f"observation_id_list, CAST(basic_download_data.tile_index_list as text) AS tile_index_list, " - f"CAST(basic_download_data.patch_id_list as text) AS patch_id_list, " - f"CAST(basic_download_data.filter_name as text) AS filter_name, " + f"basic_download_data.product_id, basic_download_data.observation_id_list AS " + f"observation_id_list, basic_download_data.tile_index_list AS tile_index_list, " + f"basic_download_data.patch_id_list AS patch_id_list, " + f"basic_download_data.filter_name AS filter_name, " f"basic_download_data.data_set_release_part1, basic_download_data.data_set_release_part2, " f"basic_download_data.data_set_release_part3 FROM {table} WHERE " f"release_name='{dataset_release}' {query_extra_condition} {dsr_extra_condition} ORDER BY " From 7edf21d47307302e6a920b9abf0a1c89df202fce Mon Sep 17 00:00:00 2001 From: Enriquerzrz Date: Tue, 26 May 2026 14:52:37 +0200 Subject: [PATCH 2/6] [EUCLIDPCR-2075] added issue number at CHANGES.rst --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 43cbfd8bb5..8968383111 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -61,7 +61,7 @@ esa.euclid - The method ``get_spectrum`` accepts a single source_id or designation or multiple values separated by commas or a list. [#3570] - Removed unnecessary CAST(... AS text) from array columns in ``get_product_list``, ``get_scientific_product_list`` and - ``__get_tile_catalogue_list``, as TAP 10.x now returns proper arrays. [#] + ``__get_tile_catalogue_list``, as TAP 10.x now returns proper arrays. [#3599] vizier From d234ca5dbd6e2f1d68a7926d844fca789bda7991 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jun 2026 00:10:31 +0000 Subject: [PATCH 3/6] Bump the actions group with 2 updates Bumps the actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `actions/checkout` from 6.0.2 to 6.0.3 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10) Updates `codecov/codecov-action` from 6.0.0 to 6.0.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/57e3a136b779b570ffcdbf80b3bdc90e7fab3de2...e79a6962e0d4c0c17b229090214935d2e33f8354) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: codecov/codecov-action dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/ci_crontests.yml | 2 +- .github/workflows/ci_devtests.yml | 4 ++-- .github/workflows/ci_online_crontests.yml | 2 +- .github/workflows/ci_tests.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_crontests.yml b/.github/workflows/ci_crontests.yml index f516cb22b6..cb0b2ab82f 100644 --- a/.github/workflows/ci_crontests.yml +++ b/.github/workflows/ci_crontests.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 - name: Set up Python diff --git a/.github/workflows/ci_devtests.yml b/.github/workflows/ci_devtests.yml index e1a1ee58e9..584e76a7a8 100644 --- a/.github/workflows/ci_devtests.yml +++ b/.github/workflows/ci_devtests.yml @@ -44,7 +44,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 - name: Set up Python @@ -57,6 +57,6 @@ jobs: run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} - name: Upload coverage to codecov if: contains(matrix.toxenv,'-cov') - uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 + uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 with: file: ./coverage.xml diff --git a/.github/workflows/ci_online_crontests.yml b/.github/workflows/ci_online_crontests.yml index 17c861b8af..4103bbc011 100644 --- a/.github/workflows/ci_online_crontests.yml +++ b/.github/workflows/ci_online_crontests.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 - name: Set up Python diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 5f153498af..a6439c7dcc 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -63,7 +63,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 - name: Set up Python @@ -76,6 +76,6 @@ jobs: run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }} - name: Upload coverage to codecov if: contains(matrix.toxenv,'-cov') - uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 + uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 with: file: ./coverage.xml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c6e1bcb12d..fa888d2be7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 28a8b74382d2df0a69475feb0c4d6cd2d830bc48 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Wed, 3 Jun 2026 12:42:29 -0400 Subject: [PATCH 4/6] RTD: Fetch all tags for accurate version reporting [ci skip] --- .readthedocs.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index af212d9b64..347d54bfcc 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,6 +6,9 @@ build: python: "3.11" apt_packages: - graphviz + jobs: + post_checkout: + - git fetch --unshallow || true sphinx: builder: html From 2bc5fe86ac6e4bddd74588584ebafab262d3d764 Mon Sep 17 00:00:00 2001 From: Jorge Fernandez Hernandez Date: Thu, 28 May 2026 19:30:53 +0200 Subject: [PATCH 5/6] EUCLIDPCR-2131 refactor method get_scientific_product_list --- astroquery/esa/euclid/__init__.py | 2 +- astroquery/esa/euclid/core.py | 253 ++++++++---------- .../data/test_get_scientific_product_list.csv | 49 ++++ .../data/test_get_scientific_product_list.vot | 130 +++++++++ astroquery/esa/euclid/tests/test_euclidtap.py | 95 +++++-- docs/esa/euclid/euclid.rst | 13 - docs/esa/euclid/table_values.csv | 135 ---------- 7 files changed, 356 insertions(+), 321 deletions(-) create mode 100644 astroquery/esa/euclid/tests/data/test_get_scientific_product_list.csv create mode 100644 astroquery/esa/euclid/tests/data/test_get_scientific_product_list.vot delete mode 100644 docs/esa/euclid/table_values.csv diff --git a/astroquery/esa/euclid/__init__.py b/astroquery/esa/euclid/__init__.py index afdc2219cf..6539306dd8 100644 --- a/astroquery/esa/euclid/__init__.py +++ b/astroquery/esa/euclid/__init__.py @@ -69,7 +69,7 @@ class Conf(_config.ConfigNamespace): SIR_SCIENCE_FRAME_PRODUCTS = ['dpdSirScienceFrame'] - VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS = { + __VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS = { 'Clusters of Galaxies': { 'GrpCatalog': ['DpdLE3clAMICOModel', 'DpdLE3clDetMergeParams', 'DpdLE3clDetOnMockParams', 'DpdLE3clDetInputParams', 'DpdLE3clAmicoAux', 'DpdLE3clAssociations', 'DpdLE3clPzwavAux', diff --git a/astroquery/esa/euclid/core.py b/astroquery/esa/euclid/core.py index cd5e4abab4..5a0f8b29cc 100644 --- a/astroquery/esa/euclid/core.py +++ b/astroquery/esa/euclid/core.py @@ -15,18 +15,19 @@ from collections.abc import Iterable from datetime import datetime from datetime import timezone +from functools import cache from astropy import units from astropy import units as u from astropy.coordinates import Angle from astropy.units import Quantity from astropy.utils import deprecated_renamed_argument -from requests.exceptions import HTTPError - from astroquery import log from astroquery.utils import commons from astroquery.utils.tap import TapPlus from astroquery.utils.tap import taputils +from requests.exceptions import HTTPError + from . import conf @@ -1307,31 +1308,40 @@ def get_product_list(self, *, observation_id=None, tile_index=None, product_type format_with_results_compressed=('votable_gzip',)) return job.get_results() - def __get_data_set_release_by_env(self, dsr_1_value=None, dsr_2_value=None, dsr_3_value=None, - alias=None): + def __get_data_set_release_by_env(self, dsr_1_value=None, dsr_2_value=None, dsr_3_value=None, alias=None): + """ + Build a SQL WHERE clause for filtering dataset releases by environment values. + + Parameters: + dsr_1_value: Optional value for the first dataset release field. + dsr_2_value: Optional value for the second dataset release field. + dsr_3_value: Optional value for the third dataset release field. + If set to "latest", the clause filters on latest = true. + alias: Optional table alias prepended to field names. + + Returns: + A string containing SQL conditions joined with AND, or None if no + filter values are provided. + """ + + clauses = [] + + def build_key(field): + return ".".join(filter(None, [alias, str(field)])) - query = None if dsr_1_value is not None: - dsr_1_key = '.'.join(filter(None, [alias, self.dsr_1])) - query = f"{dsr_1_key} = '{dsr_1_value}'" + clauses.append(f"{build_key(self.dsr_1)} = '{dsr_1_value}'") if dsr_2_value is not None: - dsr_2_key = '.'.join(filter(None, [alias, self.dsr_2])) - subquery = f"{dsr_2_key} = '{dsr_2_value}'" - if query is not None: - query = f"{query} AND {subquery}" - else: - query = subquery + clauses.append(f"{build_key(self.dsr_2)} = '{dsr_2_value}'") if dsr_3_value is not None: - dsr_3_key = '.'.join(filter(None, [alias, str(self.dsr_3)])) - subquery = f"{dsr_3_key} = {dsr_3_value}" - if query is not None: - query = f"{query} AND {subquery}" + if dsr_3_value == "latest": + clauses.append("latest = 'true'") else: - query = subquery + clauses.append(f"{build_key(self.dsr_3)} = {dsr_3_value}") - return query + return " AND ".join(clauses) if clauses else None def get_product(self, *, file_name=None, product_id=None, schema='sedm', output_file=None, dsr_part1=None, dsr_part2=None, dsr_part3=None, verbose=False): @@ -1662,18 +1672,19 @@ def get_datalinks(self, ids, *, linking_parameter='SOURCE_ID', extra_options=Non ids : str, int, list of str or list of int, mandatory list of identifiers linking_parameter : str, optional, default SOURCE_ID, valid values: SOURCE_ID or SOURCEPATCH_ID - By default, all the identifiers are considered as source_id - SOURCE_ID: the identifiers are considered as source_id - SOURCEPATCH_ID: the identifiers are considered as sourcepatch_id + Specifies how the identifiers should be interpreted. By default, all the identifiers are considered as source_id + ``SOURCE_ID``: The identifiers are interpreted as ``source_id`` values. + ``SOURCEPATCH_ID``: The identifiers are interpreted as ``sourcepatch_id`` values. extra_options : str, optional, default None, valid values: METADATA - To let customize the server behaviour, if present. - If provided with value METADATA, the extra fields datalabs_path, file_name & hdu_index will be retrieved. + Additional options used to customize server behavior. + Valid values are: ``METADATA``: Retrieves the additional fields;``datalabs_path``, ``file_name``, and ``hdu_index``. verbose : bool, optional, default 'False' flag to display information about the process Returns ------- - A table object + astropy.table.Table + Table containing the retrieved datalinks. """ @@ -1689,169 +1700,123 @@ def get_datalinks(self, ids, *, linking_parameter='SOURCE_ID', extra_options=Non return self.__eucliddata.get_datalinks(ids=ids, linking_parameter=final_linking_parameter, extra_options=extra_options, verbose=verbose) + @cache + def get_valid_le3_configuration_values(self): + """ Gets the valid LE3 configuration values. + + Returns + ------- + pandas.DataFrame + DataFrame containing the valid LE3 configuration values. + """ + + query = 'select level_3_category, level_3_group, product_type from common.level_3_configuration order by level_3_category, level_3_group, product_type' + job = super().launch_job(query=query, format_with_results_compressed=('votable_gzip',)) + + return job.get_results().to_pandas() + def get_scientific_product_list(self, *, observation_id=None, tile_index=None, category=None, group=None, product_type=None, dataset_release='REGREPROC1_R2', dsr_part1=None, dsr_part2=None, dsr_part3=None, verbose=False): """ Gets the LE3 products (the high-level science data products). - Please note that not all combinations of category, group, and product_type are valid. Check the available values - in https://astroquery.readthedocs.io/en/latest/esa/euclid/euclid.html#appendix + Please note that not all combinations of ``category``, ``group``, and ``product_type`` are valid. Use the + ``get_valid_le3_configuration_values()`` method to retrieve the list of valid values. Parameters ---------- observation_id: str, optional, default None. - It is not compatible with parameter tile_index. + Observation identifier. This parameter is not compatible with ``tile_index``. tile_index: str, optional, default None. - It is not compatible with parameter observation_id. + Tile identifier. This parameter is not compatible with ``observation_id``. category: str, optional, default None. + Product category. group : str, optional, default None + Product group. product_type : str, optional, default None + Product type. dataset_release : str, mandatory. Default REGREPROC1_R2 - Data release from which data should be taken. + Data release from which the data should be retrieved. dsr_part1: str, optional, default None the data set release part 1: for OTF environment, the activity code; for REG and IDR, the target environment dsr_part2: str, optional, default None the data set release part 2: for OTF environment, the patch id (a positive integer); for REG and IDR, the activity code - dsr_part3: int, optional, default None - the data set release part 3: for OTF, REG and IDR environment, the version (an integer greater than 1) + dsr_part3: int or str, optional, default None + the data set release part 3: for OTF, REG and IDR environment, the version (an integer greater than 1). If + the value is ``latest``, the latest available version of each product type will be retrieved. Note that + filtering by ``dsr_part1`` and ``dsr_part2`` is compatible with ``dsr_part3="latest"``. verbose : bool, optional, default 'False' - flag to display information about the process + Flag indicating whether to display information about the process. Returns ------- - The products in an astropy.table.Table - + astropy.table.Table + Table containing the retrieved products. """ - query_extra_condition = "" - - if (observation_id is None and tile_index is None and category is None and group is None and product_type is - None): - raise ValueError("Include a valid parameter to retrieve a LE3 product.") + if all(v is None for v in (observation_id, tile_index, category, group, product_type,)): + raise ValueError("Include at least one parameter to retrieve a LE3 product.") - if dataset_release is None: + if not dataset_release: raise ValueError("The release is required.") if observation_id is not None and tile_index is not None: raise ValueError(self.__ERROR_MSG_REQUESTED_OBSERVATION_ID_AND_TILE_ID) - if tile_index is not None: - query_extra_condition = f" AND '{tile_index}' = ANY(tile_index_list) " + if dsr_part3 is not None: + if not (isinstance(dsr_part3, int) or dsr_part3 == "latest"): + raise ValueError(f"No valid dsr_part3 value: {dsr_part3}") - dsr_condition = self.__get_data_set_release_by_env(dsr_part1, dsr_part2, dsr_part3) - dsr_extra_condition = '' if dsr_condition is None else f'AND {dsr_condition}' + le3_df = self.get_valid_le3_configuration_values() - if observation_id is not None: - query_extra_condition = f" AND '{observation_id}' = ANY(observation_id_list) " + filtered = le3_df - if category is not None: + filters = {"level_3_category": category, "level_3_group": group, "product_type": product_type, } - try: - _ = conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS[category] - except KeyError: + for column, value in filters.items(): + if value is None: + continue + filtered = filtered[filtered[column].eq(value)] + if filtered.empty: raise ValueError( - f"Invalid combination of parameters: category={category}. Valid values:\n " - f"{pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}") - - if group is not None: - - try: - product_type_for_category_group_list = conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS[category][ - group] - except KeyError: - raise ValueError( - f"Invalid combination of parameters: category={category}; group={group}. Valid " - f"values:\n {pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}") - - if product_type is not None: - - if product_type not in product_type_for_category_group_list: - raise ValueError( - f"Invalid combination of parameters: category={category}; group={group}; " - f"product_type={product_type}. Valid values:\n " - f"{pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}") - - query_extra_condition = query_extra_condition + f" AND product_type ='{product_type}' " - else: - - final_products = ', '.join(f"'{w}'" for w in product_type_for_category_group_list) - query_extra_condition = query_extra_condition + f" AND product_type IN ({final_products}) " - else: # category is not None and group is None - - product_type_for_category_group_list = [item for row in - conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS[category] - .values() for item in row] - if product_type is not None: - - if product_type not in product_type_for_category_group_list: - raise ValueError( - f"Invalid combination of parameters: category={category}; product_type={product_type}." - f" Valid values:\n {pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}") - - query_extra_condition = query_extra_condition + f" AND product_type = '{product_type}' " + ( + "Invalid parameter combination:\n" + f"category={category}\n" + f"group={group}\n" + f"product_type={product_type}\n\n" + "Valid values:\n" + f"{pprint.pformat(le3_df)}" + ) + ) + + conditions = [f"release_name='{dataset_release}'"] - else: # category is not None and group is None and product_type is None - final_products = ', '.join(f"'{w}'" for w in product_type_for_category_group_list) - query_extra_condition = query_extra_condition + f" AND product_type IN ({final_products}) " - else: # category is None - - all_groups_dict = {} - for i in conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS.keys(): - all_groups_dict.update(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS[i]) - - if group is not None: - - try: - _ = all_groups_dict[group] - except KeyError: - raise ValueError( - f"Invalid combination of parameters: group={group}. Valid values:\n " - f"{pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}") - - if product_type is not None: - - if product_type not in all_groups_dict[group]: - raise ValueError( - f"Invalid combination of parameters: group={group}; product_type={product_type}. Valid " - f"values:\n {pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}") - - query_extra_condition = query_extra_condition + f" AND product_type = '{product_type}' " - else: # group is not None and product_type is None - - product_type_for_group_list = all_groups_dict[group] - final_products = ', '.join(f"'{w}'" for w in product_type_for_group_list) - query_extra_condition = query_extra_condition + f" AND product_type IN ({final_products}) " + if tile_index is not None: + conditions.append(f"'{tile_index}' = ANY(tile_index_list)") - else: # category is None and group is None + if observation_id is not None: + conditions.append(f"'{observation_id}' = ANY(observation_id_list)") - product_type_for_category_group_list = [element for sublist in all_groups_dict.values() for element - in sublist] + dsr_condition = self.__get_data_set_release_by_env(dsr_part1, dsr_part2, dsr_part3) + if dsr_condition: + conditions.append(dsr_condition) - if product_type is not None: - if product_type not in product_type_for_category_group_list: - raise ValueError( - f"Invalid combination of parameters: product_type={product_type}. Valid values:\n " - f"{pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}") + if product_type is not None: + conditions.append(f"product_type = '{product_type}'") + else: + valid_products = (filtered["product_type"].unique().tolist()) - query_extra_condition = query_extra_condition + f" AND product_type = '{product_type}' " + if not valid_products: + raise ValueError("No valid product types found.") - else: - query_extra_condition = query_extra_condition + "" + quoted_products = ", ".join(f"'{p}'" for p in valid_products) + conditions.append(f"product_type IN ({quoted_products})") - table = 'sedm.basic_download_data' - query = ( - f"SELECT basic_download_data.basic_download_data_oid, basic_download_data.product_type, " - f"basic_download_data.product_id, basic_download_data.observation_id_list AS " - f"observation_id_list, basic_download_data.tile_index_list AS tile_index_list, " - f"basic_download_data.patch_id_list AS patch_id_list, " - f"basic_download_data.filter_name AS filter_name, " - f"basic_download_data.data_set_release_part1, basic_download_data.data_set_release_part2, " - f"basic_download_data.data_set_release_part3 FROM {table} WHERE " - f"release_name='{dataset_release}' {query_extra_condition} {dsr_extra_condition} ORDER BY " - f"observation_id_list ASC") + table = "sedm.level_3" + query = f" SELECT * FROM {table} WHERE {' AND '.join(conditions)} ORDER BY observation_id_list ASC " - job = super().launch_job(query=query, output_format='votable_plain', verbose=verbose, + job = super().launch_job(query=query, output_format='csv', verbose=verbose, format_with_results_compressed=('votable_gzip',)) return job.get_results() diff --git a/astroquery/esa/euclid/tests/data/test_get_scientific_product_list.csv b/astroquery/esa/euclid/tests/data/test_get_scientific_product_list.csv new file mode 100644 index 0000000000..5141c4d53b --- /dev/null +++ b/astroquery/esa/euclid/tests/data/test_get_scientific_product_list.csv @@ -0,0 +1,49 @@ +basic_download_data_oid,checksum_list,creation_date,datalabs_path,data_set_release,data_set_release_part1,data_set_release_part2,data_set_release_part3,data_size,dec,file_name_list,file_path,file_type_list,filter_name,fov,ingested,latest,level_3_category,level_3_group,observation_id_list,patch_id_list,product_id,product_type,provenance_id,published,purpose,ra,release_date,release_name,tile_index_list,to_be_published,xml_file_content +3,"(cf3b5cecf7ed6c3ba30716291055592d, 0dd16b44e944088bec3b7cfaf18b04ab, ad2bf6584319d2ab8a812c181489948e, 91e27960134eca519cca137793246bb0)",2025-01-13T15:49:43.001,,REGREPROC1_R2_CLTEST_R0,REGREPROC1,R2_CLTEST,0,,,"(EUC_LE3_CL-AMICO-MASK_SNR8.00_20250113T154828.343697Z_1.0.fits, EUC_LE3_CL-AMICO-NOISE_SNR8.00_20250113T154828.343697Z_1.0.fits, EUC_LE3_CL-AMICO-FILTERCONST_SNR8.00_20250113T154828.343697Z_1.0.fits, EUC_LE3_CL-AMICO-AMPLITUDE_SNR8.00_20250113T154828.343697Z_1.0.fits)",/repository_dev//repository_dev/REGREPROC1_R2_CLTE/LE3/REGREPROC1_R2_CLTEST_R0/DpdLE3clAmicoAux/,"(AmicoMaskFile, AmicoNoiseFile, AmicoFilterConstFile, AmicoAmplitudeFile)",,,INGESTED,true,Clusters of Galaxies,GrpCatalog,,,PPO_REGREPROC1_R2_CLTEST_R0_CLDET_R3-amico_aux-0,DpdLE3clAmicoAux,692,0,PRODUCTION,,,REGREPROC1_R2_CLTEST_R0,,1," + +
+ PPO_REGREPROC1_R2_CLTEST_R0_CLDET_R3-amico_aux-0 + DpdLE3clAmicoAux + DetInTile + 2.0 + SDC-IT-DEV + REGREPROC1_R2_CLTEST_R0 + PRODUCTION + PPO_CLDET_PLAN + PPO_REGREPROC1_R2_CLTEST_R0_CLDET_R3 + CLDET_2.0 + COMPLETED + UNKNOWN + UNKNOWN + UNKNOWN + 2025-01-13T15:49:43.001000Z + 0 + 0 + Curator0 + 2025-01-13T15:49:43.001000Z +
+ + + + EUC_LE3_CL-AMICO-MASK_SNR8.00_20250113T154828.343697Z_1.0.fits + + + + + EUC_LE3_CL-AMICO-NOISE_SNR8.00_20250113T154828.343697Z_1.0.fits + + + + + EUC_LE3_CL-AMICO-FILTERCONST_SNR8.00_20250113T154828.343697Z_1.0.fits + + + + + EUC_LE3_CL-AMICO-AMPLITUDE_SNR8.00_20250113T154828.343697Z_1.0.fits + + + +
+ +" \ No newline at end of file diff --git a/astroquery/esa/euclid/tests/data/test_get_scientific_product_list.vot b/astroquery/esa/euclid/tests/data/test_get_scientific_product_list.vot new file mode 100644 index 0000000000..be4c1855be --- /dev/null +++ b/astroquery/esa/euclid/tests/data/test_get_scientific_product_list.vot @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
3cf3b5cecf7ed6c3ba30716291055592d 0dd16b44e944088bec3b7cfaf18b04ab ad2bf6584319d2ab8a812c181489948e 91e27960134eca519cca137793246bb0 2025-01-13T15:49:43.001REGREPROC1_R2_CLTEST_R0REGREPROC1R2_CLTEST0EUC_LE3_CL-AMICO-MASK_SNR8.00_20250113T154828.343697Z_1.0.fits EUC_LE3_CL-AMICO-NOISE_SNR8.00_20250113T154828.343697Z_1.0.fits EUC_LE3_CL-AMICO-FILTERCONST_SNR8.00_20250113T154828.343697Z_1.0.fits EUC_LE3_CL-AMICO-AMPLITUDE_SNR8.00_20250113T154828.343697Z_1.0.fits /repository_dev//repository_dev/REGREPROC1_R2_CLTE/LE3/REGREPROC1_R2_CLTEST_R0/DpdLE3clAmicoAux/AmicoMaskFile AmicoNoiseFile AmicoFilterConstFile AmicoAmplitudeFile INGESTEDTClusters of GalaxiesGrpCatalogPPO_REGREPROC1_R2_CLTEST_R0_CLDET_R3-amico_aux-0DpdLE3clAmicoAux6920PRODUCTIONREGREPROC1_R2_CLTEST_R01<?xml version="1.0" encoding="UTF-8"?> +<dpd-le3-cl-clamicoaux:DpdLE3clAmicoAux xmlns:dpd-le3-cl-clamicoaux="http://ecdm.euclid-ec.org/schema/dpd/le3/cl/clamicoaux" xmlns:sys="http://ecdm.euclid-ec.org/schema/sys" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:pro-le3-cl="http://ecdm.euclid-ec.org/schema/pro/le3/cl" xmlns:bas-fit="http://ecdm.euclid-ec.org/schema/bas/fit" xmlns:bas-dtd="http://ecdm.euclid-ec.org/schema/bas/dtd" xmlns:sys-dss="http://ecdm.euclid-ec.org/schema/sys/dss" xmlns:bas-dqc="http://ecdm.euclid-ec.org/schema/bas/dqc" xmlns:bas-ppr="http://ecdm.euclid-ec.org/schema/bas/ppr"> + <Header> + <ProductId>PPO_REGREPROC1_R2_CLTEST_R0_CLDET_R3-amico_aux-0</ProductId> + <ProductType>DpdLE3clAmicoAux</ProductType> + <SoftwareName>DetInTile</SoftwareName> + <SoftwareRelease>2.0</SoftwareRelease> + <ProdSDC>SDC-IT-DEV</ProdSDC> + <DataSetRelease>REGREPROC1_R2_CLTEST_R0</DataSetRelease> + <Purpose>PRODUCTION</Purpose> + <PlanId>PPO_CLDET_PLAN</PlanId> + <PPOId>PPO_REGREPROC1_R2_CLTEST_R0_CLDET_R3</PPOId> + <PipelineDefinitionId>CLDET_2.0</PipelineDefinitionId> + <PpoStatus>COMPLETED</PpoStatus> + <ManualValidationStatus>UNKNOWN</ManualValidationStatus> + <ProductNotifiedToBeChecked>UNKNOWN</ProductNotifiedToBeChecked> + <AutomatedValidationStatus>UNKNOWN</AutomatedValidationStatus> + <ExpirationDate>2025-01-13T15:49:43.001000Z</ExpirationDate> + <ToBePublished>0</ToBePublished> + <Published>0</Published> + <Curator>Curator0</Curator> + <CreationDate>2025-01-13T15:49:43.001000Z</CreationDate> + </Header> + <Data> + <AmicoMaskFile format="le3.cl.det.amico.output.mask" version="0.0"> + <DataContainer filestatus="PROPOSED" checksumMethod="MD5" checksumValue="cf3b5cecf7ed6c3ba30716291055592d"> + <FileName>EUC_LE3_CL-AMICO-MASK_SNR8.00_20250113T154828.343697Z_1.0.fits</FileName> + </DataContainer> + </AmicoMaskFile> + <AmicoNoiseFile format="le3.cl.det.amico.output.noise" version="0.0"> + <DataContainer filestatus="PROPOSED" checksumMethod="MD5" checksumValue="0dd16b44e944088bec3b7cfaf18b04ab"> + <FileName>EUC_LE3_CL-AMICO-NOISE_SNR8.00_20250113T154828.343697Z_1.0.fits</FileName> + </DataContainer> + </AmicoNoiseFile> + <AmicoFilterConstFile format="le3.cl.det.amico.output.filterConst" version="0.0"> + <DataContainer filestatus="PROPOSED" checksumMethod="MD5" checksumValue="ad2bf6584319d2ab8a812c181489948e"> + <FileName>EUC_LE3_CL-AMICO-FILTERCONST_SNR8.00_20250113T154828.343697Z_1.0.fits</FileName> + </DataContainer> + </AmicoFilterConstFile> + <AmicoAmplitudeFile format="le3.cl.det.amico.output.amplitude" version="0.0"> + <DataContainer filestatus="PROPOSED" checksumMethod="MD5" checksumValue="91e27960134eca519cca137793246bb0"> + <FileName>EUC_LE3_CL-AMICO-AMPLITUDE_SNR8.00_20250113T154828.343697Z_1.0.fits</FileName> + </DataContainer> + </AmicoAmplitudeFile> + </Data> +</dpd-le3-cl-clamicoaux:DpdLE3clAmicoAux> + +
+
+
diff --git a/astroquery/esa/euclid/tests/test_euclidtap.py b/astroquery/esa/euclid/tests/test_euclidtap.py index 05877adffb..f6cfbdb20d 100644 --- a/astroquery/esa/euclid/tests/test_euclidtap.py +++ b/astroquery/esa/euclid/tests/test_euclidtap.py @@ -15,14 +15,13 @@ import astropy.units as u import numpy as np +import pandas as pd import pytest from astropy import coordinates from astropy.coordinates.sky_coordinate import SkyCoord from astropy.table import Column, Table from astropy.units import Quantity from astropy.utils.data import get_pkg_data_filename -from requests import HTTPError - from astroquery.esa.euclid.core import EuclidClass from astroquery.esa.euclid.core import conf from astroquery.utils.commons import ASTROPY_LT_7_1_1 @@ -31,6 +30,7 @@ from astroquery.utils.tap.core import TapPlus, Tap from astroquery.utils.tap.model.tapcolumn import TapColumn from astroquery.utils.tap.model.taptable import TapTableMeta +from requests import HTTPError package = "astroquery.esa.euclid.tests" @@ -49,6 +49,10 @@ PRODUCT_LIST_FILE_NAME = get_pkg_data_filename(os.path.join("data", 'test_get_product_list.vot'), package=package) TEST_GET_PRODUCT_LIST = Path(PRODUCT_LIST_FILE_NAME).read_text() +LE3_SCIENTIFIC_PRODUCT_LIST_FILE_NAME = get_pkg_data_filename( + os.path.join("data", 'test_get_scientific_product_list.csv'), package=package) +TEST_GET_SCIENTIFIC_PRODUCT_LIST = Path(LE3_SCIENTIFIC_PRODUCT_LIST_FILE_NAME).read_text() + MULTIPLE_GET_SPECTRUM = get_pkg_data_filename(os.path.join("data", 'get_spectrum_output.zip'), package=package) SINGLE_GET_SPECTRUM = get_pkg_data_filename(os.path.join("data", '1499442653027920313.fits.zip'), package=package) @@ -1519,15 +1523,27 @@ def test_get_spectrum_exceptions(): output_file='fits_file') -def test_get_scientific_data_product_list(): +@patch.object(EuclidClass, 'get_valid_le3_configuration_values') +def test_get_scientific_data_product_list(mock_get_valid_le3_configuration_values): + data = [] + + for category, groups in conf._Conf__VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS.items(): + for group, product_types in groups.items(): + for product_type in product_types: + data.append([category, group, product_type]) + + df = pd.DataFrame(data, columns=["level_3_category", "level_3_group", "product_type"]) + + mock_get_valid_le3_configuration_values.return_value = df + conn_handler = DummyConnHandler() tap_plus = TapPlus(url="http://test:1111/tap", data_context='data', client_id='ASTROQUERY', connhandler=conn_handler) # Launch response: we use default response because the query contains decimals - responseLaunchJob = DummyResponse(200) - responseLaunchJob.set_data(method='POST', context=None, body=TEST_GET_PRODUCT_LIST, headers=None) + response_launch_job = DummyResponse(200) + response_launch_job.set_data(method='POST', context=None, body=TEST_GET_SCIENTIFIC_PRODUCT_LIST, headers=None) - conn_handler.set_default_response(responseLaunchJob) + conn_handler.set_default_response(response_launch_job) euclid = EuclidClass(tap_plus_conn_handler=conn_handler, datalink_handler=tap_plus, show_server_messages=False) @@ -1586,48 +1602,71 @@ def test_get_scientific_data_product_list(): dsr_part2='PV-023', dsr_part3=1, verbose=True) assert results is not None, "Expected a valid table" + results = euclid.get_scientific_product_list(product_type='DpdCovarTwoPCFWLClPosPos2D', dsr_part1='CALBLOCK', + dsr_part2='PV-023', dsr_part3='latest', verbose=True) + assert results is not None, "Expected a valid table" + + +@patch.object(EuclidClass, 'get_valid_le3_configuration_values') +def test_get_scientific_data_product_list_exceptions(mock_get_valid_le3_configuration_values): + data = [] + + for category, groups in conf._Conf__VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS.items(): + for group, product_types in groups.items(): + for product_type in product_types: + data.append([category, group, product_type]) + + df = pd.DataFrame(data, columns=["level_3_category", "level_3_group", "product_type"]) + + mock_get_valid_le3_configuration_values.return_value = df -def test_get_scientific_data_product_list_exceptions(): - eculid = EuclidClass() + euclid = EuclidClass() - with pytest.raises(ValueError, match="Include a valid parameter to retrieve a LE3 product."): - eculid.get_scientific_product_list(observation_id=None, tile_index=None, category=None, group=None, + with pytest.raises(ValueError, match="Include at least one parameter to retrieve a LE3 product."): + euclid.get_scientific_product_list(observation_id=None, tile_index=None, category=None, group=None, product_type=None) with pytest.raises(ValueError, match="The release is required."): - eculid.get_scientific_product_list(observation_id=11111, dataset_release=None) + euclid.get_scientific_product_list(observation_id=11111, dataset_release=None) with pytest.raises(ValueError, match="Incompatible: 'observation_id' and 'tile_id'. Use only one."): - eculid.get_scientific_product_list(observation_id=11111, tile_index=1234567) + euclid.get_scientific_product_list(observation_id=11111, tile_index=1234567) - with pytest.raises(ValueError, match=r"Invalid combination of parameters: category=not_valid. *."): - eculid.get_scientific_product_list(observation_id=11111, category='not_valid') + with pytest.raises(ValueError, match=r"Invalid parameter combination:*."): + euclid.get_scientific_product_list(observation_id=11111, category='not_valid') - with pytest.raises(ValueError, match=r"Invalid combination of parameters: group=not_valid. *."): - eculid.get_scientific_product_list(observation_id=11111, group='not_valid') + with pytest.raises(ValueError, + match=r"Invalid parameter combination:\ncategory=None\ngroup=not_valid\nproduct_type=None*."): + euclid.get_scientific_product_list(observation_id=11111, group='not_valid') - with pytest.raises(ValueError, match=r"Invalid combination of parameters: product_type=not_valid. *."): - eculid.get_scientific_product_list(observation_id=11111, product_type='not_valid') + with pytest.raises(ValueError, + match=r"Invalid parameter combination:\ncategory=None\ngroup=None\nproduct_type=not_valid\n\nValid values*."): + euclid.get_scientific_product_list(observation_id=11111, product_type='not_valid') - with pytest.raises(ValueError, match=r"Invalid combination of parameters: category=Clusters of Galaxies. *."): - eculid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', + with pytest.raises(ValueError, + match=r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=not_valid\nproduct_type=None\n\nValid values*."): + euclid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', group='not_valid') - with pytest.raises(ValueError, match=r"Invalid combination of parameters: category=Clusters of Galaxies; " - r"group=GrpCatalog; product_type=not_valid. *."): - eculid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', + with pytest.raises(ValueError, + match=r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=GrpCatalog\nproduct_type=not_valid\n\nValid values:*."): + euclid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', group='GrpCatalog', product_type='not_valid') with pytest.raises(ValueError, - match=r"Invalid combination of parameters: category=Clusters of Galaxies; " - r"product_type=not_valid. *."): - eculid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', + match=r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=None\nproduct_type=not_valid\n\nValid values:*."): + euclid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', product_type='not_valid') with pytest.raises(ValueError, - match=r"Invalid combination of parameters: group=GrpCatalog; product_type=not_valid. *."): - eculid.get_scientific_product_list(observation_id=11111, group='GrpCatalog', product_type='not_valid') + match=r"Invalid parameter combination:\ncategory=None\ngroup=GrpCatalog\nproduct_type=not_valid\n\nValid values:*."): + euclid.get_scientific_product_list(observation_id=11111, group='GrpCatalog', product_type='not_valid') + + with pytest.raises(ValueError, + match=r"No valid dsr_part3 value: wrong"): + euclid.get_scientific_product_list(product_type='DpdCovarTwoPCFWLClPosPos2D', dsr_part1='CALBLOCK', + dsr_part2='PV-023', dsr_part3='wrong', verbose=True) @patch.object(TapPlus, 'login') diff --git a/docs/esa/euclid/euclid.rst b/docs/esa/euclid/euclid.rst index 404327aaa0..cad80ee9c4 100644 --- a/docs/esa/euclid/euclid.rst +++ b/docs/esa/euclid/euclid.rst @@ -555,19 +555,6 @@ Finally, extract the job id's included in a given time range (in the example bel >>> jobs_to_delete = subset['job_id'].to_list() >>> Euclid.remove_jobs(jobs_to_delete) -.. _appendix: - -======== -Appendix -======== - -The following table summarises the available values of the parameters of the method get_scientific_product_list. - -.. csv-table:: Valid values for the parameters of the method get_scientific_product_list - :file: table_values.csv - :header-rows: 1 - :widths: auto - ============= Reference/API ============= diff --git a/docs/esa/euclid/table_values.csv b/docs/esa/euclid/table_values.csv deleted file mode 100644 index 4b8a6044b2..0000000000 --- a/docs/esa/euclid/table_values.csv +++ /dev/null @@ -1,135 +0,0 @@ -category,group,product_type,description -'Internal Data Products','SEL Wide Main','DpdLE3IDSELIDCatalog', -'Internal Data Products','SEL Wide','DpdLE3IDSELIDSubsampledCatalog', -'Internal Data Products','VMSP Group','DpdLE3IDVMSPConfiguration',VMSP Configuration -'Internal Data Products','VMSP Group','DpdLE3IDVMSPDetectionModel',VMSP ID Detection Model -'Internal Data Products' ,'VMSP Group','DpdLE3IDVMSPDistModel',VMSP Distribution Model -'Internal Data Products','VMSP Group','DpdLE3IDVMSPRandomCatalog',Random Catalog Product -'Internal Data Products','SEL Config/Stats','DpdLE3IDSELIDStatistics',SEL-ID Purity and completeness statistics -'Internal Data Products','SEL Config/Stats','DpdLE3IDSELConfigurationSet',SEL Configuration -'Internal Data Products','External Data Products','LE3-ED configuration catalog',LE3-ED configuration catalog -'Internal Data Products','External Data Products','LE3-ED match catalog','DpdLE3edMatchedCatalog' -'Weak Lensing Products','2PCF','DpdTwoPCFWLCOSEBIFilter',This product contains COSEBI filters -'Weak Lensing Products','2PCF','DpdTwoPCFWLParamsCOSEBIShearShear2D',This product contains parameters to compute the -'Weak Lensing Products','2PCF','DpdTwoPCFWLParamsClPosPos2D',This product contains parameters to compute the tomographic -'Weak Lensing Products','2PCF','DpdTwoPCFWLParamsPEBPosShear2D',This product contains parameters to compute the -'Weak Lensing Products','2PCF','DpdTwoPCFWLParamsPEBShearShear2D',This product contains parameters to compute the -'Weak Lensing Products','2PCF','DpdTwoPCFWLParamsPosPos2D',Input parameters to compute tomographic angular 2PCF. -'Weak Lensing Products','2PCF','DpdTwoPCFWLParamsPosShear2D',Input parameters to compute the tomographic galaxy-galaxy lensing 2PCF. -'Weak Lensing Products','2PCF','DpdTwoPCFWLParamsShearShear2D',Input parameters to compute tomographic cosmic shear 2PCF. -'Weak Lensing Products','2PCF','DpdTwoPCFWLCOSEBIShearShear2D',Tomographic cosmic shear COSEBI modes. -'Weak Lensing Products','2PCF','DpdTwoPCFWLClPosPos2D',This product contains the tomographic angular power spectra -'Weak Lensing Products','2PCF','DpdTwoPCFWLPEBPosShear2D',Tomographic galaxy-galaxy lensing E/B power spectra -'Weak Lensing Products','2PCF','DpdTwoPCFWLPEBShearShear2D',Tomographic cosmic shear E/B power spectra. -'Weak Lensing Products','2PCF','DpdTwoPCFWLPosPos2D',Tomographic angular 2PCF. -'Weak Lensing Products','2PCF','DpdTwoPCFWLPosShear2D',Tomographic galaxy galaxy lensing 2PCF. -'Weak Lensing Products','2PCF','DpdTwoPCFWLShearShear2D',Tomographic cosmic shear 2PCF. -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLParams',This product contains resampling parameters to compute the covariance matrices. -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLClPosPos2D',Covariance of Tomographic Angular Power Spectra -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLCOSEBIShearShear2D',Covariance of Tomographic Cosmic Shear COSEBI -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLPEBPosShear2D',Cov. of Tomo. Galaxy-Galaxy Lensing EB Power Spectra -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLPEBShearShear2D',Covariance of Tomographic Cosmic Shear EB Power Spectra -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLPosPos2D',Covariance of Tomographic Angular Correlation -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLPosShear2D',Cov. of Tomographic Galaxy-Galaxy Lensing Correlation -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLShearShear2D',Covariance of Tomographic Cosmic Shear Correlation -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLResampleCOSEBIShearShear2D',This product contains a list of resampled tomographic cosmic shear COSEBI modes. -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLResampleClPosPos2D',This product contains a list of resampled tomographic angular power spectrum. -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLResamplePEBPosShear2D',This product contains a list of resampled tomographic galaxy-galaxy lensing E/B power spectra. -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLResamplePEBShearShear2D',This product contains a list of resampled tomographic cosmic shear E/B power spectra. -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLResamplePosPos2D',This product contains a list of resampled tomographic galaxy-galaxy lensing correlation function. -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLResamplePosShear2D',This product contains a list of resampled tomographic galaxy-galaxy lensing correlation function. -'Weak Lensing Products','2PCF','DpdCovarTwoPCFWLResampleShearShear2D',This product contains a list of resampled tomographic cosmic shear 2PCF. -'Weak Lensing Products','PK','DpdPKWLAlms',Data product that contains the alms generated by PK-WL. -'Weak Lensing Products','PK','DpdPKWLCovMatrix2D',This product contains the covariance matrix of angular power spectra. -'Weak Lensing Products','PK','DpdPKWLEstimate2D',This product contains the tomographic angular clustering power spectra. -'Weak Lensing Products','PK','DpdPKWLMaps',Data product that contains the FITS file with maps generated by PK-WL. -'Weak Lensing Products','PK','DpdPKWLMixingMatrix2D',This product contains the mixing matrix components. -'Weak Lensing Products','2D-MASS','DpdTwoDMassParamsConvergenceClusters',This product contains input parameters to compute the 2D convergence maps for clusters studies. -'Weak Lensing Products','2D-MASS','DpdTwoDMassParamsConvergencePatch',This product contains inputs to compute the 2D convergence maps for one or several patches. -'Weak Lensing Products','2D-MASS','DpdTwoDMassParamsConvergencePatchesToSphere',This product contains inputs to compute the 2D convergence maps on the sphere. -'Weak Lensing Products','2D-MASS','DpdTwoDMassParamsConvergenceSphere',This product contains inputs to compute the 2D convergence maps on the sphere. -'Weak Lensing Products','2D-MASS','DpdTwoDMassParamsPeakCatalogConvergence',This product contains inputs to perform peak counting on a convergence map. -'Weak Lensing Products','2D-MASS','DpdTwoDMassParamsPeakCatalogMassAperture',This product contains inputs to perform peak counting on shear catalog for one or several patches -'Weak Lensing Products','2D-MASS','DpdTwoDMassConvergenceClusters',E/B Convergence Maps for Clusters -'Weak Lensing Products','2D-MASS','DpdTwoDMassConvergencePatchesToSphere',MultiPatch-Based E/B Convergence Maps for Large field -'Weak Lensing Products','2D-MASS','DpdTwoDMassConvergencePatch',E/B Convergence Maps for Small Field -'Weak Lensing Products','2D-MASS','DpdTwoDMassConvergenceSphere',Spherical E/B Convergence Maps -'Weak Lensing Products','2D-MASS','DpdTwoDMassPeakCatalog',Peak Catalog -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcPkCross',Cross [Power Spectrum Multipoles and Window Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcPkDOA',"DOA [Power Spectrum Multipoles, 2Dpolar, 2Dcart and Window Product]" -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcPkYam',Yamamoto [Power Spectrum Multipoles and Window Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointAutoCorr',1D [Angle-averaged Auto-correlation Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointAutoCorrCart',2D Cartesian [2D Cartesian and Projected Auto-corr. Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointAutoCorrPol',2D Polar [2D Polar and Multipole Auto-correlation Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointCrossCorr',1D [Angle-averaged Cross-correlation Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointCrossCorrCart',2D Cartesian [2D Cartesian and Projected Cross-corr. Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointCrossCorrPol',2D Polar [2D Polar and Multipole Cross-correlation Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointRecAutoCorr',1D [Post-reconstruction Angle-averaged Auto-correlation Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointRecAutoCorrCart',2D Cartesian [Post-reconstruction 2D Cartesian and Projected Auto-correlation Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointRecAutoCorrPol',2D Polar [Post-reconstruction 2D Polar and Multipole Auto-correlation Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointRecCrossCorr',1D [Post-reconstruction Angle-averaged Cross-corr. Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointRecCrossCorrCart',2D Cartesian [Post-reconstruction 2D Cartesian and Projected Cross-correlation Product] -'Galaxy Clustering Products','2PCF_PK','DpdLE3gcTwoPointRecCrossCorrPol',2D Polar [Post-reconstruction 2D Polar and Multipole Cross-correlation Product] -'Galaxy Clustering Products','3PCF_BK','DpdLE3gcThreePointAll',3PCF Triplets "ALL" Product -'Galaxy Clustering Products','3PCF_BK','DpdLE3gcThreePointSin',3PCF Correlation "SINGLE" Product -'Galaxy Clustering Products','3PCF_BK','DpdLE3gcBkMonopole',Bispectrum Product Monopole -'Galaxy Clustering Products','3PCF_BK','DpdLE3gcBkMultipole',Bispectrum Product Multipoles -'Galaxy Clustering Products','CM-2PCF','DpdLE3gcCovmatTwoPointCov1D',"Output, 1D [Covariance Matrix of the Angle-averaged Auto-correlation Product]" -'Galaxy Clustering Products','CM-2PCF','DpdLE3gcCovmatTwoPointCov2Dcart',"Output, 2D cartesian [Covariance Matrix of the 2D Cartesian 2PCF Product]" -'Galaxy Clustering Products','CM-2PCF','DpdLE3gcCovmatTwoPointCov2Dpol',"Output, 2D Polar [Covariance Matrix of the 2D Polar 2PCF Product]" -'Galaxy Clustering Products','CM-2PCF','DpdLE3gcCovmatTwoPointCovMu',"Output, Covariance Matrix of the Multipoles 0, 1, 2, 3, 4 2PCF Product" -'Galaxy Clustering Products','CM-2PCF','DpdLE3gcCovmatTwoPointCovPro',"Output, Projected [Covariance Matrix of the Projected 2PCF Product]" -'Galaxy Clustering Products','CM-PK','DpdLE3gcCovmatPKCov1D',"Output, Covariance Matrix of the Power Spectrum 0, 1, 2, 3, 4 multipoles Product" -'Galaxy Clustering Products','CM-PK','DpdLE3gcCovmatPKCov2Dcart',"Output, Covariance Matrix of the Power Spectrum 2D Cartesian Product" -'Galaxy Clustering Products','CM-PK','DpdLE3gcCovmatPKCov2Dpol',"Output, Covariance Matrix of the Power Spectrum 2D Polar Product" -'Clusters of Galaxies','GrpCatalog,'DpdLE3clAMICOModel',This product contains the Model for AMICO -'Clusters of Galaxies','GrpCatalog,'DpdLE3clDetMergeParams',This product contains the input parameters for DET -'Clusters of Galaxies','GrpCatalog,'DpdLE3clDetOnMockParams',This product contains the input parameters for DET_ON_MOCK pipeline -'Clusters of Galaxies','GrpCatalog,'DpdLE3clDetInputParams',This product contains the input parameters for DEt -'Clusters of Galaxies','GrpCatalog,'DpdLE3clAmicoAux',DET-CL AMICO auxiliary Data Product -'Clusters of Galaxies','GrpCatalog,'DpdLE3clAssociations',This output product contains the catalog of associations galaxy to clusters -'Clusters of Galaxies','GrpCatalog,'DpdLE3clPzwavAux',DET-CL PZWAV auxiliary Data Product -'Clusters of Galaxies','GrpCatalog,'DpdLE3clPZWAVDensity',This output product contains the intermediate Product "Density Map" from DET-CL/PZWAV -'Clusters of Galaxies','GrpCatalog,'DpdLE3clDetClusters',This output product contains the catalog of candidate clusters from DET-CL -'Clusters of Galaxies','GrpCatalog,'DpdLE3FullDet',This output product contains the merged catalog of candidate clusters -'Clusters of Galaxies','GrpCatalog,'DpdLE3clCatMergeParams',This product contains the input parameters for the merging in CAT-CL -'Clusters of Galaxies','GrpCatalog,'DpdLE3clCATParams',This product contains the configuration parameters for LE3 CAT-CL -'Clusters of Galaxies','GrpCatalog,'DpdLE3clCcpInputParams',This product contains the input parameters for Cluster Characterization Pipeline -'Clusters of Galaxies','GrpCatalog,'DpdLE3clRichMembers',Galaxy Membership Output Product -'Clusters of Galaxies',GrpCatalog,'DpdLE3clZClParams',This product contains the configuration parameters for LE3 Z-CL -'Clusters of Galaxies','GrpCatalog,'DpdLE3clGlueMatchParams',This product contains the input parameters for the glue-match pipeline -'Clusters of Galaxies','GrpCatalog,'DpdLE3clMockGlueMatchParams',This product contains the input parameters for the mock glue-match pipeline -'Clusters of Galaxies','GrpCatalog','DpdLE3clGlueMatchParams',This product contains the input parameters for the glue-match pipeline. -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombConfigurationSet',Configuration information for COMB-CL pipelines -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombRedSheProf',Output Reduced shear profiles -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombUCovRedSheProf',Output Uncertainty Covariance matrix of the reduced -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombWLME',Output Weak lensing mass estimates -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombCovMatDeltaSigmaCosmoDep',This output product contains the stacking -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombCovMatReducedShearCosmoDep',This output product contains the stacking covariance matrix of the reduced shear derived with a cosmology dependent binning. -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombCovMatReducedShearCosmoIndep',This output product contains the stacking covariance matrix of the reduced shear derived with a cosmology independent binning. -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombStackingCosmoDep',This output product contains the stacking cosmology dependent binning. -'Clusters of Galaxies','GrpCOMB','DpdLE3clCombStackingCosmoInd',This output product contains the stacking cosmology independent binning. -'Clusters of Galaxies','GrpSEL','DpdLE3clSelRandomParams',This output product contains the configuration parameters for SEL-CL to create the random catalogue -'Clusters of Galaxies','GrpSEL','DpdLE3clSelSelFuncInputParams',This product contains the input parameters for SEL SelFunc -'Clusters of Galaxies','GrpSEL','DpdLE3clSelSinfoniaIniClMockInputParams',This product contains the input parameters for SEL Sinfonia Cluster Mock pipeline -'Clusters of Galaxies','GrpSEL','DpdLE3clSelSinfoniaMockInputParams',This product contains the input parameters for SEL Sinfonia Mock pipeline -'Clusters of Galaxies','GrpSEL','DpdLE3clSelSelFunc',This output product contains the selection function of the galaxy cluster detections -'Clusters of Galaxies','GrpSEL','DpdLE3clSinfoniaEllipticity',This output product contains the file for the ellipticity -'Clusters of Galaxies','GrpSEL','DpdLE3clSelSubSample',Clusters Subsample Output Product -'Clusters of Galaxies','GrpSEL','DpdLE3clRedshiftDistrib',Redshift distribution of detections -'Clusters of Galaxies','GrpSEL','DpdLE3clSelRandom':,Random for the CL clustering codes -'Clusters of Galaxies','GrpSEL','DpdLE3clMatchForSelParams',This product contains the input parameters for the match-for-sel pipeline -'Clusters of Galaxies','GrpSEL','DpdLE3clMockClusters',This output product contains the catalog of mock clusters -'Clusters of Galaxies','GrpClustering','DpdLE3clTwoPointAutoCorrPol',Cluster Clustering Two Point Correlation 2D polar data product -'Clusters of Galaxies','GrpClustering','DpdLE3clCovmatTwoPointCov2',Cluster Clustering Covariance Matrix 2PCF 2D polar data product -'Clusters of Galaxies','GrpClustering','DpolDpdLE3clCovmatPKCov1', -'Clusters of Galaxies','GrpClustering','DDpdLE3clPkDOA', -'Clusters of Galaxies','GrpClustering','DpdLE3clPkYam',Cluster Clustering Power Spectrum Yamamoto data product -'Clusters of Galaxies','GrpLMF','DpdLE3clLMFParams',This product contains the configuration parameters for LE3 LMF-CL -'Clusters of Galaxies','GrpLMF','DpdLE3clLMFOutput',This product contains the output for LE3_CL LMF PF -'Clusters of Galaxies','GrpTiling','DpdLE3clCLTile',This product contains the information describing a CL tile -'Clusters of Galaxies','GrpTiling','DpdLE3clCommon',Common data product for CL -'Clusters of Galaxies','GrpTiling','DpdLE3clConfigurationSet',Generic configuration information for CL PFs -'PHZ','PHZ','DpdBinMeanRedshift', -'PHZ','PHZ','DpdReferenceSample', -'PHZ','PHZ','DpdTomographicBins', \ No newline at end of file From ff86a48ea20b01562a42b092b09b47476f34d29f Mon Sep 17 00:00:00 2001 From: Jorge Fernandez Hernandez Date: Wed, 3 Jun 2026 09:14:40 +0200 Subject: [PATCH 6/6] EUCLIDPCR-2131 Include reference to the PR --- CHANGES.rst | 6 +- astroquery/esa/euclid/__init__.py | 64 -------- astroquery/esa/euclid/core.py | 32 ++-- .../data/test_get_valid_le3_configuration.vot | 151 ++++++++++++++++++ astroquery/esa/euclid/tests/test_euclidtap.py | 70 ++++---- 5 files changed, 213 insertions(+), 110 deletions(-) create mode 100644 astroquery/esa/euclid/tests/data/test_get_valid_le3_configuration.vot diff --git a/CHANGES.rst b/CHANGES.rst index 8968383111..f641cd2bc4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -60,7 +60,11 @@ esa.euclid BASIC_DOWNLOAD_DATA_PRODUCTS. [#3562] - The method ``get_spectrum`` accepts a single source_id or designation or multiple values separated by commas or a list. [#3570] -- Removed unnecessary CAST(... AS text) from array columns in ``get_product_list``, ``get_scientific_product_list`` and +- New method, ``get_valid_le3_configuration_values``, to retrieve the valid values for the category, group, and + product_type parameters dynamically. [#3601] +- In the method, ``get_scientific_product_list``, the ``dsr_part3`` parameter now supports the additional value + ``latest``. [#3601] +- Removed unnecessary CAST(... AS text) from array columns in ``get_product_list``and ``__get_tile_catalogue_list``, as TAP 10.x now returns proper arrays. [#3599] diff --git a/astroquery/esa/euclid/__init__.py b/astroquery/esa/euclid/__init__.py index 6539306dd8..24f1307acd 100644 --- a/astroquery/esa/euclid/__init__.py +++ b/astroquery/esa/euclid/__init__.py @@ -69,70 +69,6 @@ class Conf(_config.ConfigNamespace): SIR_SCIENCE_FRAME_PRODUCTS = ['dpdSirScienceFrame'] - __VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS = { - 'Clusters of Galaxies': { - 'GrpCatalog': ['DpdLE3clAMICOModel', 'DpdLE3clDetMergeParams', 'DpdLE3clDetOnMockParams', - 'DpdLE3clDetInputParams', 'DpdLE3clAmicoAux', 'DpdLE3clAssociations', 'DpdLE3clPzwavAux', - 'DpdLE3clPZWAVDensity', 'DpdLE3clDetClusters', 'DpdLE3FullDet', 'DpdLE3clCatMergeParams', - 'DpdLE3clCATParams', 'DpdLE3clCcpInputParams', 'DpdLE3clRichMembers', 'DpdLE3clZClParams', - 'DpdLE3clGlueMatchParams', 'DpdLE3clMockGlueMatchParams'], - 'GrpClustering': ['DDpdLE3clPkDOA', 'DpdLE3clCovmatTwoPointCov2', 'DpdLE3clPkYam', - 'DpdLE3clTwoPointAutoCorrPol', 'DpolDpdLE3clCovmatPKCov1'], - 'GrpCOMB': ['DpdLE3clCombConfigurationSet', 'DpdLE3clCombCovMatDeltaSigmaCosmoDep', - 'DpdLE3clCombCovMatReducedShearCosmoDep', 'DpdLE3clCombCovMatReducedShearCosmoIndep', - 'DpdLE3clCombRedSheProf', 'DpdLE3clCombStackingCosmoDep', 'DpdLE3clCombStackingCosmoInd', - 'DpdLE3clCombUCovRedSheProf', 'DpdLE3clCombWLME'], - 'GrpLMF': ['DpdLE3clLMFOutput', 'DpdLE3clLMFParams'], - 'GrpSEL': ['DpdLE3clMatchForSelParams', 'DpdLE3clMockClusters', 'DpdLE3clRedshiftDistrib', - 'DpdLE3clSelRandom', 'DpdLE3clSelRandomParams', 'DpdLE3clSelSelFunc', - 'DpdLE3clSelSelFuncInputParams', 'DpdLE3clSelSinfoniaIniClMockInputParams', - 'DpdLE3clSelSinfoniaMockInputParams', 'DpdLE3clSelSubSample', 'DpdLE3clSinfoniaEllipticity'], - 'GrpTiling': ['DpdLE3clCLTile', 'DpdLE3clCommon', 'DpdLE3clConfigurationSet']}, - 'External Data Products': { - 'LE3-ED configuration catalog': ['DpdLE3edConfigurationFile'], - 'LE3-ED match catalog': ['DpdLE3edMatchedCatalog']}, - 'Galaxy Clustering Products': { - '2PCF_PK': ['DpdLE3gcPkCross', 'DpdLE3gcPkDOA', 'DpdLE3gcPkYam', 'DpdLE3gcTwoPointAutoCorr', - 'DpdLE3gcTwoPointAutoCorrCart', 'DpdLE3gcTwoPointAutoCorrPol', 'DpdLE3gcTwoPointCrossCorr', - 'DpdLE3gcTwoPointCrossCorrCart', 'DpdLE3gcTwoPointCrossCorrPol', 'DpdLE3gcTwoPointRecAutoCorr', - 'DpdLE3gcTwoPointRecAutoCorrCart', 'DpdLE3gcTwoPointRecAutoCorrPol', - 'DpdLE3gcTwoPointRecCrossCorr', 'DpdLE3gcTwoPointRecCrossCorrCart', - 'DpdLE3gcTwoPointRecCrossCorrPol'], - '3PCF_BK': ['DpdLE3gcBkMonopole', 'DpdLE3gcBkMultipole', 'DpdLE3gcThreePointAll', 'DpdLE3gcThreePointSin'], - 'CM-2PCF': ['DpdLE3gcCovmatTwoPointCov1D', 'DpdLE3gcCovmatTwoPointCov2Dcart', - 'DpdLE3gcCovmatTwoPointCov2Dpol', 'DpdLE3gcCovmatTwoPointCovMu', - 'DpdLE3gcCovmatTwoPointCovPro'], - 'CM-PK': ['DpdLE3gcCovmatPKCov1D', 'DpdLE3gcCovmatPKCov2Dcart', 'DpdLE3gcCovmatPKCov2Dpol']}, - 'Internal Data Products': { - 'SEL Config/Stats': ['DpdLE3IDSELConfigurationSet', 'DpdLE3IDSELIDStatistics'], - 'SEL Wide Main': ['DpdLE3IDSELIDCatalog'], - 'SEL Wide': ['DpdLE3IDSELIDSubsampledCatalog'], - 'VMSP Group': ['DpdLE3IDVMSPConfiguration', 'DpdLE3IDVMSPDetectionModel', 'DpdLE3IDVMSPDistModel', - 'DpdLE3IDVMSPRandomCatalog']}, - 'Weak Lensing Products': { - '2D-MASS': ['DpdTwoDMassConvergenceClusters', 'DpdTwoDMassConvergencePatch', - 'DpdTwoDMassConvergencePatchesToSphere', 'DpdTwoDMassConvergenceSphere', - 'DpdTwoDMassParamsConvergenceClusters', 'DpdTwoDMassParamsConvergencePatch', - 'DpdTwoDMassParamsConvergencePatchesToSphere', 'DpdTwoDMassParamsConvergenceSphere', - 'DpdTwoDMassParamsPeakCatalogConvergence', 'DpdTwoDMassParamsPeakCatalogMassAperture', - 'DpdTwoDMassPeakCatalog'], - '2PCF': ['DpdTwoPCFWLCOSEBIFilter', 'DpdTwoPCFWLParamsCOSEBIShearShear2D', 'DpdTwoPCFWLParamsClPosPos2D', - 'DpdTwoPCFWLParamsPEBPosShear2D', 'DpdTwoPCFWLParamsPEBShearShear2D', 'DpdTwoPCFWLParamsPosPos2D', - 'DpdTwoPCFWLParamsPosShear2D', 'DpdTwoPCFWLParamsShearShear2D', 'DpdTwoPCFWLCOSEBIShearShear2D', - 'DpdTwoPCFWLClPosPos2D', 'DpdTwoPCFWLPEBPosShear2D', 'DpdTwoPCFWLPEBShearShear2D', - 'DpdTwoPCFWLPosPos2D', 'DpdTwoPCFWLPosShear2D', 'DpdTwoPCFWLShearShear2D', - 'DpdCovarTwoPCFWLParams', 'DpdCovarTwoPCFWLClPosPos2D', 'DpdCovarTwoPCFWLCOSEBIShearShear2D', - 'DpdCovarTwoPCFWLPEBPosShear2D', 'DpdCovarTwoPCFWLPEBShearShear2D', - 'DpdCovarTwoPCFWLPosPos2D', 'DpdCovarTwoPCFWLPosShear2D', 'DpdCovarTwoPCFWLShearShear2D', - 'DpdCovarTwoPCFWLResampleCOSEBIShearShear2D', 'DpdCovarTwoPCFWLResampleClPosPos2D', - 'DpdCovarTwoPCFWLResamplePEBPosShear2D', 'DpdCovarTwoPCFWLResamplePEBShearShear2D', - 'DpdCovarTwoPCFWLResamplePosPos2D', 'DpdCovarTwoPCFWLResamplePosShear2D', - 'DpdCovarTwoPCFWLResampleShearShear2D'], - 'PK': ['DpdPKWLAlms', 'DpdPKWLCovMatrix2D', 'DpdPKWLEstimate2D', 'DpdPKWLMaps', 'DpdPKWLMixingMatrix2D']}, - 'PHZ': { - 'PHZ': ['DpdBinMeanRedshift', 'DpdReferenceSample', 'DpdTomographicBins']} - } - PRODUCT_TYPES = ['observation', 'mosaic'] SCHEMAS = ['sedm'] diff --git a/astroquery/esa/euclid/core.py b/astroquery/esa/euclid/core.py index 5a0f8b29cc..4027b5cae9 100644 --- a/astroquery/esa/euclid/core.py +++ b/astroquery/esa/euclid/core.py @@ -20,14 +20,15 @@ from astropy import units from astropy import units as u from astropy.coordinates import Angle +from astropy.table import unique from astropy.units import Quantity from astropy.utils import deprecated_renamed_argument +from requests.exceptions import HTTPError + from astroquery import log from astroquery.utils import commons from astroquery.utils.tap import TapPlus from astroquery.utils.tap import taputils -from requests.exceptions import HTTPError - from . import conf @@ -1672,12 +1673,14 @@ def get_datalinks(self, ids, *, linking_parameter='SOURCE_ID', extra_options=Non ids : str, int, list of str or list of int, mandatory list of identifiers linking_parameter : str, optional, default SOURCE_ID, valid values: SOURCE_ID or SOURCEPATCH_ID - Specifies how the identifiers should be interpreted. By default, all the identifiers are considered as source_id + Specifies how the identifiers should be interpreted. By default, all the identifiers are considered as + source_id ``SOURCE_ID``: The identifiers are interpreted as ``source_id`` values. ``SOURCEPATCH_ID``: The identifiers are interpreted as ``sourcepatch_id`` values. extra_options : str, optional, default None, valid values: METADATA Additional options used to customize server behavior. - Valid values are: ``METADATA``: Retrieves the additional fields;``datalabs_path``, ``file_name``, and ``hdu_index``. + Valid values are: ``METADATA``: Retrieves the additional fields;``datalabs_path``, ``file_name``, and + ``hdu_index``. verbose : bool, optional, default 'False' flag to display information about the process @@ -1706,14 +1709,15 @@ def get_valid_le3_configuration_values(self): Returns ------- - pandas.DataFrame - DataFrame containing the valid LE3 configuration values. + astropy.table.Table + Table containing the retrieved products. """ - query = 'select level_3_category, level_3_group, product_type from common.level_3_configuration order by level_3_category, level_3_group, product_type' + query = ('select level_3_category, level_3_group, product_type from common.level_3_configuration order by ' + 'level_3_category, level_3_group, product_type') job = super().launch_job(query=query, format_with_results_compressed=('votable_gzip',)) - return job.get_results().to_pandas() + return job.get_results() def get_scientific_product_list(self, *, observation_id=None, tile_index=None, category=None, group=None, product_type=None, dataset_release='REGREPROC1_R2', dsr_part1=None, dsr_part2=None, @@ -1768,17 +1772,17 @@ def get_scientific_product_list(self, *, observation_id=None, tile_index=None, c if not (isinstance(dsr_part3, int) or dsr_part3 == "latest"): raise ValueError(f"No valid dsr_part3 value: {dsr_part3}") - le3_df = self.get_valid_le3_configuration_values() + le3_table = self.get_valid_le3_configuration_values() - filtered = le3_df + filtered = le3_table filters = {"level_3_category": category, "level_3_group": group, "product_type": product_type, } for column, value in filters.items(): if value is None: continue - filtered = filtered[filtered[column].eq(value)] - if filtered.empty: + filtered = filtered[filtered[column] == value] + if filtered is None or not filtered: raise ValueError( ( "Invalid parameter combination:\n" @@ -1786,7 +1790,7 @@ def get_scientific_product_list(self, *, observation_id=None, tile_index=None, c f"group={group}\n" f"product_type={product_type}\n\n" "Valid values:\n" - f"{pprint.pformat(le3_df)}" + f"{pprint.pformat(le3_table)}" ) ) @@ -1805,7 +1809,7 @@ def get_scientific_product_list(self, *, observation_id=None, tile_index=None, c if product_type is not None: conditions.append(f"product_type = '{product_type}'") else: - valid_products = (filtered["product_type"].unique().tolist()) + valid_products = unique(filtered, keys="product_type")["product_type"].tolist() if not valid_products: raise ValueError("No valid product types found.") diff --git a/astroquery/esa/euclid/tests/data/test_get_valid_le3_configuration.vot b/astroquery/esa/euclid/tests/data/test_get_valid_le3_configuration.vot new file mode 100644 index 0000000000..ce351acca0 --- /dev/null +++ b/astroquery/esa/euclid/tests/data/test_get_valid_le3_configuration.vot @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Internal Data ProductsVMSP GroupDpdLE3IDVMSPConfiguration
Internal Data ProductsSEL Config/StatsDpdLE3IDSELIDStatistics
External Data ProductsLE3-ED configuration catalogDpdLE3edConfigurationFile
External Data ProductsLE3-ED match catalogDpdLE3edMatchedCatalog
Weak Lensing Products2PCFDpdTwoPCFWLCOSEBIFilter
Weak Lensing ProductsPKDpdPKWLAlms
Weak Lensing Products2D-MASSDpdTwoDMassParamsConvergenceClusters
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointAutoCorr
Galaxy Clustering Products3PCF_BKDpdLE3gcThreePointAll
Galaxy Clustering ProductsCM-2PCFDpdLE3gcCovmatTwoPointCov1D
Galaxy Clustering ProductsCM-PKDpdLE3gcCovmatPKCov1D
Clusters of GalaxiesGrpCatalogDpdLE3clAMICOModel
Clusters of GalaxiesGrpCOMBDpdLE3clCombConfigurationSet
Clusters of GalaxiesGrpSELDpdLE3clSelRandomParams
Clusters of GalaxiesGrpClusteringDpdLE3clTwoPointAutoCorrPol
Clusters of GalaxiesGrpLMFDpdLE3clLMFParams
Clusters of GalaxiesGrpTilingDpdLE3clCLTile
Internal Data ProductsVMSP GroupDpdLE3IDVMSPDetectionModel
Internal Data ProductsSEL Config/StatsDpdLE3IDSELConfigurationSet
Weak Lensing Products2PCFDpdTwoPCFWLParamsCOSEBIShearShear2D
Weak Lensing ProductsPKDpdPKWLCovMatrix2D
Weak Lensing Products2D-MASSDpdTwoDMassParamsConvergencePatch
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointCrossCorr
Galaxy Clustering Products3PCF_BKDpdLE3gcThreePointSin
Galaxy Clustering ProductsCM-2PCFDpdLE3gcCovmatTwoPointCov2Dcart
Galaxy Clustering ProductsCM-PKDpdLE3gcCovmatPKCov2Dcart
Clusters of GalaxiesGrpCatalogDpdLE3clDetMergeParams
Clusters of GalaxiesGrpCOMBDpdLE3clCombRedSheProf
Clusters of GalaxiesGrpSELDpdLE3clSelSelFuncInputParams
Clusters of GalaxiesGrpClusteringDpdLE3clCovmatTwoPointCov2
Clusters of GalaxiesGrpLMFDpdLE3clLMFOutput
Clusters of GalaxiesGrpTilingDpdLE3clCommon
Internal Data ProductsVMSP GroupDpdLE3IDVMSPDistModel
Weak Lensing Products2PCFDpdTwoPCFWLParamsClPosPos2D
Weak Lensing ProductsPKDpdPKWLEstimate2D
Weak Lensing Products2D-MASSDpdTwoDMassParamsConvergencePatchesToSphere
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointRecCrossCorr
Galaxy Clustering Products3PCF_BKDpdLE3gcBkMonopole
Galaxy Clustering ProductsCM-2PCFDpdLE3gcCovmatTwoPointCov2Dpol
Galaxy Clustering ProductsCM-PKDpdLE3gcCovmatPKCov2Dpol
Clusters of GalaxiesGrpCatalogDpdLE3clDetOnMockParams
Clusters of GalaxiesGrpCOMBDpdLE3clCombUCovRedSheProf
Clusters of GalaxiesGrpSELDpdLE3clSelSinfoniaIniClMockInputParams
Clusters of GalaxiesGrpClusteringDpolDpdLE3clCovmatPKCov1
Clusters of GalaxiesGrpTilingDpdLE3clConfigurationSet
Internal Data ProductsVMSP GroupDpdLE3IDVMSPRandomCatalog
Weak Lensing Products2PCFDpdTwoPCFWLParamsPEBPosShear2D
Weak Lensing ProductsPKDpdPKWLMaps
Weak Lensing Products2D-MASSDpdTwoDMassParamsConvergenceSphere
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointRecAutoCorr
Galaxy Clustering Products3PCF_BKDpdLE3gcBkMultipole
Galaxy Clustering ProductsCM-2PCFDpdLE3gcCovmatTwoPointCovMu
Clusters of GalaxiesGrpCatalogDpdLE3clDetInputParams
Clusters of GalaxiesGrpCOMBDpdLE3clCombWLME
Clusters of GalaxiesGrpSELDpdLE3clSelSinfoniaMockInputParams
Clusters of GalaxiesGrpClusteringDDpdLE3clPkDOA
Weak Lensing Products2PCFDpdTwoPCFWLParamsPEBShearShear2D
Weak Lensing ProductsPKDpdPKWLMixingMatrix2D
Weak Lensing Products2D-MASSDpdTwoDMassParamsPeakCatalogConvergence
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointAutoCorrCart
Galaxy Clustering ProductsCM-2PCFDpdLE3gcCovmatTwoPointCovPro
Clusters of GalaxiesGrpCatalogDpdLE3clAmicoAux
Clusters of GalaxiesGrpCOMBDpdLE3clCombCovMatDeltaSigmaCosmoDep
Clusters of GalaxiesGrpSELDpdLE3clSelSelFunc
Clusters of GalaxiesGrpClusteringDpdLE3clPkYam
Weak Lensing Products2PCFDpdTwoPCFWLClPosPos2D
Weak Lensing Products2PCFDpdTwoPCFWLPEBPosShear2D
Weak Lensing Products2PCFDpdTwoPCFWLPEBShearShear2D
Weak Lensing Products2PCFDpdTwoPCFWLPosPos2D
Weak Lensing Products2PCFDpdTwoPCFWLPosShear2D
Weak Lensing Products2PCFDpdTwoPCFWLShearShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLParams
Weak Lensing Products2PCFDpdCovarTwoPCFWLClPosPos2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLCOSEBIShearShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLPEBPosShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLPEBShearShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLPosPos2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLPosShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLShearShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLResampleCOSEBIShearShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLResampleClPosPos2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLResamplePEBPosShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLResamplePEBShearShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLResamplePosPos2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLResamplePosShear2D
Weak Lensing Products2PCFDpdCovarTwoPCFWLResampleShearShear2D
Weak Lensing Products2D-MASSDpdTwoDMassConvergenceSphere
Weak Lensing Products2D-MASSDpdTwoDMassPeakCatalog
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointCrossCorrPol
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointRecAutoCorrPol
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointRecCrossCorrPol
Galaxy Clustering Products2PCF_PKDpdLE3gcPkCross
Galaxy Clustering Products2PCF_PKDpdLE3gcPkDOA
Galaxy Clustering Products2PCF_PKDpdLE3gcPkYam
Clusters of GalaxiesGrpCatalogDpdLE3FullDet
Clusters of GalaxiesGrpCatalogDpdLE3clCatMergeParams
Clusters of GalaxiesGrpCatalogDpdLE3clCcpInputParams
Clusters of GalaxiesGrpCatalogDpdLE3clRichMembers
Clusters of GalaxiesGrpCatalogDpdLE3clZClParams
Clusters of GalaxiesGrpCatalogDpdLE3clGlueMatchParams
Clusters of GalaxiesGrpCatalogDpdLE3clMockGlueMatchParams
Clusters of GalaxiesGrpSELDpdLE3clMatchForSelParams
Clusters of GalaxiesGrpSELDpdLE3clMockClusters
Weak Lensing Products2PCFDpdTwoPCFWLCOSEBIShearShear2D
Weak Lensing Products2D-MASSDpdTwoDMassConvergencePatch
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointAutoCorrPol
Clusters of GalaxiesGrpCatalogDpdLE3clDetClusters
Clusters of GalaxiesGrpCOMBDpdLE3clCombStackingCosmoInd
Clusters of GalaxiesGrpSELDpdLE3clSelRandom
Weak Lensing Products2PCFDpdTwoPCFWLParamsShearShear2D
Weak Lensing Products2D-MASSDpdTwoDMassConvergencePatchesToSphere
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointRecCrossCorrCart
Clusters of GalaxiesGrpCatalogDpdLE3clPZWAVDensity
Clusters of GalaxiesGrpCOMBDpdLE3clCombStackingCosmoDep
Clusters of GalaxiesGrpSELDpdLE3clRedshiftDistrib
Weak Lensing Products2PCFDpdTwoPCFWLParamsPosShear2D
Weak Lensing Products2D-MASSDpdTwoDMassConvergenceClusters
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointRecAutoCorrCart
Clusters of GalaxiesGrpCatalogDpdLE3clPzwavAux
Internal Data ProductsSEL WideDpdLE3IDSELIDCatalog
Clusters of GalaxiesGrpCOMBDpdLE3clCombCovMatReducedShearCosmoIndep
Clusters of GalaxiesGrpSELDpdLE3clSelSubSample
Weak Lensing Products2PCFDpdTwoPCFWLParamsPosPos2D
Weak Lensing Products2D-MASSDpdTwoDMassParamsPeakCatalogMassAperture
Galaxy Clustering Products2PCF_PKDpdLE3gcTwoPointCrossCorrCart
Clusters of GalaxiesGrpCatalogDpdLE3clAssociations
Clusters of GalaxiesGrpCOMBDpdLE3clCombCovMatReducedShearCosmoDep
Clusters of GalaxiesGrpSELDpdLE3clSinfoniaEllipticity
Internal Data ProductsSEL WideDpdLE3IDSELIDSubsampledCatalog
Internal Data ProductsVisibilityMasksVMPZDpdRandomCatalogVMPZ
+
+
diff --git a/astroquery/esa/euclid/tests/test_euclidtap.py b/astroquery/esa/euclid/tests/test_euclidtap.py index f6cfbdb20d..ad543ca057 100644 --- a/astroquery/esa/euclid/tests/test_euclidtap.py +++ b/astroquery/esa/euclid/tests/test_euclidtap.py @@ -15,13 +15,15 @@ import astropy.units as u import numpy as np -import pandas as pd import pytest from astropy import coordinates from astropy.coordinates.sky_coordinate import SkyCoord +from astropy.io.votable import parse_single_table from astropy.table import Column, Table from astropy.units import Quantity from astropy.utils.data import get_pkg_data_filename +from requests import HTTPError + from astroquery.esa.euclid.core import EuclidClass from astroquery.esa.euclid.core import conf from astroquery.utils.commons import ASTROPY_LT_7_1_1 @@ -30,7 +32,6 @@ from astroquery.utils.tap.core import TapPlus, Tap from astroquery.utils.tap.model.tapcolumn import TapColumn from astroquery.utils.tap.model.taptable import TapTableMeta -from requests import HTTPError package = "astroquery.esa.euclid.tests" @@ -53,6 +54,10 @@ os.path.join("data", 'test_get_scientific_product_list.csv'), package=package) TEST_GET_SCIENTIFIC_PRODUCT_LIST = Path(LE3_SCIENTIFIC_PRODUCT_LIST_FILE_NAME).read_text() +LE3_VALID_CONFIGURATION_FILE_NAME = get_pkg_data_filename( + os.path.join("data", 'test_get_valid_le3_configuration.vot'), package=package) +TEST_GET_LE3_VALID_CONFIGURATION = Path(LE3_VALID_CONFIGURATION_FILE_NAME).read_text() + MULTIPLE_GET_SPECTRUM = get_pkg_data_filename(os.path.join("data", 'get_spectrum_output.zip'), package=package) SINGLE_GET_SPECTRUM = get_pkg_data_filename(os.path.join("data", '1499442653027920313.fits.zip'), package=package) @@ -1523,18 +1528,29 @@ def test_get_spectrum_exceptions(): output_file='fits_file') -@patch.object(EuclidClass, 'get_valid_le3_configuration_values') -def test_get_scientific_data_product_list(mock_get_valid_le3_configuration_values): - data = [] +def test_get_valid_le3_configuration_values(): + conn_handler = DummyConnHandler() + + tap_plus = TapPlus(url="http://test:1111/tap", data_context='data', client_id='ASTROQUERY', + connhandler=conn_handler) + # Launch response: we use default response because the query contains decimals + response_launch_job = DummyResponse(200) + response_launch_job.set_data(method='POST', context=None, body=TEST_GET_LE3_VALID_CONFIGURATION, headers=None) + + conn_handler.set_default_response(response_launch_job) - for category, groups in conf._Conf__VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS.items(): - for group, product_types in groups.items(): - for product_type in product_types: - data.append([category, group, product_type]) + euclid = EuclidClass(tap_plus_conn_handler=conn_handler, datalink_handler=tap_plus, show_server_messages=False) + + result = euclid.get_valid_le3_configuration_values() - df = pd.DataFrame(data, columns=["level_3_category", "level_3_group", "product_type"]) + assert result is not None + assert len(result) == 130 - mock_get_valid_le3_configuration_values.return_value = df + +@patch.object(EuclidClass, 'get_valid_le3_configuration_values') +def test_get_scientific_data_product_list(mock_get_valid_le3_configuration_values): + mock_get_valid_le3_configuration_values.return_value = parse_single_table( + LE3_VALID_CONFIGURATION_FILE_NAME).to_table() conn_handler = DummyConnHandler() tap_plus = TapPlus(url="http://test:1111/tap", data_context='data', client_id='ASTROQUERY', @@ -1609,16 +1625,8 @@ def test_get_scientific_data_product_list(mock_get_valid_le3_configuration_value @patch.object(EuclidClass, 'get_valid_le3_configuration_values') def test_get_scientific_data_product_list_exceptions(mock_get_valid_le3_configuration_values): - data = [] - - for category, groups in conf._Conf__VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS.items(): - for group, product_types in groups.items(): - for product_type in product_types: - data.append([category, group, product_type]) - - df = pd.DataFrame(data, columns=["level_3_category", "level_3_group", "product_type"]) - - mock_get_valid_le3_configuration_values.return_value = df + mock_get_valid_le3_configuration_values.return_value = parse_single_table( + LE3_VALID_CONFIGURATION_FILE_NAME).to_table() euclid = EuclidClass() @@ -1639,28 +1647,28 @@ def test_get_scientific_data_product_list_exceptions(mock_get_valid_le3_configur match=r"Invalid parameter combination:\ncategory=None\ngroup=not_valid\nproduct_type=None*."): euclid.get_scientific_product_list(observation_id=11111, group='not_valid') - with pytest.raises(ValueError, - match=r"Invalid parameter combination:\ncategory=None\ngroup=None\nproduct_type=not_valid\n\nValid values*."): + values__ = r"Invalid parameter combination:\ncategory=None\ngroup=None\nproduct_type=not_valid\n\nValid values*." + with pytest.raises(ValueError, match=values__): euclid.get_scientific_product_list(observation_id=11111, product_type='not_valid') - with pytest.raises(ValueError, - match=r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=not_valid\nproduct_type=None\n\nValid values*."): + values__ = r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=not_valid*." + with pytest.raises(ValueError, match=values__): euclid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', group='not_valid') - with pytest.raises(ValueError, - match=r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=GrpCatalog\nproduct_type=not_valid\n\nValid values:*."): + values__ = r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=GrpCatalog*." + with pytest.raises(ValueError, match=values__): euclid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', group='GrpCatalog', product_type='not_valid') - with pytest.raises(ValueError, - match=r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=None\nproduct_type=not_valid\n\nValid values:*."): + values__ = r"Invalid parameter combination:\ncategory=Clusters of Galaxies\ngroup=None\nproduct_type=not_valid*." + with pytest.raises(ValueError, match=values__): euclid.get_scientific_product_list(observation_id=11111, category='Clusters of Galaxies', product_type='not_valid') - with pytest.raises(ValueError, - match=r"Invalid parameter combination:\ncategory=None\ngroup=GrpCatalog\nproduct_type=not_valid\n\nValid values:*."): + values__ = r"Invalid parameter combination:\ncategory=None\ngroup=GrpCatalog\nproduct_type=not_valid*." + with pytest.raises(ValueError, match=values__): euclid.get_scientific_product_list(observation_id=11111, group='GrpCatalog', product_type='not_valid') with pytest.raises(ValueError,