csv2deluxetable
I have written and released my first utility! It takes a csv
file and converts it to a deluxetable
used by AAS. This is only useful for astronomers, and mostly American astronomers, but each paper published in the AAS suite of journals could use this utility. It’s simple enough that I thought there would be a dozen online, but I could not find any. So I took a day and wrote it. It written in Python 3 and uses numpy and astropy. These dependencies should be common place among the target audience. It is available on over on github and I’ll go through it here as well.
The script parses a csv file of the form
# x, y, z
# degree, minute, second
1, 2, 3
4, 5, 6
7, 8, 9
10, 11, 12
# This is the title of the csv file
The data rows (lines 3-6 above) are straight forward enough. All non-data rows start with #
. Row one is the data column name. Row two is the units. Both of these will end up in the deluxetable \tablehead{}
tag. The final row is the table title or caption, and will end up in the deluxetable \tablecaption{}
tag.
Once you make the script executable1, you can use the script by either run it with csv2deluxetable data.csv
to send the resulting table to standard out, or with csv2deluxetable data.csv -o data.tex
to specify the output file. This repository comes with several csv
file that used as working examples.
I am more than happy to take suggestions or contributions. Please report issues, fork the repo, or submit a pull request. I am sure this can be better, and I am happy to consider input.