-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_sim.py
More file actions
53 lines (47 loc) · 1.74 KB
/
run_sim.py
File metadata and controls
53 lines (47 loc) · 1.74 KB
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
import models as m
import pickle
import subprocess as sp
import time
import os
#m.YSOModel(name='WL16-ResslerModel',folder='WL16/',env_mass=0.08)
#m.YSOModel(name='WL16-ResslerModel_no_envelope',folder='WL16/',env_mass=0.08,env=False,cav=False)
### Enoch values (bolometric luminosity with envelope)
#m.YSOModel(name='WL16-EnochModel',folder='WL16/',env_mass=0.08,L_sun=5.6)
#m.plotYSOModel(name='WL16-ResslerModel',folder='WL16/',extinction=31,show=False)
#m.plotYSOModel(name='WL16-ResslerModel_no_envelope',folder='WL16/',extinction=31,show=False)
#m.plotYSOModel(name='WL16-EnochModel',folder='WL16/',extinction=9.76,show=False)
###
'''
name = 'WL16-Test_Donut'
folder = 'WL16/'
WL16 = m.YSOModelSim(name=name,folder=folder,env_mass=0.08,env_type='ulrich',rc=400)
#WL16.runModel()
#WL16 = m.modelLoad(folder,name)
WL16.plotModel(extinction=9.5,show=True)
#WL16.modelDump()
print "Dumping file..."
try:
os.system('rm %s' % (folder+name+'.mod'))
pickle.dump(WL16,open(folder+name+'.mod','wb'))
except:
print "Pickling failed :-("
WL16 = m.modelLoad(folder,name)
WL16.plotModel(extinction=9.5,show=True)
#name = 'WL16-Ulrich-Env_Mass=1-Rc=800-Lsun=5.6'
#folder = 'WL16/'
#WL16 = m.YSOModelSim(name=name,folder=folder,L_sun=5.6,env_mass=1,env_type='ulrich',rc=800)
#WL16.runModel()
#WL16.plotModel(extinction=9.5,show=True)
#WL16.modelDump()
#print "test3"
'''
while True:
p=sp.Popen("/cardini3/mrizzo/anaconda/bin/python sim_list_WL6.py",stdout=sp.PIPE,shell=True)
with p.stdout:
for line in iter(p.stdout.readline,b''):
print line,
while p.poll() is None:
time.sleep(1)
print 'Process is not done (Ctrl-C to interrupt)'
print 'Process is done - restarting the script (Ctrl-C to interrupt)'
#os.system('/cardini3/mrizzo/anaconda/bin/python sim_list.py')