tabledump(filename, datafile=None, cdfile=None, hfile=None, ext=1, overwrite=False)
The primary use for the tabledump
function is to allow editing in a standard text editor of the table data and parameters. The tableload
function can be used to reassemble the table from the three ASCII files.
datafile: Each line of the data file represents one row of table data. The data is output one column at a time in column order. If a column contains an array, each element of the column array in the current row is output before moving on to the next column. Each row ends with a new line.
Integer data is output right-justified in a 21-character field followed by a blank. Floating point data is output right justified using 'g' format in a 21-character field with 15 digits of precision, followed by a blank. String data that does not contain whitespace is output left-justified in a field whose width matches the width specified in the TFORM
header parameter for the column, followed by a blank. When the string data contains whitespace characters, the string is enclosed in quotation marks ( ""
). For the last data element in a row, the trailing blank in the field is replaced by a new line character.
For column data containing variable length arrays ('P' format), the array data is preceded by the string 'VLA_Length= '
and the integer length of the array for that row, left-justified in a 21-character field, followed by a blank.
This format does not support variable length arrays using the
('Q' format) due to difficult to overcome ambiguities. What this means is that this file format cannot support VLA columns in tables stored in files that are over 2 GB in size.
For column data representing a bit field ('X' format), each bit value in the field is output right-justified in a 21-character field as 1 (for true) or 0 (for false).
cdfile: Each line of the column definitions file provides the definitions for one column in the table. The line is broken up into 8, sixteen-character fields. The first field provides the column name ( TTYPEn
). The second field provides the column format ( TFORMn
). The third field provides the display format ( TDISPn
). The fourth field provides the physical units ( TUNITn
). The fifth field provides the dimensions for a multidimensional array ( TDIMn
). The sixth field provides the value that signifies an undefined value ( TNULLn
). The seventh field provides the scale factor ( TSCALn
). The eighth field provides the offset value ( TZEROn
). A field value of ""
is used to represent the case where no value is provided.
hfile: Each line of the header parameters file provides the definition of a single HDU header card as represented by the card image.
Input fits file.
Output data file. The default is the root name of the input fits file appended with an underscore, followed by the extension number (ext), followed by the extension .txt
.
Output column definitions file. The default is :None:None:`None`
, no column definitions output is produced.
Output header parameters file. The default is :None:None:`None`
, no header parameters output is produced.
The number of the extension containing the table HDU to be dumped.
If True
, overwrite the output file if it exists. Raises an OSError
if False
and the output file exists. Default is False
.
overwrite
replaces the deprecated clobber
argument.
Dump a table HDU to a file in ASCII format. The table may be dumped in three separate files, one containing column definitions, one containing header parameters, and one for table data.
The following pages refer to to this document either explicitly or contain code examples using this.
astropy.io.fits.convenience.tabledump
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them