예제 #1
0
import numpy as np
import sys
import subprocess as sp
import os
import errno
import shutil
import re
import argparse
import lxml.etree as lxml
from __tools__ import MyParser
from __tools__ import cd
from __tools__ import query_yes_no
from __xtpAtom__ import atom
from __xtpMolecule__ import molecule

parser = MyParser(
    description="Environment to do run multiple votca calculations")
parser.add_argument("--suffix",
                    type=str,
                    default="",
                    help="Suffix to append to foldernames")
parser.add_argument("--jobfile",
                    type=str,
                    required=True,
                    help="File with paths to grofiles")
parser.add_argument("--template",
                    type=str,
                    required=True,
                    help="Folder, from which to take optionfiles from")
parser.add_argument("--mapfile",
                    type=str,
                    default="system.xml",
예제 #2
0
from __tools__ import XmlWriter
from __tools__ import make_sure_path_exists
from __tools__ import addsuffixtofile
from __cluster__ import write_cluster_batch
from __xtpJobfile__ import splittjobfile
from __xtpJobfile__ import mergejobfiles
from __xtpJobfile__ import infojobfile
from __xtpJobfile__ import resetjobfile
import lxml.etree as lxml
import subprocess as sp
import os
import sys
from __tools__ import cd

parser = MyParser(
    description="Environment to split a jobfile into many and submit to cluster"
)
parser.add_argument("--options",
                    "-o",
                    type=str,
                    required=True,
                    help="optionfile")
parser.add_argument("--submit",
                    action='store_const',
                    const=1,
                    default=0,
                    help="Submit to cluster")
parser.add_argument("--setup",
                    action='store_const',
                    const=1,
                    default=0,
예제 #3
0
#!/usr/bin/env python
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d import proj3d
import numpy as np
import matplotlib.pyplot as plt
import csv
import re
import sys


from __tools__ import MyParser

parser=MyParser(description="Tool to visualize kmc trajectory .csv files" )
parser.add_argument("-t","--trajectory",type=str,nargs="+",required=True,help="Files to visualize .csv format")
parser.add_argument("--steps",type=int,default=-1,help="Maximum number of steps to read in. default:-1")
args=parser.parse_args()
#parser.add_argument('-p',"--plot", action='store_const', const=1, default=0,help="Calculate exciton coupling in classical limit")

if type(args.trajectory)==str:
	args.trajectory=[args.trajectory]



class carrierstorage(object):
		numberofobjects= 0
		def __init__(self):
				carrierstorage.numberofobjects+=1
				self.id=carrierstorage.numberofobjects
				self.traj=[]
예제 #4
0
import os
import errno
import shutil
import re

import numpy.linalg as lg
from __tools__ import MyParser
from __tools__ import make_sure_path_exists
from __tools__ import XmlParser
from __tools__ import cd
from __tools__ import XmlWriter
from __tools__ import RepresentsInt
from __exciton__ import readexcitonlogfile

parser = MyParser(
    description=
    "Enviroment to do numerical polarisation calculations with gwbse and gaussian"
)
parser.add_argument("--template",
                    "-t",
                    type=str,
                    required=True,
                    help="Folder, from which to take votca-optionfiles from")
parser.add_argument("--options",
                    "-o",
                    type=str,
                    required=True,
                    help="optionfile")
parser.add_argument("--setup",
                    action='store_const',
                    const=1,
                    default=0,
예제 #5
0
import subprocess as sp
import os
import errno
import shutil
import re
import argparse
import lxml.etree as lxml
import numpy.linalg as lg
import time
from __tools__ import MyParser
from __tools__ import cd
from __tools__ import XmlParser
from __xtpAtom__ import atom
from __xtpMolecule__ import molecule

parser = MyParser(description="Environment to check coupling constants")

parser.add_argument(
    "--template",
    "-t",
    type=str,
    required=True,
    help=
    "Folder, from which to take optionfiles from and where the exciton tool had been executed for one molecule"
)
parser.add_argument("--xyz",
                    type=str,
                    help="Name of the xyz file for the molecule")
parser.add_argument("--mps",
                    type=str,
                    default="",
예제 #6
0
#!/usr/bin/env python
from __tools__ import MyParser
from __tools__ import XmlParser
from __tools__ import XmlWriter
import lxml.etree as lxml

parser = MyParser(description="Delete Entries from Jobfile")
parser.add_argument("--jobfile", "-j", type=str, required=True, help="jobfile")
parser.add_argument("--output",
                    "-o",
                    type=str,
                    default="joboutput.xml",
                    help="jobfile")
parser.add_argument("--exclude",
                    type=str,
                    nargs="+",
                    help="Tags to exclude from jobfile e,h,n,s,t")
args = parser.parse_args()

print "Removing states with tags including: {} ".format(" ".join(args.exclude))

root = XmlParser(args.jobfile)

for entry in root.iter('job'):
    status = entry.find("tag").text
    for eex in args.exclude:
        if eex in status:
            root.remove(entry)
            break
print "Writing to {}".format(args.output)
XmlWriter(root, args.output)
from __tools__ import XmlParser
from __tools__ import XmlWriter
from __tools__ import make_sure_path_exists
from __tools__ import addsuffixtofile
from __cluster__ import write_cluster_batch
from __xtpJobfile__ import splittjobfile
from __xtpJobfile__ import mergejobfiles
from __xtpJobfile__ import infojobfile
from __xtpJobfile__ import resetjobfile
import lxml.etree as lxml
import subprocess as sp
import os
import sys
from __tools__ import cd

parser=MyParser(description="Environment to split a jobfile into many and submit to cluster")
parser.add_argument("--options","-o",type=str,required=True,help="optionfile")
parser.add_argument("--submit",action='store_const', const=1, default=0,help="Submit to cluster")
parser.add_argument("--setup",action='store_const', const=1, default=0,help="Setup")
parser.add_argument("--merge",action='store_const', const=1, default=0,help="Merge jobfiles")
parser.add_argument("--info",action='store_const', const=1, default=0,help="Display info about each jobfile")
parser.add_argument("--reset",type=str, nargs="+",default=False,help="Reset FAILED and or ASSIGNED to AVAILABLE")
parser.add_argument("--exclude",type=int, nargs="+", default=False,help="Exclude certain jobs from action,give the numbers of the jobs")
parser.add_argument("--include",type=int, nargs="+", default=False,help="Limit action to only the jobs, give the  numbers of the jobs")
args=parser.parse_args()

if args.exclude!=False and args.include!=False:
    print "ERROR: Excluding and Including at the same time does not work. Choose different options!"
    sys.exit()

root=XmlParser(args.options)
예제 #8
0
#!/usr/bin/env python

from __tools__ import MyParser
from __tools__ import XmlParser
#import matplotlib.pyplot as plt
import lxml.etree as lxml
import subprocess as sp
import numpy as np

parser = MyParser(
    description="Tool to create histogramm for iexcitoncl from jobfile")
parser.add_argument("--format",
                    type=str,
                    default="Hist_{}",
                    help="Title of histogramm and filename")
parser.add_argument("--printing",
                    action='store_const',
                    const=1,
                    default=0,
                    help="Print histogramms to txt file")
parser.add_argument("--bins", type=int, default=50, help="Number of bins")
parser.add_argument("--jobfiles",
                    type=str,
                    nargs="+",
                    required=True,
                    help="Name of jobfile")
parser.add_argument("--min",
                    type=int,
                    default=-14,
                    help="Minimum log10(J2) to still count")
args = parser.parse_args()
예제 #9
0
import errno
import shutil
import re
import argparse 
import lxml.etree as lxml
from __tools__ import MyParser
from __tools__ import cd
from __tools__ import query_yes_no
from __xtpAtom__ import atom
from __xtpMolecule__ import molecule





parser=MyParser(description="Environment to do run multiple votca calculations")
parser.add_argument("--suffix",type=str,default="",help="Suffix to append to foldernames")
parser.add_argument("--jobfile",type=str,required=True,help="File with paths to grofiles")
parser.add_argument("--template",type=str,required=True,help="Folder, from which to take optionfiles from")
parser.add_argument("--mapfile",type=str,default="system.xml",help="Name of mapfile. Default:system.xml")
parser.add_argument("--sqlfile",type=str,default="system.sql",help="Name of mapfile. Default:system.sql")
parser.add_argument("--neighbourlist", action='store_const', const=1, default=0,help="Make neighbourlist")
parser.add_argument("--createdirs", action='store_const', const=1, default=0,help="Create directories")
parser.add_argument('-p',"--map", action='store_const', const=1, default=0,help="Map system")
parser.add_argument("--iexcitoncl", action='store_const', const=1, default=0,help="Calculate exciton coupling in classical limit")
parser.add_argument("--ianalyze", action='store_const', const=1, default=0,help="Run ianalyze")
parser.add_argument("--izindo", action='store_const', const=1, default=0,help="Run izindo")
parser.add_argument('--einternal', action='store_const', const=1, default=0,help="Run einternal")
parser.add_argument('--eanalyze', action='store_const', const=1, default=0,help="Run eanalyze")
parser.add_argument("--ewald", action='store_const', const=1, default=0,help="Use ewald only write,read and local work")
parser.add_argument("--zmultipole",action='store_const', const=1, default=0,help="Run zmultipole")
예제 #10
0
#!/usr/bin/python

import lxml.etree as lxml
from __tools__ import MyParser
from __tools__ import XmlParser
import os

parser = MyParser(
    description=
    "Assign mpsfile to molecules for iexcitoncl jobs, mps.tab files and ewald jobs"
)
parser.add_argument("--path",
                    type=str,
                    required=True,
                    help="Path to mps file folder")
parser.add_argument("--jobfile",
                    type=str,
                    required=True,
                    help="file to rewrite")
parser.add_argument("--state",
                    type=str,
                    help="State to give tag to, only required for ewald")
parser.add_argument(
    "--format",
    type=str,
    required=True,
    help="Format string into which the id is placed e.g. Molecule_{}_n2s1.mps")
parser.add_argument(
    "--id",
    nargs="+",
    type=int,
예제 #11
0
#!/usr/bin/python

import lxml.etree as lxml
from __tools__ import MyParser
from __tools__ import XmlParser
import os

parser=MyParser(description="Assign mpsfile to molecules for iexcitoncl jobs, mps.tab files and ewald jobs")
parser.add_argument("--path",type=str,required=True,help="Path to mps file folder")
parser.add_argument("--jobfile",type=str,required=True,help="file to rewrite")
parser.add_argument("--state",type=str,help="State to give tag to, only required for ewald")
parser.add_argument("--format",type=str,required=True,help="Format string into which the id is placed e.g. Molecule_{}_n2s1.mps")
parser.add_argument("--id",nargs="+",type=int,default=[1, 2],help="only rewrite first or second segment of pair,iexcitoncl")
parser.add_argument("--compare", action='store_const', const=1, default=0,help="Only replace mps files where segtype can be found in formatstring")

args=parser.parse_args()







filetype= os.path.splitext(args.jobfile)[1][1:]
if filetype=="jobs":
    root=XmlParser(args.jobfile)
    print "read in "
    for inputs in root.iterfind('.//input'): 
        for i,segment in enumerate(inputs):
            if i+1 not in args.id:
                continue
예제 #12
0
import os
import errno
import shutil
import re

import numpy.linalg as lg
from __tools__ import MyParser
from __tools__ import make_sure_path_exists
from __tools__ import XmlParser
from __tools__ import cd
from __tools__ import XmlWriter
from __tools__ import RepresentsInt
from __exciton__ import readexcitonlogfile


parser=MyParser(description="Enviroment to do numerical polarisation calculations with gwbse and gaussian")
parser.add_argument("--template","-t",type=str,required=True,help="Folder, from which to take votca-optionfiles from")
parser.add_argument("--options","-o",type=str,required=True,help="optionfile")
parser.add_argument("--setup", action='store_const', const=1, default=0,help="Setup folders")
parser.add_argument("--run", action='store_const', const=1, default=0,help="Run jobs")
parser.add_argument("--read", action='store_const', const=1, default=0,help="Readout outputfiles")
args=parser.parse_args()

BohrtoAngstroem=0.5291772109
b2a3=BohrtoAngstroem**3

root=XmlParser(args.options)

h=float(root.find("fieldstrength").text)
tags=(root.find("tags").text).split()
예제 #13
0
import errno
import shutil
import re
import argparse 
import lxml.etree as lxml
import numpy.linalg as lg
import time
from __tools__ import MyParser
from __tools__ import cd
from __tools__ import XmlParser
from __xtpAtom__ import atom
from __xtpMolecule__ import molecule



parser=MyParser(description="Environment to check coupling constants")

parser.add_argument("--template","-t",type=str,required=True,help="Folder, from which to take optionfiles from and where the exciton tool had been executed for one molecule")
parser.add_argument("--xyz",type=str,help="Name of the xyz file for the molecule")
parser.add_argument("--mps",type=str,default="",help="Name of the mps file for the molecule")
parser.add_argument("--option","-o",type=str,required=True,help="Optionfile")
parser.add_argument("--setup", action='store_const', const=1, default=0,help="Setup folders")
parser.add_argument("--exciton", action='store_const', const=1, default=0,help="Run exciton calc")
parser.add_argument("--excpl", action='store_const', const=1, default=0,help="Run exciton coupling")
parser.add_argument("--qmcpl", action='store_const', const=1, default=0,help="Run e/h coupling")
parser.add_argument("--clcpl", action='store_const', const=1, default=0,help="Run classical coupling")
parser.add_argument("--verbose","-v", action='store_const', const=1, default=0,help="Run votca with verbose on")
parser.add_argument("--skipmonomer", action='store_const', const=1, default=0,help="Run exciton without monomer calculations")
args=parser.parse_args()
if args.mps=="":
    args.mps=None