diff --git a/tests/integration/popular_collections/NSIDC_ECS.txt b/tests/integration/popular_collections/NSIDC_ECS.txt new file mode 100644 index 00000000..7afa91f7 --- /dev/null +++ b/tests/integration/popular_collections/NSIDC_ECS.txt @@ -0,0 +1,100 @@ +C2559919423-NSIDC_ECS +C2565090645-NSIDC_ECS +C2564427300-NSIDC_ECS +C2564625052-NSIDC_ECS +C1646610417-NSIDC_ECS +C1646610079-NSIDC_ECS +C2650116584-NSIDC_ECS +C2776463943-NSIDC_ECS +C1646610415-NSIDC_ECS +C2531308461-NSIDC_ECS +C2317038246-NSIDC_ECS +C1600510471-NSIDC_ECS +C2541211133-NSIDC_ECS +C1000000443-NSIDC_ECS +C2750966856-NSIDC_ECS +C1000000461-NSIDC_ECS +C2607017115-NSIDC_ECS +C2738530540-NSIDC_ECS +C2561045326-NSIDC_ECS +C2399557265-NSIDC_ECS +C2136471727-NSIDC_ECS +C2560378689-NSIDC_ECS +C2136471705-NSIDC_ECS +C2776464171-NSIDC_ECS +C1931663473-NSIDC_ECS +C2567856357-NSIDC_ECS +C1646610394-NSIDC_ECS +C1431539277-NSIDC_ECS +C2666857908-NSIDC_ECS +C2176562253-NSIDC_ECS +C2537927247-NSIDC_ECS +C1000000400-NSIDC_ECS +C2776463935-NSIDC_ECS +C1542606326-NSIDC_ECS +C2623698025-NSIDC_ECS +C1000000445-NSIDC_ECS +C2737912334-NSIDC_ECS +C2776464127-NSIDC_ECS +C1431413941-NSIDC_ECS +C2737997483-NSIDC_ECS +C2509060594-NSIDC_ECS +C1000000460-NSIDC_ECS +C1646609734-NSIDC_ECS +C1631093696-NSIDC_ECS +C189991864-NSIDC_ECS +C1449515322-NSIDC_ECS +C2737997243-NSIDC_ECS +C189991870-NSIDC_ECS +C1000000420-NSIDC_ECS +C1646610247-NSIDC_ECS +C189991869-NSIDC_ECS +C2420522159-NSIDC_ECS +C189991871-NSIDC_ECS +C1000000464-NSIDC_ECS +C1365767075-NSIDC_ECS +C189991863-NSIDC_ECS +C1371883515-NSIDC_ECS +C1646609754-NSIDC_ECS +C1646610390-NSIDC_ECS +C1646583410-NSIDC_ECS +C1452437262-NSIDC_ECS +C2548345108-NSIDC_ECS +C1646609808-NSIDC_ECS +C1574621139-NSIDC_ECS +C2794540918-NSIDC_ECS +C2776463773-NSIDC_ECS +C1601063219-NSIDC_ECS +C2776463679-NSIDC_ECS +C2534576405-NSIDC_ECS +C2037494637-NSIDC_ECS +C1646610101-NSIDC_ECS +C2253727823-NSIDC_ECS +C179014688-NSIDC_ECS +C2692731693-NSIDC_ECS +C1542606320-NSIDC_ECS +C1432250096-NSIDC_ECS +C1723866830-NSIDC_ECS +C2817412114-NSIDC_ECS +C179014696-NSIDC_ECS +C2076118670-NSIDC_ECS +C179014698-NSIDC_ECS +C128599377-NSIDC_ECS +C2519306057-NSIDC_ECS +C1454773262-NSIDC_ECS +C130038008-NSIDC_ECS +C179014694-NSIDC_ECS +C1646610212-NSIDC_ECS +C1995259960-NSIDC_ECS +C179014690-NSIDC_ECS +C1997893797-NSIDC_ECS +C1489170961-NSIDC_ECS +C2559364353-NSIDC_ECS +C2295286903-NSIDC_ECS +C2137003017-NSIDC_ECS +C2136471686-NSIDC_ECS +C186584407-NSIDC_ECS +C1000001740-NSIDC_ECS +C1442092309-NSIDC_ECS +C1703031106-NSIDC_ECS +C2776463734-NSIDC_ECS diff --git a/tests/integration/popular_collections/generate.py b/tests/integration/popular_collections/generate.py new file mode 100644 index 00000000..91e84e94 --- /dev/null +++ b/tests/integration/popular_collections/generate.py @@ -0,0 +1,41 @@ +"""Generate lists of most popular collections for each of the hardcoded DAACs.""" + +from pathlib import Path + +import requests + +THIS_DIR = Path(__file__).parent + + +def top_collections(*, provider: str, num: int = 100) -> list[str]: + response = requests.post( + "https://cmr.earthdata.nasa.gov/search/collections.json", + data={ + "provider": provider, + "has_granules_or_cwic": True, + "include_facets": "v2", + "include_granule_counts": True, + "include_has_granules": True, + "include_tags": "edsc.*,opensearch.granule.osdd", + "page_num": 1, + "page_size": 100, + "sort_key[]": "-usage_score", + }, + ) + collection_ids = [ + collection["id"] for collection in response.json()["feed"]["entry"] + ] + return collection_ids + + +def main(): + for provider in ["NSIDC_ECS"]: + collection_ids = top_collections(provider="NSIDC_ECS") + + output = THIS_DIR / f"{provider}.txt" + with output.open("w") as f: + f.write("\n".join(collection_ids)) + + +if __name__ == "__main__": + main()