Hi Grace,
The managing of the blends is a little tricky in PyNeb. You can define the lines as they are actually observed in the form of a blend, or assign the line intensity to one line of the blend and set the other members of the blend to 0. You can also have different combinations in the same file, as for example:
LINE OBJECT1
O2_7319A 6.54
O2_7320A 0.00
O2_7330A 5.17
O2_7331A 0.00
O2_7319A+ 6.54
O2_7330A+ 5.17
O2_7325A+ 11.71
O2_3726A 670.
O2_3729A 0.
O2_3727A+ 670.
S2_6716A 13.5
S2_6731A 10.0
In this case, you read the data using:
obs = pn.Observation()
obs.readData('obs.dat', fileFormat='lines_in_rows', err_default=0.05, corrected=True) # You may have uncorrected values, that you correct from extinction before following.
And you can obtain the temperature using different observations, but always using the correct string "to_eval":
intens = obs.getIntens()
T1 = O2.getTemDen(int_ratio=intens['O2_3727A+'] / intens['O2_7325A+'], den=1e2, to_eval='(I(3,1) + I(2,1)) / (I(4,3) + I(4,2) + I(5,3) + I(5,2))')
T2 = O2.getTemDen(int_ratio=intens['O2_3727A+'] / (intens['O2_7319A+'] + intens['O2_7330A+']), den=1e2, to_eval='(I(3,1) + I(2,1)) / (I(4,3) + I(4,2) + I(5,3) + I(5,2))')
print(T1, T2)
You can use the Diagnostic facility, but the point here is that it can not deal with the blends in the getCrossTemDen method. So you have to define the diagnostic using the 6 lines, even if only 2 blends are observed (one of 2 lines, the other of 4 lines for example). And the issue is here in the computation of the uncertainty associated to the diagnostics. If this is not an important issue, you can define a fake "error function" in the tuple that is used to setup the diagnostic and then use the getCrossTemDen, or define the exact 6 variables derivative function. In the following, only the '[OII] 3727+/7325+b' diagnostic will be usable in getCrossTemDen:
diags = pn.Diagnostics()
diags.addDiag('[OII] 3727+/7325+b', ('O2',
'(L(3726)+L(3729))/(I(4,2)+I(4,3)+I(5,2)+I(5,3))',
'RMS([E(3729), E(3726)])')) # this RMS is not correct, it is only here to fill the tuple
diags.addDiag('[OII] 3727+/7325+c', ('O2', 'B("3727A+")/(B("7319A+")+B("7330A+"))',
'RMS([BE("7319A+")*B("7319A+")/(B("7319A+")+B("7330A+")), BE("7330A+")*B("7330A+")/(B("7319A+")+B("7330A+")), BE("3727A+")])'))
diags.addDiagsFromObs(obs)
Now it works using the user defined '[OII] 3727+/7325+b' diagnostic:
tem, den = diags.getCrossTemDen('[OII] 3727+/7325+b', '[SII] 6731/6716', obs=obs)
print(tem, den)
9984.905674807018 101.12027610182929
That's not very confortable, but this a working solution.
Hope it helps, saludos and happy new year!
Christophe