Re: Digest for chianti@googlegroups.com - 2 updates in 1 topic

6 views
Skip to first unread message

Jonathan Slavin

unread,
Apr 19, 2023, 9:48:00 AM4/19/23
to chi...@googlegroups.com
Hi Peter,

I'm using ChiantiPy, not IDL. In case someone else is interested, the way I ended up doing it was:

import ChiantiPy.tools.io as io

ioneqAll = io.ioneqRead('chianti')
ions = ioneqAll['ioneqAll']
Temperatures = ioneqAll['ioneqTemperature']
ions = ioneqAll['ioneqAll']
nnH = abunds.sum() # I defined the elemental abundances elsewhere
Zelem = np.array([1, 2, 6, 7, 8, 10, 12, 14, 16, 18, 20, 26, 28]) # using just the most abundant elements
nenH = np.zeros_like(Temperatures)
for i,T in enumerate(Temperatures):
    for ab,Zel in zip(abunds,Zelem):
        nenH[i] += ab*(ions[Zel-1,1:Zel+1,i]*np.arange(1,Zel+1)).sum()
nen = nenH/nnH

Best regards,
Jon

On Tue, Apr 18, 2023 at 11:28 AM <chi...@googlegroups.com> wrote:
Jonathan Slavin <jsla...@gmail.com>: Apr 17 09:19AM -0700

Hi all,
 
I'd like to calculate the electron density/total density vs. temperature.
So what I need is Sum(A_i*Sum(X_Z,i*Z)), where A_i is the abundance
(relative to H) of element i, and X_Z,i is the ion fraction of ion stage Z
(i.e. Z times ionized). It seems I could call ioneq for each element
individually to get X_Z,i. Is there a way to do it for all the elements at
once?
 
I think I see now a way to do this, basically just loading the ioneq file,
though maybe there's a more convenient method?
 
Jon
Peter Young <pry....@gmail.com>: Apr 17 01:05PM -0700

Hi Jon,
 
We don't have an IDL routine for doing this specifically, but you can get
the ratio fairly easily by making use of the routine proton_dens.
 
For example, for logT=6.0:
 
IDL> h_e_ratio=proton_dens(6.0,/hydrogen)
 
which gives the ratio of hydrogen (protons + neutral H) relative to
electrons. To get the ratio of all elements relative to electrons, you then
do:
 
IDL> read_abund,!abund_file,ab,ref
IDL> all_e_ratio=h_e_ratio * total(ab)
 
I get 0.923 when I do this.
 
Thanks, Peter
 
 
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to chianti+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages