From e3fb90361f49583df51180433724ccc4d5d4a53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Tue, 26 Nov 2019 14:36:23 +0100 Subject: [PATCH] excitation type analysis --- tools/lib/data.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/lib/data.py b/tools/lib/data.py index e1520ab2..43ae1462 100644 --- a/tools/lib/data.py +++ b/tools/lib/data.py @@ -46,15 +46,31 @@ class dataFileBase(object): def convertState(StateTablelist,default=dataType.ABS,firstState=state(1,1,"A_1")): tmplst=[] for TexState in StateTablelist: - trtype=default lst=list(TexState.find("$").contents) st=str(lst[0]) m=re.match(r"^\^(?P\d)(?P[^\s\[(]*)\s*(?:\[(?:\\mathrm{)?(?P\w)(?:})\])?\s*\((?P[^\)]*)\)",st) seq=m.group("multiplicity","symm") spgrp=m.group("special") if spgrp is not None and spgrp=="F": - trtype=dataType.FLUO - tmplst.append((*seq,trtype)) + trsp=dataType.FLUO + 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=[] for index,item in enumerate(tmplst): unformfirststate=(str(firstState.multiplicity),firstState.symetry)