Adding FITS_LDAC format for reading in astropy.table.Table.read()
See original GitHub issueI am using Sextractor to output a catalogue in the FITS_LDAC format which is required in certain cases like using PSFex for extracting models of the PSFs. As specified in the PSFex manual: “The catalogue files read by PSFEx must be in SExtractor FITS_LDAC binary format.”.
sex M80-V.fits -c M80-V.sex -CATALOGUE_TYPE FITS_LDAC
>>> from astropy.table import Table
>>> out=Table.read("test.cat")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/astropy/table/table.py", line 2261, in read
return io_registry.read(cls, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/astropy/io/registry.py", line 341, in read
'read', cls, path, fileobj, args, kwargs)
File "/usr/local/lib/python2.7/site-packages/astropy/io/registry.py", line 430, in _get_valid_format
"{0}".format(format_table_str))
Exception: Format could not be identified.
I am using astropy version:
>>> astropy.__version__
u'1.1.1'
I am not able to read in the FITS_LDAC data using astropy.table.Table.read(“test.cat”) since the format isn’t supported.
It would be helpful if the format is added so that the data could be read as
astropy.table.Table.read("test.cat", format="fits.ldac")
After a bit of a research, I found that the support for FITS_LDAC format is provided in astromatic_wrapper.utils.ldac. So would astropy be integrating astromatic_wrapper in the core package or should separate functionality be added?
If someone is already working on this or wants to, I’d like to help.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (8 by maintainers)
As discussed on the mailing list, there is a Python package that seems to support reading and writing FITS-LDAC files: https://github.com/fred3m/astromatic_wrapper http://astromatic-wrapper.readthedocs.io/en/latest/working_with.html#fits-ldac-files So I think this issue can be closed ?
@AustereCuriosity - It is already possible to specify the extension name to
Table.read
, something likeTable.read("my.cat", format="fits", hdu='LDAC_OBJECTS')
. Maybe not well documented though … But there are maybe some other specific things that can justify a dedicated reader ?