Synopsis
Write arrays to an ASCII file
Syntax
write_arrays(filename, args, [fields=None, sep=" ", comment="#", clobber=False, linebreak="\n", format="%g"])
Description
Write a series of arrays as a table to an ASCII file.
Loading the routine
The routine can be loaded into Sherpa by saying:
from crates_contrib.utils import *
Function arguments
- filename - filename of outfile
- args - array of column arrays
- fields - array of strings representing the column names. None (default)=omit column names, otherwise use the supplied column names
- sep - column separation character, default=" "
- comment - column header comment character, default="#"
- clobber - clobber outfile False (default)=do not clobber file - if exists, True=clobber file - if exists
- linebreak - row separation character, default="\n"
- format - array element format, default="%g"
Examples
Example 1
sherpa> write_arrays("out.dat", [arr1, arr2, arr3])
Write arrays arr1,arr2,arr3 to a file out.dat
Example 2
sherpa> write_arrays("out.dat", [arr1, arr2, arr3], fields=["arr1","arr2","arr3"], clobber=True)
Write arrays arr1,arr2,arr3 to a file out.dat with column headers "#arr1 arr2 arr3", clobbering if necessary
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
Refer to the CIAO bug pages for an up-to-date listing of known issues.