| AHELP for CIAO 4.5 Sherpa v1 | save_data |
Context: saving |
Synopsis
Save a Sherpa data set to an ASCII file.
Syntax
save_data( [id,] filename [, fields=None, sep="", comment="#", clobber=False] )
Description
The save_data command saves a dataset to a column-based ASCII file. Optional arguments allow the user to assign column names, a column separator, or a comment character. This command has no return value.
The save_table command can be used to create a FITS format output file ("ahelp save_table").
- id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")
- filename - the output filename, including path
- fields - names for the output columns
- sep - the column-separating character; default is a space (" ")
- comment - character which indicates a comment line; default=#
- clobber - clobber outfile; default=False (do not clobber if file exists)
Example 1
sherpa> save_data("data.dat")Save dataset 1 as an ASCII file named "data.dat", using the default settings.
Example 2
sherpa> save_data("src", "source.ascii", ["x", "y"], "&")Dataset "src" is written to the file "source.ascii". The column names are "x" and "y", and the separator is set to "&". (This can be useful, for instance, to create a latex table from the output.)
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.
See Also
- contrib
- save_chart_spectrum
- data
- dataspace1d, dataspace2d, fake, load_arf, load_arrays, load_ascii, load_bkg, load_bkg_arf, load_bkg_rmf, load_data, load_grouping, load_image, load_multi_arfs, load_multi_rmfs, load_pha, load_quality, load_rmf, load_staterror, load_syserror, load_table, pack_image, pack_pha, pack_table, unpack_arf, unpack_arrays, unpack_ascii, unpack_bkg, unpack_data, unpack_image, unpack_pha, unpack_rmf, unpack_table
- filtering
- load_filter
- info
- get_default_id, list_bkg_ids, list_data_ids
- modeling
- add_model, add_user_pars, load_table_model, load_template_model, load_user_model, save_model, save_source
- saving
- restore, save, save_all, save_arrays, save_delchi, save_error, save_filter, save_grouping, save_image, save_pha, save_quality, save_resid, save_staterror, save_syserror, save_table, script
- statistics
- load_user_stat

![[Sherpa Logo]](../imgs/sherpa_logo_navbar.gif)