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) -