create_xspec_code

sherpa.astro.utils.xspec.create_xspec_code(models)[source] [edit on github]

Create the Python classes and C++ code for the models.

Create the code fragments needed to build the XSPEC interface but they are not complete.

Parameters

models (list of ModelDefiniton) –

Returns

code – The code stored in a namedtuple with fields ‘python’ and ‘compiled’.

Return type

namedtuple

Notes

We skip any model functions that are used in multiple models, as this was an error in the XSPEC 12.8.2 model.dat which caused the eplogpar to call the wrong function. This has been fixed but we add a check here just in case.