astrodatadownloader: filter for fits files only

This commit is contained in:
2024-03-06 11:38:55 +01:00
parent 2908d986ec
commit 34efb0ffa3
@@ -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)