From 34efb0ffa3bcb2f4f0cf792012870273c597fe0c Mon Sep 17 00:00:00 2001 From: SGCMarkus Date: Wed, 6 Mar 2024 11:38:55 +0100 Subject: [PATCH] astrodatadownloader: filter for fits files only --- main/astrodatadownloader/astrodatadownloader.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/astrodatadownloader/astrodatadownloader.py b/main/astrodatadownloader/astrodatadownloader.py index f7936fb..6fe090b 100644 --- a/main/astrodatadownloader/astrodatadownloader.py +++ b/main/astrodatadownloader/astrodatadownloader.py @@ -71,6 +71,12 @@ def getStarObservations(starName: str, sources: list[ObservationSource], sequenc return obs[obsWantedFilter] +def fitsFilenameFilterFunc(table, key_colnames): + if(str(table["productFilename"]).lower().endswith(".fits") or + str(table["productFilename"]).lower().endswith(".fit")): + return True + return False + def downloadStarProducts(obs_wanted, keplerCadences, k2Cadences): if(len(keplerCadences) is not 2): raise Exception("keplerCadences needs to have length 2") @@ -105,7 +111,7 @@ def downloadStarProducts(obs_wanted, keplerCadences, k2Cadences): productsWanted = table.vstack([tessProducts, keplerProducts, k2Products]) productsWanted = productsWanted.group_by("productFilename") + productsWanted = productsWanted.groups.filter(fitsFilenameFilterFunc) filenames = Observations.download_products(productsWanted) return parse_manifest(filenames) -