-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeslice_gen_dag.py
42 lines (33 loc) · 1.27 KB
/
timeslice_gen_dag.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
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import random, os
import numpy as np
slices = np.arange(5, 12, 0.5)
#EPHs = ['DE421', 'DE436']
EPHs = ['DE436']
subdir = 'condor_sub/'
#subfile = 'bwm_slice.sub'
subfile = 'bwm_sliceBE.sub'
dag_dir = '/home/pbaker/nanograv/bwm/slices/'
if not os.path.exists(dag_dir):
os.makedirs(dag_dir)
os.system('cp {0:s} {1:s}'.format(subdir+subfile, dag_dir))
#dag_name = 'slices.dag'
dag_name = 'slicesBE.dag'
dag = dag_dir + dag_name
config = dag_dir + dag_name + '.config'
with open(config, 'w') as f:
f.write('DAGMAN_DEFAULT_NODE_LOG = '+ dag +'.nodes.log')
with open(dag_dir + dag_name, 'w') as f:
f.write('CONFIG {:s}\n\n'.format(config))
for sl in slices:
for ephem in EPHs:
#outdir = dag_dir + "{0:.1f}/{1:s}/".format(sl, ephem)
outdir = dag_dir + "{0:.1f}/bayesephem/".format(sl)
if not os.path.exists(outdir):
os.makedirs(outdir)
job_ID = random.getrandbits(128)
f.write('JOB {0:d} {1:s}\n'.format(job_ID, subfile))
f.write('VARS {0:d} slice="{1:.1f}"\n'.format(job_ID, sl))
f.write('VARS {0:d} ephem="{1:s}"\n'.format(job_ID, ephem))
f.write('\n')