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']):
file_parts = np.array(np.unique(f.split(sep = '-')))
sectors = list( map ( lambda x: x[0:2] == 's0', file_parts))
s1 = file_parts[sectors][0]
try:
s2 = file_parts[sectors][1]
except:
s2 = s1
if(s1 == s2):
sector_range.append("%s" % s1)
if(len(file_parts[sectors]) > 0):
s1 = file_parts[sectors][0]
try:
s2 = file_parts[sectors][1]
except:
s2 = s1
if(s1 == s2):
sector_range.append("%s" % s1)
else:
sector_range.append("%s-%s" % (s1,s2))
else:
sector_range.append("%s-%s" % (s1,s2))
sector_range.append("-")
path_parts = np.array(f.split(sep = '/'))
filenames.append(path_parts[-1])
exts.append(path_parts[-1][-8:])