Commit 52aa0c24 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

to astropy table

parent cc619975
......@@ -28,15 +28,18 @@ class CatalogApi(object):
return self.gaia3_query(ra, dec, radius, min_mag, max_mag, obstime, limit)
else:
return Result.error(message="%s catalog search not yet implemented" %(catalog_name, ))
def _fields_dtypes(self, rec):
fields = tuple(rec.__dataclass_fields__.keys())
dtypes = []
for _, f in rec.__dataclass_fields__.items():
if f.type == int:
dtypes.append('i8')
if f.type == float:
elif f.type == float:
dtypes.append('f8')
if f.type == str:
elif f.type == str:
dtypes.append('S2')
else:
dtypes.append('S2')
dtypes = tuple(dtypes)
return fields, dtypes
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment