read_xstable_model
- sherpa.astro.xspec.read_xstable_model(modelname, filename, etable=False)[source] [edit on github]
Create a XSPEC table model.
XSPEC additive (atable, [1]), multiplicative (mtable, [2]), and exponential (etable, [3]) table models are supported.
Changed in version 4.16.0: Parameters with negative DELTA values are now made frozen, to match XSPEC. Support for models which use the ESCALE keyword has been added. The hard_max and hard_min values of the redshift parameter (for those models that support it) can now be changed. This should be done with care as it could cause memory corruption or a crash.
Changed in version 4.14.0: The etable argument has been added to allow exponential table models to be used.
- Parameters:
modelname (str) – The identifier for this model component.
filename (str) – The name of the FITS file containing the data, which should match the XSPEC table model definition [4].
etable (bool, optional) – Set if this is an etable (as there’s no way to determine this from the file itself). Defaults to False.
- Returns:
tablemodel
- Return type:
XSTableModel instance
Notes
There is no support for table models that provide multiple spectra per parameter: that is, those with the NXFLTEXP keyword set.
References
Examples
Load in the XSPEC table model from the file ‘bbrefl_1xsolar.fits’ and create a model labelled ‘xmdl’, which is then returned:
>>> mdl = read_xstable_model('xmdl', 'bbrefl_1xsolar.fits') >>> print(mdl)
When the file is an etable model the etable parameter must be set:
>>> emdl = read_xstable_model('xmdl', 'etable.fits', etable=True) >>> print(emdl)