10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-10-02 22:40:59 +02:00

excitation type analysis

This commit is contained in:
Mickaël Véril 2019-11-26 14:36:23 +01:00
parent 4ec45cc1cd
commit e3fb90361f

View File

@ -46,15 +46,31 @@ class dataFileBase(object):
def convertState(StateTablelist,default=dataType.ABS,firstState=state(1,1,"A_1")): def convertState(StateTablelist,default=dataType.ABS,firstState=state(1,1,"A_1")):
tmplst=[] tmplst=[]
for TexState in StateTablelist: for TexState in StateTablelist:
trtype=default
lst=list(TexState.find("$").contents) lst=list(TexState.find("$").contents)
st=str(lst[0]) st=str(lst[0])
m=re.match(r"^\^(?P<multiplicity>\d)(?P<symm>[^\s\[(]*)\s*(?:\[(?:\\mathrm{)?(?P<special>\w)(?:})\])?\s*\((?P<type>[^\)]*)\)",st) m=re.match(r"^\^(?P<multiplicity>\d)(?P<symm>[^\s\[(]*)\s*(?:\[(?:\\mathrm{)?(?P<special>\w)(?:})\])?\s*\((?P<type>[^\)]*)\)",st)
seq=m.group("multiplicity","symm") seq=m.group("multiplicity","symm")
spgrp=m.group("special") spgrp=m.group("special")
if spgrp is not None and spgrp=="F": if spgrp is not None and spgrp=="F":
trtype=dataType.FLUO trsp=dataType.FLUO
tmplst.append((*seq,trtype)) else:
trsp=default
tygrp=m.group("type")
tys=tygrp.split(";")
for ty in tys:
if r"\rightarrow" in ty:
initial,final=ty.split(r"\rightarrow",2)
initials=initial.split(",")
finals=[item.strip() for item in final.split(",")]
if "n" in initials and r"\pis" in finals:
trty=trty|excitationType.nPis
elif r"\pi" in initials and r"\pis" in finals:
trty=trty|excitationType.PiPis
elif r"\Ryd" in ty:
trty=trty|excitationType.RYDBERG
elif r"\Val" in ty:
trty=trty|excitationType.VALENCE
tmplst.append((*seq,trsp,trty))
lst=[] lst=[]
for index,item in enumerate(tmplst): for index,item in enumerate(tmplst):
unformfirststate=(str(firstState.multiplicity),firstState.symetry) unformfirststate=(str(firstState.multiplicity),firstState.symetry)