Remove silly tex/ directory.
[thesis.git] / src / figures / cantilever-sim / SConscript
1 import os.path
2
3 from site_cons.site_init import link_wtk_graph, link_pyfit
4
5
6 FIGURES = ['v-dep', 'loading-rate', 'i-dep']
7
8 # Get the passed in environment.
9 Import('env')
10
11 v_dep_data_dir = env.Dir('v-dep.d')
12 v_dep_data_files = [
13     f for f in env.Glob(os.path.join(str(v_dep_data_dir), '*'))
14     if 'fit' not in str(f)]
15
16 pyfit = link_pyfit(env)
17
18 v_dep_fit_files = []
19 for f in v_dep_data_files:
20     fit = env.Command(
21         str(f)+'.fit',
22         [f, pyfit],
23         "python %s -m math:log -f 'A*log(x,10)+B' -v $SOURCE > $TARGET"
24         % pyfit[0].get_abspath())
25     fit_dat = env.Command(
26         str(fit[0])+'.dat',
27         fit,
28         "sed -n 's/^[A-Z]: //p' $SOURCE > $TARGET")
29     v_dep_fit_files.append(fit_dat)
30
31 v_dep_data = v_dep_data_files + v_dep_fit_files
32
33 wtk_graph = link_wtk_graph(env)
34
35 for fig in FIGURES:
36     asyfile = '%s.asy' % fig  # static .asy file
37     pyfig = fig.replace('-', '_')
38     data = '%s_data' % (pyfig)
39     asydata = []
40     if data in globals():     # generated data dependencies
41         asydata = globals()[data]
42     env.Asymptote([asyfile, wtk_graph] + asydata)
43
44 # Pass back the modified environment.
45 Return('env')