astrodatadownloader: Kepler/K2 files dont have sectors in their filenames

This commit is contained in:
2024-03-06 14:09:25 +01:00
parent e6dbfdb110
commit 3c8e167177
@@ -27,15 +27,18 @@ def parse_manifest(manifest):
for i,f in enumerate(manifest['Local Path']): for i,f in enumerate(manifest['Local Path']):
file_parts = np.array(np.unique(f.split(sep = '-'))) file_parts = np.array(np.unique(f.split(sep = '-')))
sectors = list( map ( lambda x: x[0:2] == 's0', file_parts)) sectors = list( map ( lambda x: x[0:2] == 's0', file_parts))
s1 = file_parts[sectors][0] if(len(file_parts[sectors]) > 0):
try: s1 = file_parts[sectors][0]
s2 = file_parts[sectors][1] try:
except: s2 = file_parts[sectors][1]
s2 = s1 except:
if(s1 == s2): s2 = s1
sector_range.append("%s" % s1) if(s1 == s2):
sector_range.append("%s" % s1)
else:
sector_range.append("%s-%s" % (s1,s2))
else: else:
sector_range.append("%s-%s" % (s1,s2)) sector_range.append("-")
path_parts = np.array(f.split(sep = '/')) path_parts = np.array(f.split(sep = '/'))
filenames.append(path_parts[-1]) filenames.append(path_parts[-1])
exts.append(path_parts[-1][-8:]) exts.append(path_parts[-1][-8:])