barak.io.writetable¶
- barak.io.writetable(filename, cols, units=None, names=None, header=None, keywords=None, overwrite=False)[source]¶
Write a series of data columns to a file.
Data written using this function can be read again using:
>>> atpy.Table(filename)
Parameters : filename : str
The output filename. Its suffix determines the file type. For example ‘.tbl’, ‘.fits’ or ‘.fits.gz’.
cols : structured array, atpy Table instance or a list of columns
Data to be written.
units : list
Units of each column.
names : list or string (None)
Column names. Can be a comma-separated string of names. If None and cols is a structured array, column names are the array field names.
header : str (None)
A header written before the data.
keywords : dict (None)
A dictionary of key-value pairs to write to the header.
overwrite : bool (False)
If True, overwrite an existing file without prompting.