Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2015

URL: http://cxc.harvard.edu/sherpa/ahelp/set_xsxset.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.9 Sherpa v1

set_xsxset

Context: modeling

Synopsis

Set and get environment variables for XSPEC models

Syntax

set_xsxset(name, value)
get_xsxset(name)

The variable name is case insensitive and so is converted to upper case
by these routines.
The value must be a string and not a number - e.g. '2.0'.

Description

The set_xsxset() command is associated with the XSPEC XSET command for defining XSPEC model environment variables. The required string arguments for set_xsxset() are a model environment variable name and an associated value to which it should be set. The get_xsxset() command returns the current value setting for the specified model variable. Note that get_xsxset only returns a value once the corresponding set_xsxset command has been made, otherwise it returns the empty string.

To see if the setting is being used, try using the set_xschatter command to increase the chatter level; that is, to see more screen output from the models.

Parameters that can be set

Parameter name Description Models
APECNOLINES Should the APEC models include line emission? If set to 'on' then the APEC models will not include line emission (the default is 'off', i.e. to include lines). xsapec, xsvapec, xsbapec, xsbvapec, xsequil, xsvequil, xsnpshock, xsvnpshock, xspshock, xsvpshock, xssedov, xsvsedov, xsc6mekl, xsc6vmekl, xsc6pmekl, xsc6pvmekl, xscemkl, xscevmkl, xsmekal, xsvmekal, xsmkcflow, xsvmclow, xsgadem, xsvgadem
APECROOT Switch from default APEC input files. xsapec, xsvapec, xsbapec, xsbvapec, xsequil, xsvequil, xsnpshock, xsvnpshock, xspshock, xsvpshock, xssedov, xsvsedov, xsc6mekl, xsc6vmekl, xsc6pmekl, xsc6pvmekl, xscemkl, xscevmkl, xsmekal, xsvmekal, xsmkcflow, xsvmclow, xsgadem, xsvgadem
APECTHERMAL Thermally broaden emission lines in APEC input files. xsapec, xsvapec, xsbapec, xsbvapec, xsequil, xsvequil, xsnpshock, xsvnpshock, xspshock, xsvpshock, xssedov, xsvsedov, xsc6mekl, xsc6vmekl, xsc6pmekl, xsc6pvmekl, xscemkl, xscevmkl, xsmekal, xsvmekal, xsmkcflow, xsvmclow, xsgadem, xsvgadem
APECVELOCITY Velocity broaden emission lines in APEC input files. xsapec, xsvapec, xsbapec, xsbvapec, xsequil, xsvequil, xsnpshock, xsvnpshock, xspshock, xsvpshock, xssedov, xsvsedov, xsc6mekl, xsc6vmekl, xsc6pmekl, xsc6pvmekl, xscemkl, xscevmkl, xsmekal, xsvmekal, xsmkcflow, xsvmclow, xsgadem, xsvgadem
NEIAPECROOT Switch from default NEIAPEC input files. xsgnei, xsnei, xsvgnei, xsnvei, xsequil, xsvequil, xsnpshock, xsvnpshock, xspshock, xsvpshock, xssedov, xsvsedov
POW_EMIN, POW_EMAX Switch to normalize to a flux calculated over an energy range. xspowerlaw, xsbknpower, xbskn2pow, xscutoffpl
NEIVERS Switch NEIAPEC version number. xsgnei, xsnei, xsvgnei, xsnvei, xsequil, xsvequil, xsnpshock, xsvnpshock, xspshock, xsvpshock, xssedov, xsvsedov
CFLOW_VERSION Switch CFLOW version number. xsmkcflow, xsvmcflow
CFLOW_NTEMPS Switch number of temperature bins used in CFLOW model. xsmkcflow, xsvmcflow
APEC_TRACE_ABUND Control the abundances of elements included in AtomDB 2.0 but not in earlier versions. To set these abundances to zero use set_xsxset('APEC_TRACE_ABUND', '0.0'). The trace element abundances can be set to any value or linked to the abundance of one of the more common elements: e.g. set_xsxset('APEC_TRACE_ABUND', 'Fe'). APEC-based models
NEI_TRACE_ABUND As APEC_TRACE_ABUND, but for the NEI APEC models. Non-Equilibrium Ionization APEC-based models
NSA_FILE Change filename used for model data. xsnsa
NSAGRAV_DIR Change directory used for model data files. xsnsagrav
NSMAX_DIR Change directory used for model data files. xsnsmax
ZXIPCF_DIR Change directory used for model data files. xszxipcf

XSPEC version

This information is taken from the XSPEC User's Guide. Version 12.9.0o of the XSPEC models is supplied with CIAO 4.9.

Example 1

sherpa> set_xsxset("NEIVERS", "2.0")
sherpa> set_xsxset("NEIAPECROOT",
"/data/spectral/modelData/APEC_nei_v11")
sherpa> set_source(xsvnei.nn)
sherpa> get_xsxset("NEIAPECROOT")
'/data/spectral/modelData/APEC_nei_v11'

Set the NEIVERS model variable to a value of 2.0 and switch the NEIAPECROOT variable to point to the APEC NEI data files which can be downloaded at the "XSPEC data For APEC NEI Models" link in the HEASARC download page.

Example 2

sherpa> set_source(xsapec.a1)
sherpa> set_xsxset("APECROOT", "1.3.1")

Set the APECROOT model variable to 1.3.1 so that the XSPEC Apec model components use this version of the AtomDB atomic database whenever they are evaluated, e.g. in fitting, error analysis, calculating statistics or plotting.

Example 3

sherpa> get_xsxset("POW_EMIN")
''
sherpa> set_xsxset("pow_emin", "0.5")
sherpa> get_xsxset("POW_EMIN")
'0.5'

The X-Spec settings can only be queried after they have been set with a call to set_xsxset; here the POW_EMIN value is unset and then changed to 0.5, after which the get_xsxset call returns a value. Note that the keyword is case insensitive, in that the name is converted to upper case.

Bugs

For a list of known bugs and issues with the XSPEC models, please visit the XSPEC bugs page.

To check the X-Spec version used by Sherpa, use the get_xsversion routine from the xspec module:

sherpa> from sherpa.astro.xspec import get_xsversion
sherpa> get_xsversion()
'12.9.0o'

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
data
get_bkg_plot, set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_exposure, set_grouping, set_quality, set_rmf, set_staterror, set_syserror
filtering
set_filter
info
list_model_ids, show_bkg_model, show_bkg_source
methods
set_iter_method, set_iter_method_opt, set_method, set_method_opt
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, integrate1d, link, load_table_model, load_template_model, load_user_model, normal_sample, reset, save_model, save_source, set_bkg_model, set_full_model, set_model_autoassign_func, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, t_sample, uniform_sample
plotting
get_lrt_plot, get_lrt_results, get_pvalue_plot, get_pvalue_results, plot_cdf, plot_model, plot_model_component, plot_pdf, plot_pvalue, plot_scatter, plot_source, plot_source_component, plot_trace
psfs
delete_psf, load_conv
saving
save_delchi, save_resid
statistics
set_prior, set_sampler, set_sampler_opt, set_stat
utilities
calc_chisqr, calc_energy_flux, calc_model_sum, calc_photon_flux, calc_source_sum, calc_stat, eqwidth, set_analysis, set_default_id
visualization
contour_model, contour_ratio, contour_resid, get_ratio, get_resid, image_setregion

Last modified: December 2015
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.