This Python 3 script converts a csv
file into an AAS style deluxetable
.
This uses some parts of the standard library as well as numpy
and astropy
. But if you are an astronomer and like to use the computer, this should not be a problem.
Please place this script in your PATH
and make it executable.
$ chmod +x csv2deluxetable.py
Once you make this file executable you can easily run it either with
csv2deluxetable data.csv
to send the resulting table to standard out. Or by
csv2deluxetable data.csv -o data.tex
to specify the output file. This repository comes with a csv
file that you can use for testing purposes.
An example of several working csv options are available in this repository. Here is one sample.
# 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
All non-data rows need to 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. This will end up in the deluxetable \tablecaption{}
tag.
More details of the format of the csv to come.
Currently you cannot change the settings of the deluxtable with the script. An option I am considering is being able to adjust the \label{}
tag via an optional flag.
I need to set a standard for this. I'll likely copy Astropy's. For now, I am open for ideas and comments, but this is my personal script, so I will have final say on what stylistic changes are made. If you disagree with me, please fork this repo and have fun!
I am also doing to take on the Astropy Code of Conduct for contributing to this repository.