Integrating uncertainties
The main database doesn't (to my knowledge?) incorporate uncertainties in its atomic calculations or data, which is a problem that we often like to overlook. There have been a few papers and ISSI teams to address this to varying extents (e.g. Yu et al 2018; Del Zanna et al 2019; Yu et al 2024; ISSI team).
I would like to suggest that fiasco could incorporate uncertainties, assuming of course that the data source lists the uncertainties. There are packages like lmfit/uncertainties that can be used to propagate (linear) errors through any calculations done on that atomic data, which would be particularly helpful for a quantity like line intensity that depends on a number of atomic parameters.
Is there any interest in this?
Sorry for not responding to this at all. Yes, there's certainly interest.
Propagating uncertainties, especially through multiple calculations, is obviously quite complex and it's not completely clear to me how to go about this. In my mind, to start off, there are two fundamental questions to ask:
- How do we attach uncertainty to the atomic data in the database?
- How do we propagate those uncertainties through the calculations?
Re: question 1, to my knowledge, CHIANTI does not include any of the associated uncertainties on the different pieces of atomic data. Re: question 2, some framework like the one you list above or astropy.uncertainty or astropy.nddata would be needed. I would want to keep any error propagation completely separate from any of the atomic physics calculations (or as much as possible).
This could constitute a large number of code changes so I'd want to think carefully about how to implement this and how to attack it incrementally. That being said, I think this would be really great to have and would be a hug step to actually understanding how uncertainties on the atomic data impact conclusions from the derived quantities rather than just saying "20% uncertainty because atomic physics" all the time.
I think this would be great as well. I know the documentation is rough, and maybe it's not quite appropriate for your use case, but I've done a ton of work over at named-arrays to implement unit-aware uncertainty propagation for a large component of the numpy api. I understand leaning more towards an established tool, but I thought I would just draw your attention to my project just in case you find it has more of the features you need.
This is shockingly poorly studied in solar astronomy! There are more papers waiting to be written, and probably more than a handful that need to be revisited.
- Either we encourage the CHIANTI team to bundle those uncertainties with the data, or we have to go to the original data sources (assuming those have uncertainties!).
- I don't know what the best package is for this, so I'll defer to others here. The package I linked above essentially turns numbers into arrays, which seems like it could be straightforward but tedious to integrate.
Totally agreed that it should be done incrementally. Doing a bit of googling, it looks like ADAS has a similar problem as CHIANTI. AtomDB at least acknowledges uncertainty, and it looks like quite a few people are working on it. We might look to their efforts to see how they're treating the problem.
@byrdie Thanks! I'm certainly open to the idea of experimenting with named-arrays, even if the API is still in flux. In addition to the uncertainty propagation, it would also be great for (at least some) functions to return objects with named axes. I'm thinking especially in the case of contribution functions which may be a function of temperature, density, and many transitions. Returning something like a named array would make it way easier to pull out the desired transition without having to go back to the associated Ion object.
@jwreep Regarding adding these to CHIANTI, this could certainly be done (given adequate time and money), though it would probably constitute a significant change to the database. Additionally, looking at those slides you linked, it seems like the primary issue is that many of the theory calculations don't include uncertainties. Those slides are from 10 years ago so I wonder how much that has changed? I also wonder whether laboratory measurements are more likely to include uncertainties.
Sometimes! For example, NIST includes uncertainties on some quantities (e.g. ionization energy, rest wavelengths). Ionization energy might actually be an easy place to start . . .