forked from martinsaip/SC-EMA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotYoungsMod.py
51 lines (43 loc) · 1.35 KB
/
plotYoungsMod.py
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
from tools.gibbs_plot import plotYoungsModulus
from polycrystal import cubic
from polycrystal import hexagonal
from polycrystal import tetragonal
from polycrystal import trigonal
from polycrystal import orthorombic
#from time import time
import time
import sys
import os
import getpass
mydate = (time.strftime("%d/%m/%Y"))
mytime = (time.strftime("%H:%M:%S"))
logged_user = getpass.getuser()
ourString = sys.argv[1]
myarray = ourString.split()
high = int(myarray.pop())
low = int(myarray.pop())
tmpFolder = str(myarray.pop())
pnts = int(myarray.pop())
strStruc = ''.join(myarray)
myIP = tmpFolder.split(".")[0]
#print myIP
myid = tmpFolder.split(".")[-1]
f = open("../public/logfile", "a")
if (high == 0) and (low == 0):
plt = None
elif (low >= high):
print("warning", "please check your plot range!")
exit()
else:
plt = [low, high]
if pnts > 200:
print("warning", " too many data points! Please use a value below 200 points.")
exit()
myStruc = eval(strStruc)
myDict = myStruc.getElasticDict()
time1 = time.time()
plotYoungsModulus(myStruc.crystalname, myDict, saveFig = "True", plotRange = plt, tmpFolder = tmpFolder, plotPoints = pnts)
print(strStruc, "Created!")
time2 = time.time()
f.write("plotYoungsModulus:: runtime: " + str(time2-time1)+".. Date: " + str(mydate)+ "..Time: " +str(mytime)+ " from: "+str(myIP)+ "_" + str(myid) + "\n")
f.close()