Created
June 5, 2013 20:26
-
-
Save baoilleach/5717024 to your computer and use it in GitHub Desktop.
Use GaussSum to automatically generate UV-Vis spectra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Script to plot UV-Vis spectrum using GaussSum | |
Before running, set the PYTHONPATH to the directory containing GaussSum.py. | |
This script runs the UV-Vis spectrum generator across every .out file | |
in the current folder. | |
""" | |
import os | |
import sys | |
import glob | |
import logging | |
from gausssum.electrontrans import ET | |
from gausssum.cclib.parser import ccopen | |
ver = "2.2" | |
def gaussdir(filename): | |
return os.path.join(os.path.dirname(filename), "gausssum%s" % ver) | |
if __name__ == "__main__": | |
start, end = 200, 500 | |
numpts, fwhm = 500, 3000 | |
filenames = glob.glob("*.out") | |
for filename in filenames: | |
log = ccopen(filename) | |
log.logger.setLevel(logging.ERROR) | |
data = log.parse(filename) | |
ET(None, sys.stdout, data, filename, start, end, numpts, fwhm, True, | |
None, False) | |
os.rename(gaussdir(filename), filename.split(".")[0] +"_gs") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying your script, and as I am not very used to python yet, so I am getting this error:
Could you help me, please?
Thank you in advance