This new commit solves the issue when the output format requested is 'csv'
@@ -34,9 +34,7 @@ from astropy.table import Table
from astropy import units as u
-
class GaiaClass(TapPlus):
-
"""
Proxy class to default TapPlus object (pointing to Gaia Archive)
"""
@@ -270,6 +268,8 @@ class GaiaClass(TapPlus):
if path != '':
try:
os.mkdir(path)
+ except FileExistsError:
+ print("Path %s already exist" % path)
except OSError:
print("Creation of the directory %s failed" % path)
@@ -307,7 +307,7 @@ class GaiaClass(TapPlus):
files[file] = os.path.join(r, file)
for key, value in files.items():
- if '.fits' in key or '.csv' in key:
+ if '.fits' in key:
tables = []
with fits.open(value) as hduList:
print(hduList)
@@ -322,6 +322,12 @@ class GaiaClass(TapPlus):
for table in votable.parse(value).iter_tables():
tables.append(table)
files[key] = tables
+
+ elif '.csv' in key:
+ tables = []
+ table = Table.read(value, format='ascii.csv', fast_reader=False)
+ tables.append(table)
+ files[key] = tables
return files
def get_datalinks(self, ids, verbose=False):
