sherpa.astro.utils.xspec.parse_xspec_model_description(modelfile, namefunc=<function add_xs_prefix>)[source] [edit on github]

Given an XSPEC model file - e.g. the lmodel.dat file - return information about the models it contains.

  • modelfile (str or os.PathLike or file-like) – The name of the model file (often called model.dat or lmodel.dat) or a file-like object containing the file

  • namefunc (callable or None, optional) – The routine used to convert an XSPEC model name, such as “apec”, into the Sherpa class name. The default function prepends ‘XS’ to the name.


models – A representation of each model. This will include models that Sherpa does not support at this time (e.g. mixing models).

Return type

list of ModelDefinition


ValueError – An invalid or unsupported parameter line, or an unrecognized model type, was found.