[AstroPy] Write machine readable tables in Python?

Kevin Gullikson kevin.gullikson at gmail.com
Fri Apr 11 14:54:11 EDT 2014


Leo,

As far as implementing a writer in Astropy, the trickiest part would be
writing the Fortran-style format strings. Probably the most reliable method
would be to write the table data using the existing fixed-width formatter,
then read it back to deduce the format string.

I have used the fortranformat
<https://pypi.python.org/pypi/fortranformat>package for fortran-format
strings in the past. I've found that the string
formatting in python has a really hard time getting everything right for
input to fortran programs.


Kevin Gullikson


On Fri, Apr 11, 2014 at 1:34 PM, Leo Singer <lsinger at caltech.edu> wrote:

> Hi Paul,
>
> I think that I need to write both the ASCII table and the ReadMe header
> section. I am preparing some Machine Readable Tables for inclusion in an an
> ApJ submission, following the guidelines here:
> https://aas.org/authors/online-only-materials-guidelines
>
> I wrote a little script to send an astropy.table.Table instance to the AAS
> machine readable table converter form. That form is here:
> http://authortools.aas.org/MRT/upload.html
>
> And the script is here:
> https://gist.github.com/lpsinger/10489886
>
> As far as implementing a writer in Astropy, the trickiest part would be
> writing the Fortran-style format strings. Probably the most reliable method
> would be to write the table data using the existing fixed-width formatter,
> then read it back to deduce the format string.
>
> Leo
>
> On Apr 10, 2014, at 4:28 PM, Paul Kuin <npkuin at gmail.com> wrote:
>
> Do you mean that you need to generate the ascii tables as well as the
> format tables for the ReadMe file?
>
> On Thu, Apr 10, 2014 at 11:21 PM, Leo Singer <lsinger at caltech.edu> wrote:
>
>>
>> Does anyone know of a tool for writing Machine Readable Tables (CDS
>> format) in Python? I know that astropy.table and asciitable can read them,
>> but I need to write one.
>>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140411/e1dcfd41/attachment.html>


More information about the AstroPy mailing list