Closed ziotom78 closed 10 years ago
Thanks, this looks great! I will suggest one change, which is to define ColumnDef
as
typealias ColumnDef (ASCIIString,ASCIIString,ASCIIString)
That way you can write
coldefs = [("SPEED", "1D", "m/s"),
("MASS", "1E", "kg"),
("PARTICLE", "20A", "Name")]
and you don't need to export ColumnDef
.
I must admit that I find quite confusing to use a tuple instead of a struct, as one does not have a way to name the elements in it — for instance, I am always fearing the risk of mistakenly mix up ttype
with tform
. Moreover, having an explanation of ttype
, tform
, and tunit
in the documentation that was kept separate from the docs offits_create_ascii_table
(the place where I have moved this explanation) would have allowed a more elegant way to refer to it from other functions (yet to be implemented) that will refer to ColumnDef
, like fits_insert_atbl
, fits_insert_btbl
, and fits_insert_col
.
Anyway, these are minor issues. I've updated the script with the changes suggested. The documentation has been updated as well. (As said above, I needed to change the flow of the text a bit, as now the meaning of ttype
, tform
, and tunit
is explained in the documentation of fits_create_ascii_table
.)
A set of new functions to deal with ASCII and binary tables. Most of them are thin bindings to CFITSIO, but in a few cases I modified a bit the API:
fits_create_ascii_table
andfits_create_binary_table
. I feel this is much clearer to read. Moreover, using the Tab key from the Julia REPL allows one to easily pick the right function name. This would not have been true if the binding had required to specify some string (likeASCII
orBINARY
) as its second parameter.fits_create_ascii_table
/fits_create_binary_table
is through the typeColumnDef
. I believe this is significantly easier and less error-prone than CFITSIO's approach of asking three string arrays. See an example here: https://github.com/ziotom78/adafits#differences-from-cfitsioThe Sphinx documentation has been updated accordingly with a section named "Table routines".