10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-24 13:23:40 +01:00

Starting TBE adaptation

This commit is contained in:
Mickaël Véril 2019-11-20 20:15:53 +01:00
parent 16b07ae25c
commit 934e136e56
2 changed files with 32 additions and 12 deletions

View File

@ -20,23 +20,32 @@ class code {
} }
} }
class method { class method {
constructor(name, basis) { constructor(name, basis=null,TBEcorr=null) {
this.name = name; this.name = name;
this.basis = basis; this.basis = basis;
this.TBEcorr=TBEcorr
} }
static fromString(str) { static fromString(str) {
var vals = str.split(",") var vals = str.split(",")
if (vals.length == 2) { switch (vals.lenght) {
return new method(vals[0], vals[1]); case 3:
} return new method(vals[0], vals[1],vals[2]);
else { break;
return new method(vals[0], null) case 2:
return new method(vals[0], vals[1])
break;
case 1:
return new method(vals[0])
break;
} }
} }
toString() { toString() {
var str = this.name; var str = this.name;
if (this.basis) { if (this.basis) {
str = str + '/' + this.basis; str = str + '/' + this.basis;
if (this.TBEcorr) {
str+=" ("+this.TBEcorr +")"
}
} }
return str; return str;
} }
@ -82,6 +91,14 @@ class excitationValue extends excitationBase {
} }
} }
class excitationValueCorrected extends excitationBase {
constructor(initial, final, value) {
super(initial, final)
this.value = value
this.Correction=value
}
}
class excitation extends excitationBase { class excitation extends excitationBase {
constructor(initial, final, Eabs, Efluo, EZPE) { constructor(initial, final, Eabs, Efluo, EZPE) {
super(initial, final) super(initial, final)

View File

@ -145,28 +145,31 @@ class dataFileBase(object):
mystr=" {:8s}{:7s}{:10s}{:8s}{:6s}{:13s}{}\n".format(str(ex.initial.number),str(ex.initial.multiplicity),ex.initial.symetry,str(ex.final.number),str(ex.final.multiplicity),ex.final.symetry,str(ex.value)) mystr=" {:8s}{:7s}{:10s}{:8s}{:6s}{:13s}{}\n".format(str(ex.initial.number),str(ex.initial.multiplicity),ex.initial.symetry,str(ex.final.number),str(ex.final.multiplicity),ex.final.symetry,str(ex.value))
f.write(mystr) f.write(mystr)
class method: class method:
def __init__(self,name, basis): def __init__(self,name, *args):
self.name = name self.name = name
self.basis = basis self.basis=args[0] if len(args)>0 else None
self.TBECorr=args if len(args)>1 else None
@staticmethod @staticmethod
def fromString(string): def fromString(string):
vals = string.split(",") vals = string.split(",")
if (vals.length == 2): return method(*vals)
return method(vals[0], vals[1])
else:
return method(vals[0], None)
def __str__(self): def __str__(self):
string = self.name string = self.name
if (self.basis): if (self.basis):
string+= '/' + self.basis string+= '/' + self.basis
if (self.TBECorr)
string+=" ("+ self.TBECorr+")"
return string return string
def toDataString(self): def toDataString(self):
string=self.name string=self.name
if (self.basis): if (self.basis):
string+=","+self.basis string+=","+self.basis
if (self.TBECorr)
string+=","+self.TBECorr
return string return string
class code: class code: