|AHELP for CIAO 4.2||
Write arrays to an ASCII file
write_arrays( filename, args, [fields=None, sep=" ", comment="#", clobber=False, linebreak="\n", format="%g"] )
Write a series of arrays as a table to an ASCII file.
The routine can be loaded into Sherpa by saying:
from crates_contrib.utils import *
- filename - filename of outfile
- args - array of column arrays
- fields - array of strings representing the column names. None (default)=omit column names, not None=use 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"
sherpa> write_arrays("out.dat", [arr1, arr2, arr3])
Write arrays arr1,arr2,arr3 to a file out.dat
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
The write_arrays() routine was moved from the sherpa_contrib.flux_dist module to the crates_contrib.utils module.
It is likely that this routine will be removed in a later release since it replicates the functionality of the write_columns() routine.
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.