Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apec model status #111

Open
nicolas-cerardi opened this issue Jan 30, 2024 · 3 comments
Open

Apec model status #111

nicolas-cerardi opened this issue Jan 30, 2024 · 3 comments
Labels
model Issues related to the spectral models

Comments

@nicolas-cerardi
Copy link

Hi, what is the current status of the apec model ?
I saw it in the source code, but not in the docs, is it work in progress ?
Related, the source redshift looks to be missing in the apec implementation.

...overall, congrats for this very nice package !

@renecotyfanboy
Copy link
Owner

Hi Nicolas,

First, thank you for your feedback! As you may have seen, this package is very much WIP at this point, and we plan to release it to the community in ~2 months. You are welcome to use it though, just be aware that there will be many API changes and that the doc is a bit outdated already!

Then, the APEC model is planned to be released at the same time. The implementation you can see is WIP, and I am not even sure it is working properly. At this time, we plan to use the compressed continuum, pseudo continuum and lines provided by AtomDB and that are used in XSPEC as a base for interpolating the flux of various elements and lines etc… This is very challenging to obtain a differentiable implementation of APEC with this approach, since the provided tables are given with various shapes, sparsely sampled in energies and different from an element to another. This is very JAX-unfriendly. @MolinAlexei succeeded in implementing a version that interpolate every continuum/pseudo continuum on the energy grid related to the instrument/observation, which I have to thoroughly test against XSPEC's. I am also closely following JAX future releases which might implement some ragged array stuff which would be perfect for this problem (see #16324, #16072).

You are very welcome to share your idea about this topic, and also very welcome to contribute! Meanwhile, I will share updates on this issue. You can expect a functional APEC in ~2 months (at least I hope so!)

@renecotyfanboy renecotyfanboy added the model Issues related to the spectral models label Jan 30, 2024
@nicolas-cerardi
Copy link
Author

Thanks for the detailed answer ! great, well I'd be glad to help on this if you need, I have experience with Xspec, pyatomdb and Jax ;)

@renecotyfanboy
Copy link
Owner

@nicolas-cerardi we are starting to work on the APEC model in a dedicated branch. I think we will use this issue to summarize the ongoing work. Since you're experienced with pyatomdb, could you help me with some questions ?

  • Do PyAtomDB compute the APEC model from the ground (no interpolation or tabulated data, except for the emission lines)
  • How much time does it take to evaluate the model for a single energy bin ?
  • How hard would it be to implement it in JAX ?

I am really struggling with the interpolated approach right now, and start thinking it might just be better to rewrite it from ground in pure JAX instead of dealing with the compressed interpolated tables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model Issues related to the spectral models
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants