wtbarnes / fiasco

Python interface to the CHIANTI atomic database
http://fiasco.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
21 stars 17 forks source link

Fe XXIII level populations are noisy #238

Open wtbarnes opened 1 year ago

wtbarnes commented 1 year ago

The Fe XXIII level populations are all noisy and it is not clear why. This does not happen for Fe XXII or XXIV. It could be that there is an issue with one of the data files, but it is also possible the way I'm solving the level populations leads to noise amplification in the system of equations for particular ions.

This appears to be independent of whether the level resolved corrections are applied or not.

import fiasco
import astropy.units as u
import matplotlib.pyplot as plt

temperature = 10**np.arange(5,8,0.01) * u.K
fe23 = fiasco.Ion('Fe XXIII', temperature)
density = 1e15*u.cm**(-3)*u.K / fe23.temperature
level_pops = fe23.level_populations(density, couple_density_to_temperature=True, include_level_resolved_rate_correction=False)
plt.plot(fe23.temperature, level_pops[:,0,:])
plt.xscale('log')
plt.yscale('log')
plt.ylim(1e-40, 2)
plt.xlim(1e6, 1e8)

image

jwreep commented 9 months ago

You may have noticed already, but the noise is not present when couple_density_to_temperature = False: Figure_1

Is the difference here? https://github.com/wtbarnes/fiasco/blob/bb4670e2df538c674149285235d9555f736d0960/fiasco/ions.py#L487-L490

wtbarnes commented 9 months ago

Oh interesting. I actually had not noticed that. What density did you use for the level populations you're plotting there?

jwreep commented 9 months ago

I copied and pasted your code in the first comment and just changed that to false out of sheer curiosity.

wtbarnes commented 9 months ago

Ah ok so it's calculating them over the whole density/temperature grid so that's plotting the level populations at 1e10 cm-3. I wonder if it's the actual coupling that's the problem or if a particular density is leading to the oscillations.