astronomy-commons / hipscat-import

HiPSCat import - generate HiPSCat-partitioned catalogs
https://hipscat-import.readthedocs.io
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Support ECSV format #225

Closed hombit closed 4 months ago

hombit commented 7 months ago

Feature request

It would be great if hipscat-import could infer data types from ECSV catalogs, like Gaia DR3. Currently, user is required to provide an empty parquet file with a schema for this catalog.

astropy could help with this task. While its ECSV parser looks very slow, we still could use it just for data type inference:

from astropy.io import ascii

empty_astropy_table = ascii.read(gaia_file, format='ecsv', data_end=1)
empty_astropy_table.write('schema.parquet')

Before submitting Please check the following: