AHELP for CIAO 4.3 Sherpa v1 | save_delchi |
Context: saving |
Synopsis
Save the delta chi fit residuals to a FITS table or ASCII file
Syntax
save_delchi( [id=1], filename, [bkg_id=1,ascii=False,clobber=False] )
Description
The save_delchi() function saves the delta chi residuals array to a FITS table or ASCII file, as columns X and DELCHI. Note that the ASCII option is not supported for 2-dimensional data sets, so the optional parameter 'ascii' should be set to 'False' in this case. The source model used is the one which has been assigned to the data set set specified in the 'id' argument (or the 'bkg_id' argument in the case of a background data set, in which case 'id' must also be specified). The model will respect any data filters in place, and models from associated PHA spectra will also respect the data grouping settings.
- id - the id of the data set to which a source model model has been assigned; if not given, uses the default data set id (id=1 by default, see "ahelp get_default_id")
- filename - name of outfile
- bkg_id - the id of the background data set to use (e.g., bkg_id=1 represents the first background data set loaded in association with the source data set specified in the 'id' argument)
- ascii - outfile format specification; True to save outfile in ASCII format, False for FITS, default=False
- clobber - clobber outfile; default=False (do not clobber if file exists)
Example 1
sherpa> save_delchi("delchi.fits")
The save_delchi() function can be called with just a filename, in which case all the default arguments will be used. In this example, the delta chi residuals array associated with data set id=1 is written to the FITS file 'delchi.fits'.
Example 2
sherpa> save_delchi(2, "delchi.txt", ascii=True)
Here, the optional 'ascii' argument is set to True in order to produce an outfile in ASCII format (overriding the default setting ascii=False). The delta chi residuals array assigned to data set id=2 is written to the ASCII file 'delchi.txt'.
Example 3
sherpa> save_delchi(2,"delchi.fits", bkg_id=1, clobber=True)
The delta chi residuals associated with the first background data set loaded for source data set 2 is written to FITS file 'delchi.fits' (note the 'ascii' parameter default is False).
See Also
- contrib
- save_chart_spectrum
- data
- dataspace1d, dataspace2d, fake, get_bkg_plot, 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, list_model_ids, show_bkg_model, show_bkg_source
- modeling
- add_model, add_user_pars, clean, create_model_component, delete_bkg_model, delete_model, delete_model_component, get_model, get_model_autoassign_func, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_source, get_source_component_image, get_source_component_plot, image_model, image_model_component, image_source, image_source_component, integrate, link, load_table_model, load_user_model, reset, save_model, save_source, set_bkg_model, set_full_model, set_model_autoassign_func, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
- plotting
- plot_model, plot_model_component, plot_source, plot_source_component
- psfs
- delete_psf, load_conv
- saving
- restore, save, save_all, save_arrays, save_data, 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
- utilities
- calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, eqwidth
- visualization
- contour_model, contour_ratio, contour_resid, get_ratio, get_resid