[AstroPy] Writing out meta data in ascii tables
Aldcroft, Thomas
aldcroft at head.cfa.harvard.edu
Mon Dec 26 13:45:02 EST 2016
On Mon, Dec 26, 2016 at 12:12 PM, Knox Long <long at stsci.edu> wrote:
> Astropy tables have the concept of meta data for a table.
>
> I would like to be able to write and read this information in an ascii
> table, ideally one formatted as ascii.fixed_width_two_line
>
> Does anyone know how to do this?
>
The ASCII ECSV format supports doing round-tripping of meta data, and as of
version 1.3 that meta data can contain astropy objects like SkyCoord, Time,
Quantity and numpy arrays.
ECSV is formatted as comma or space-delimited, and there is currently no
built-in way in astropy to get round-trip meta-data support with
fixed_width_two_line. Note that you can *write* your meta-data out in most
formats by serializing it into lines (by your favorite method), and then
set t.meta['comments'] = lines.
- Tom
>
> Thanks,
> Knox
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20161226/613811ca/attachment.html>
More information about the AstroPy
mailing list