Skip to content

Commit 31e3404

Browse files
Jorge Fernandez Hernandezbsipocz
authored andcommitted
EUCLIDMNGT-1275 Fix bug to retrieve data by group
1 parent 5e25fe9 commit 31e3404

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

astroquery/esa/euclid/core.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,11 +1647,10 @@ def get_scientific_product_list(self, *, observation_id=None, tile_index=None, c
16471647
f"values:\n {pprint.pformat(conf.VALID_LE3_PRODUCT_TYPES_CATEGORIES_GROUPS)}")
16481648

16491649
query_extra_condition = query_extra_condition + f" AND product_type = '{product_type}' "
1650-
else: # product_type is None
1650+
else: # group is not None and product_type is None
16511651

1652-
product_type_for_category_group_list = [element for sublist in all_groups_dict.values() for element
1653-
in sublist]
1654-
final_products = ', '.join(f"'{w}'" for w in product_type_for_category_group_list)
1652+
product_type_for_group_list = all_groups_dict[group]
1653+
final_products = ', '.join(f"'{w}'" for w in product_type_for_group_list)
16551654
query_extra_condition = query_extra_condition + f" AND product_type IN ({final_products}) "
16561655

16571656
else: # category is None and group is None

astroquery/esa/euclid/tests/test_euclidtap.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,10 @@ def test_get_scientific_data_product_list():
10821082

10831083
assert results is not None, "Expected a valid table"
10841084

1085+
results = euclid.get_scientific_product_list(group='GrpCatalog')
1086+
1087+
assert results is not None, "Expected a valid table"
1088+
10851089
results = euclid.get_scientific_product_list(category='Weak Lensing Products', group='2PCF')
10861090

10871091
assert results is not None, "Expected a valid table"

0 commit comments

Comments
 (0)