| AHELP for CIAO 4.2 | write_arrays |
Context: py.crates_contrib |
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, 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"
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
CHANGES IN CIAO 4.2
The write_arrays() routine was moved from the sherpa_contrib.flux_dist module to the crates_contrib.utils module.
Potential deprecation warning
It is likely that this routine will be removed in a later release since it replicates the functionality of the write_columns() routine.
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- sl.crates_contrib
- write_arrays
![[CIAO Logo]](../imgs/ciao_logo_navbar.gif)