renecotyfanboy / jaxspec

jaxspec is an X-ray spectra Bayesian analysis package, relying on JAX to enable just in time compilation
https://jaxspec.readthedocs.io/en/latest/
MIT License
21 stars 1 forks source link

Implement XSPEC models #25

Open renecotyfanboy opened 1 year ago

renecotyfanboy commented 1 year ago

We are willing to implement many xspec models that could be relevant to use

Additive components

Multiplicative components

Convolution components

Pile-up and mixing models to come ?

renecotyfanboy commented 1 year ago

48 add cutoffpl

renecotyfanboy commented 7 months ago

108 Added diskpbb & diskbb

renecotyfanboy commented 6 months ago

122 Added agauss, zagauss & zgauss

JohannesBuchner commented 6 months ago

You can probably recycle a lot of code (with the right units) from astromodels:

I wonder if for simple apec (only as a function of temperature within some range, fixed chosen abundances), the logarithm of the model spectrum may not be approximated with a quadratic function of temperature for each spectral energy bin. Even better would be an emulator, but that's way more involved.

For pexmon (superseding pexrav), an alternative is the disk table model available at https://github.com/JohannesBuchner/xars/blob/master/doc/README.rst#disk from https://ui.adsabs.harvard.edu/abs/2019A%26A...629A..16B/abstract

renecotyfanboy commented 6 months ago

Thank you very much for your insights ! I've already stolen code and tables from astromodels (in particular the absorption tables), but wasn't here they had a wrapper for xspec tabulated models, good thing to know

For you to know, we are dealing with APEC internally right now, it might be released in a week or two (vvapec at least), more details in #111, we finally chose to use directly the continuum, pseudo continuum and emission lines tables as provided by AtomDB, and it seems to work pretty well (on my computer at least). This should be equivalent to the implementation in xspec, I am starting the tests anytime soon