#!/usr/bin/python import pylab as pl from barklem import retcross #Spec Wavel Elow Elimit Eupp Elimit L J N*low N*upp Sigma Alpha Log(Gamma/N) # # Multiplet 1 of Na #Na 1 5889.953 0.000 41449.650 16973.379 41449.650 0->1 0.5->1.5 1.627 2.117 406.87 0.273 -7.526 NSlow, NSupp = 1.627, 2.117 Llow, Lupp = 0, 1 # First test with neff CROSS, ALPHA, IFAIL = retcross(NSlow,NSupp,Llow,Lupp) print CROSS, ALPHA, IFAIL # Second test with energy levels Elow = 0.000 Eupp = 16973.379 Elimit = 41449.650 Zeff = 1 RYD = 109678.758 #RYD = 109737.32 NSlow = Zeff * pl.sqrt(RYD/(Elimit-Elow)) NSupp = Zeff * pl.sqrt(RYD/(Elimit-Eupp)) print NSlow, NSupp
nwarn = 0 nlwlhti = 0 # Number of lines with levels higher than ionization cross_list = [] alpha_list = [] if i == 1: # Neutral species print("\nInterpolate H collisions broadening parameter according to ABO theory...") for line in init_lines_list: if ION.e-line.lower.e >0. and ION.e-line.upper.e > 0.: nstar_l = line.lower.i * pl.sqrt(Cst.RYD/100./(ION.e-line.lower.e)) nstar_u = line.upper.i * pl.sqrt(Cst.RYD/100./(ION.e-line.upper.e)) l_l = line.lower.get_sqn() l_u = line.upper.get_sqn() try: cross, alpha, ifail = retcross(nstar_l, nstar_u, l_l, l_u) except TypeError: print("nstar_l, nstar_u, l_l, l_u:", nstar_l, nstar_u, l_l, l_u) else: cross = int(round(cross)) alpha = round(alpha, 3) if not ifail: line.gv = cross + alpha nabo += 1 cross_list.append(cross) alpha_list.append(alpha) else: nlwlhti += 1 elif i == 2: # First ionized species print("\nFind possible ABO broadening for excited species in", IFILE0,'...')