How do I use an XSPEC table model?
Some XSPEC models are defined as "table models", where the model has been evaluated for a fixed set of parameters and then interpolation is used to create the model for a given set of models. In XSPEC these models are created with the atable, mtable, and etable expressions. The Table models section of the "More models for XSPEC" page contains links to a number of such models.
In sherpa, they are loaded with the load_xstable_model command, and the command knows whether the model is an additive (atable) or multiplicative (mtable) model from the contents of the file. To load an etable model you add the etable=True argument to the call.
As an example, the Warped disk AGN obscured model (Buchner et al. 2021) provides two additive models which can be combined in XSPEC with the model expression tbabs * atable{warpeddisk.fits} + atable{warpeddisk-omni.fits} * const which can be replicated in Sherpa with:
sherpa> load_xstable_model("wdisk", "warpeddisk.fits") sherpa> load_xstable_model("wmirror", "warpeddisk-omni.fits") sherpa> print(wdisk) xstablemodel.wdisk Param Type Value Min Max Units ----- ---- ----- --- --- ----- wdisk.nhlos thawed 100 0.01 10000 wdisk.phoindex thawed 2 1 3 wdisk.ecut frozen 400 20 400 wdisk.diskfrac thawed 1 0.125 1 wdisk.nhdisk frozen 25 24 25.5 wdisk.theta_inc thawed 90 0 90 wdisk.redshift frozen 0 0 5 wdisk.norm thawed 1 0 1e+24 sherpa> print(wmirror) xstablemodel.wmirror Param Type Value Min Max Units ----- ---- ----- --- --- ----- wmirror.nhlos thawed 100 0.01 10000 wmirror.phoindex thawed 2 1 3 wmirror.ecut frozen 400 20 400 wmirror.diskfrac thawed 1 0.125 1 wmirror.nhdisk frozen 25 24 25.5 wmirror.theta_inc thawed 90 0 90 wmirror.redshift frozen 0 0 5 wmirror.norm thawed 1 0 1e+24 sherpa> set_source(xstbabs.gabs * wdisk + xsconstant.scale * wmirror)
In CIAO 4.16 you can also load these files with the load_table_model command, but this is deprecated and this feature will be removed in a future release. Please ensure you use load_xstable_model in your scripts, notebooks, and analysis sessions.