10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-08-26 06:01:49 +02: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 {
constructor(name, basis) {
constructor(name, basis=null,TBEcorr=null) {
this.name = name;
this.basis = basis;
this.TBEcorr=TBEcorr
}
static fromString(str) {
var vals = str.split(",")
if (vals.length == 2) {
return new method(vals[0], vals[1]);
}
else {
return new method(vals[0], null)
switch (vals.lenght) {
case 3:
return new method(vals[0], vals[1],vals[2]);
break;
case 2:
return new method(vals[0], vals[1])
break;
case 1:
return new method(vals[0])
break;
}
}
toString() {
var str = this.name;
if (this.basis) {
str = str + '/' + this.basis;
if (this.TBEcorr) {
str+=" ("+this.TBEcorr +")"
}
}
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 {
constructor(initial, final, Eabs, Efluo, EZPE) {
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))
f.write(mystr)
class method:
def __init__(self,name, basis):
def __init__(self,name, *args):
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
def fromString(string):
vals = string.split(",")
if (vals.length == 2):
return method(vals[0], vals[1])
else:
return method(vals[0], None)
return method(*vals)
def __str__(self):
string = self.name
if (self.basis):
string+= '/' + self.basis
if (self.TBECorr)
string+=" ("+ self.TBECorr+")"
return string
def toDataString(self):
string=self.name
if (self.basis):
string+=","+self.basis
if (self.TBECorr)
string+=","+self.TBECorr
return string
class code: