Skip to content

Commit

Permalink
Merge pull request #455 from kdere/master
Browse files Browse the repository at this point in the history
 level information is now contained in the
  • Loading branch information
kdere authored Jan 12, 2024
2 parents 6ab0e85 + 56441c8 commit 70d77c5
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions ChiantiPy/core/Ion.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,26 +964,32 @@ def upsilonDescale(self, prot=0):
exRate = np.zeros((nscups,ntemp),np.float64)
dexRate = np.zeros((nscups,ntemp),np.float64)
deAll = []
lvl1 = []
lvl2 = []
for iscups in range(nscups):
if prot:
# for proton rates
l1 = self.Psplups["lvl1"][iscups]-1
lvl1.append(self.Psplups["lvl1"][iscups])
l1 = self.Psplups["lvl1"][iscups] - 1
l1idx = self.Elvlc['lvl'].index(self.Psplups['lvl1'][iscups])
l2 = self.Psplups["lvl2"][iscups]-1
lvl2.append(self.Psplups["lvl2"][iscups])
l2 = self.Psplups["lvl2"][iscups] - 1
l2idx = self.Elvlc['lvl'].index(self.Psplups['lvl2'][iscups])
ttype = self.Psplups["ttype"][iscups]
cups = self.Psplups["cups"][iscups]
nspl = self.Psplups["nspl"][iscups]
dx = 1./(float(nspl)-1.)
dx = 1./(float(nspl) - 1.)
xs = dx*np.arange(nspl)
scups = self.Psplups["splups"][iscups]
de = elvlc[l2idx]-elvlc[l1idx]
kte = const.boltzmann*temp/(de*const.ryd2erg)
else:
# electron collisional excitation or dielectronic excitation
l1 = self.Scups["lvl1"][iscups]-1
lvl1.append(self.Scups["lvl1"][iscups])
l1 = self.Scups["lvl1"][iscups] - 1
l1idx = self.Elvlc['lvl'].index(self.Scups['lvl1'][iscups])
l2 = self.Scups["lvl2"][iscups]-1
lvl2.append(self.Scups["lvl2"][iscups])
l2 = self.Scups["lvl2"][iscups] - 1
l2idx = self.Elvlc['lvl'].index(self.Scups['lvl2'][iscups])
ttype = self.Scups["ttype"][iscups]
cups = self.Scups["cups"][iscups]
Expand Down Expand Up @@ -1049,10 +1055,10 @@ def upsilonDescale(self, prot=0):

ups=np.where(ups > 0.,ups,0.)
if prot == 1:
self.PUpsilon = {'upsilon':ups, 'temperature':temperature,
self.PUpsilon = {'lvl1':lvl1, 'lvl2':lvl2, 'upsilon':ups, 'temperature':temperature,
'exRate':exRate, 'dexRate':dexRate}
else:
self.Upsilon = {'upsilon':ups, 'temperature':temperature,
self.Upsilon = {'lvl1':lvl1, 'lvl2':lvl2,'upsilon':ups, 'temperature':temperature,
'exRate':exRate, 'dexRate':dexRate, 'de':deAll}

def spectrum(self, wavelength, filter=(chfilters.gaussianR,1000.), label=0, allLines=1):
Expand Down

0 comments on commit 70d77c5

Please sign in to comment.