-
Notifications
You must be signed in to change notification settings - Fork 0
/
basisCry2Mol
executable file
·63 lines (54 loc) · 2.45 KB
/
basisCry2Mol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python
# -*- coding: utf-8 -*-
############################################################################
# Copyright (C) 2010 by Nestor Aguirre #
# nfaguirre@imaff.cfmac.csic.es #
# #
# This program is free software; you can redistribute it and#or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
############################################################################
import sys
import os
PIAMOD_HOME = os.getenv("PIAMOD_HOME")
if( PIAMOD_HOME == None ):
print "### Error ###: Environment variable PIAMOD_HOME not found !!!"
quit()
sys.path.append(PIAMOD_HOME+"/src")
from ParserTextBlock import *
from GaussianBasisSet import *
class BasisCry2Mol:
@staticmethod
def usage():
print "Usage:"
print " $ basisCry2Mol FILE.d12"
print ""
print " This program extracts the basis set from CRYSTAL input and"
print " translates this to molpro format"
quit()
@staticmethod
def main():
# Verifica las opciones obligatorias
if( sys.argv[-1][-12:] == "basisCry2Mol" ):
BasisCry2Mol.usage()
return 0
parser = ParserTextBlock( sys.argv[-1] )
block = parser.extractBlock( "END", "[\s]*99[\s]+0*", ".*", 1 )
#print block.content
gbs = GaussianBasisSet()
gbs.loadFromTextBlock( block, format=GaussianBasisSet.CRYSTAL )
print gbs
print gbs.save( format=GaussianBasisSet.MOLPRO )
if __name__ == "__main__":
BasisCry2Mol.main()