1 | #!/bin/bash |
---|
2 | # |
---|
3 | # fplod 2006-06-02T10:00:41Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
4 | # http://forge.ipsl.jussieu.fr/saxo/download/ is the new directory reference |
---|
5 | # for tar file instead of ~/SAXO_RD/ ie home of Sebatien Masson on |
---|
6 | # arete.lodyc.jussieu.fr |
---|
7 | # !!! saxo@forge.ipsl.jussieu.fr password is needed |
---|
8 | # fplod 2006-05-31T10:34:18Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
9 | # . add creation of all_plots.html using firststeps.html |
---|
10 | # . remplace ~/SAXO_RD/SRC/Documentation/xmldoc/figpng by ./figpng/ |
---|
11 | # we suppose that this shell script is launched when we are in |
---|
12 | # <working space of saxo>/SRC/Documentation/xmldoc/ |
---|
13 | # |
---|
14 | set -u |
---|
15 | # |
---|
16 | case "${1}" in |
---|
17 | getsaxo) |
---|
18 | echo "iii : you will be asked saxo@forge.ipsl.jussieu.fr passwd two times" |
---|
19 | # find the most recent SAXO_RD_yyyymmdd.tar.gz in |
---|
20 | # /ipsl/forge/projets/saxo/download/ |
---|
21 | infosrc=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_RD_*.tar.gz ) |
---|
22 | filesrc=$(echo ${infosrc} | awk '{print $NF}') |
---|
23 | szsrc=$(echo ${infosrc} | awk '{print $5}') |
---|
24 | # ndate is the date in the file SAXO_RD_*.tar.gz |
---|
25 | ndate=${filesrc##*_} |
---|
26 | ndate=${ndate%.tar.gz} |
---|
27 | # find the most recent TestsData_yyyymmdd.tar.gz in |
---|
28 | # /ipsl/forge/projets/saxo/download/ |
---|
29 | infodata=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/TestsData_*.tar.gz ) |
---|
30 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
31 | szdata=$(echo ${infodata} | awk '{print $5}') |
---|
32 | # ndate2 is the date in the file TestsData_*.tar.gz |
---|
33 | ndate2=${filedata##*_} |
---|
34 | ndate2=${ndate2%.tar.gz} |
---|
35 | ;; |
---|
36 | *) |
---|
37 | echo "iii : no ndate determination needed" |
---|
38 | ;; |
---|
39 | esac |
---|
40 | |
---|
41 | # figures lists |
---|
42 | cd ./figpng |
---|
43 | |
---|
44 | # |
---|
45 | figsplt_lev="" |
---|
46 | for i in tst_plt_lev_[0-9][0-9].png |
---|
47 | do |
---|
48 | figsplt_lev="${figsplt_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
49 | done |
---|
50 | figspltz_lev="" |
---|
51 | for i in tst_pltz_lev_[0-9][0-9].png |
---|
52 | do |
---|
53 | figspltz_lev="${figspltz_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
54 | done |
---|
55 | figspltt_lev="" |
---|
56 | for i in tst_pltt_lev_[0-9][0-9].png |
---|
57 | do |
---|
58 | figspltt_lev="${figspltt_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
59 | done |
---|
60 | # |
---|
61 | figsplt_orca2="" |
---|
62 | for i in tst_plt_orca2_[0-9][0-9].png |
---|
63 | do |
---|
64 | figsplt_orca2="${figsplt_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
65 | done |
---|
66 | figspltz_orca2="" |
---|
67 | for i in tst_pltz_orca2_[0-9][0-9].png |
---|
68 | do |
---|
69 | figspltz_orca2="${figspltz_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
70 | done |
---|
71 | figspltt_orca2="" |
---|
72 | for i in tst_pltt_orca2_[0-9][0-9].png |
---|
73 | do |
---|
74 | figspltt_orca2="${figspltt_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
75 | done |
---|
76 | # |
---|
77 | figsplt_orca05="" |
---|
78 | for i in tst_plt_orca05_[0-9][0-9].png |
---|
79 | do |
---|
80 | figsplt_orca05="${figsplt_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
81 | done |
---|
82 | figspltz_orca05="" |
---|
83 | for i in tst_pltz_orca05_[0-9][0-9].png |
---|
84 | do |
---|
85 | figspltz_orca05="${figspltz_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
86 | done |
---|
87 | figspltt_orca05="" |
---|
88 | for i in tst_pltt_orca05_[0-9][0-9].png |
---|
89 | do |
---|
90 | figspltt_orca05="${figspltt_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
91 | done |
---|
92 | ## |
---|
93 | # |
---|
94 | figsplt_lev_stride="" |
---|
95 | for i in tst_plt_lev_stride_[0-9][0-9].png |
---|
96 | do |
---|
97 | figsplt_lev_stride="${figsplt_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
98 | done |
---|
99 | figspltz_lev_stride="" |
---|
100 | for i in tst_pltz_lev_stride_[0-9][0-9].png |
---|
101 | do |
---|
102 | figspltz_lev_stride="${figspltz_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
103 | done |
---|
104 | figspltt_lev_stride="" |
---|
105 | for i in tst_pltt_lev_stride_[0-9][0-9].png |
---|
106 | do |
---|
107 | figspltt_lev_stride="${figspltt_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
108 | done |
---|
109 | # |
---|
110 | figsplt_orca2_stride="" |
---|
111 | for i in tst_plt_orca2_stride_[0-9][0-9].png |
---|
112 | do |
---|
113 | figsplt_orca2_stride="${figsplt_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
114 | done |
---|
115 | figspltz_orca2_stride="" |
---|
116 | for i in tst_pltz_orca2_stride_[0-9][0-9].png |
---|
117 | do |
---|
118 | figspltz_orca2_stride="${figspltz_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
119 | done |
---|
120 | figspltt_orca2_stride="" |
---|
121 | for i in tst_pltt_orca2_stride_[0-9][0-9].png |
---|
122 | do |
---|
123 | figspltt_orca2_stride="${figspltt_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
124 | done |
---|
125 | # |
---|
126 | figsplt_orca05_stride="" |
---|
127 | for i in tst_plt_orca05_stride_[0-9][0-9].png |
---|
128 | do |
---|
129 | figsplt_orca05_stride="${figsplt_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
130 | done |
---|
131 | figspltz_orca05_stride="" |
---|
132 | for i in tst_pltz_orca05_stride_[0-9][0-9].png |
---|
133 | do |
---|
134 | figspltz_orca05_stride="${figspltz_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
135 | done |
---|
136 | figspltt_orca05_stride="" |
---|
137 | for i in tst_pltt_orca05_stride_[0-9][0-9].png |
---|
138 | do |
---|
139 | figspltt_orca05_stride="${figspltt_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
140 | done |
---|
141 | ## |
---|
142 | cd .. # ie <working space of saxo>/SRC/Documentation/xmldoc |
---|
143 | |
---|
144 | case "${1}" in |
---|
145 | getsaxo) |
---|
146 | sed -e s/"\&date\;"/${ndate}/g \ |
---|
147 | -e s/"\&date2\;"/${ndate2}/g \ |
---|
148 | -e s/"\&szsrc\;"/${szsrc}/g \ |
---|
149 | -e s/"\&szdata\;"/${szdata}/g \ |
---|
150 | ${1}.xml > ${1}_${$}.xml |
---|
151 | ;; |
---|
152 | firssteps) |
---|
153 | sed -e s/"\&figsplt_lev\;"/"${figsplt_lev}"/g \ |
---|
154 | -e s/"\&figsplt_orca2\;"/"${figsplt_orca2}"/g \ |
---|
155 | -e s/"\&figsplt_orca05\;"/"${figsplt_orca05}"/g \ |
---|
156 | -e s/"\&figspltz_lev\;"/"${figspltz_lev}"/g \ |
---|
157 | -e s/"\&figspltz_orca2\;"/"${figspltz_orca2}"/g \ |
---|
158 | -e s/"\&figspltz_orca05\;"/"${figspltz_orca05}"/g \ |
---|
159 | -e s/"\&figspltt_lev\;"/"${figspltt_lev}"/g \ |
---|
160 | -e s/"\&figspltt_orca2\;"/"${figspltt_orca2}"/g \ |
---|
161 | -e s/"\&figspltt_orca05\;"/"${figspltt_orca05}"/g \ |
---|
162 | -e s/"\&figsplt_lev_stride\;"/"${figsplt_lev_stride}"/g \ |
---|
163 | -e s/"\&figsplt_orca2_stride\;"/"${figsplt_orca2_stride}"/g \ |
---|
164 | -e s/"\&figsplt_orca05_stride\;"/"${figsplt_orca05_stride}"/g \ |
---|
165 | -e s/"\&figspltz_lev_stride\;"/"${figspltz_lev_stride}"/g \ |
---|
166 | -e s/"\&figspltz_orca2_stride\;"/"${figspltz_orca2_stride}"/g \ |
---|
167 | -e s/"\&figspltz_orca05_stride\;"/"${figspltz_orca05_stride}"/g \ |
---|
168 | -e s/"\&figspltt_lev_stride\;"/"${figspltt_lev_stride}"/g \ |
---|
169 | -e s/"\&figspltt_orca2_stride\;"/"${figspltt_orca2_stride}"/g \ |
---|
170 | -e s/"\&figspltt_orca05_stride\;"/"${figspltt_orca05_stride}"/g \ |
---|
171 | ${1}.xml > ${1}_${$}.xml |
---|
172 | ;; |
---|
173 | *) |
---|
174 | cp ${1}.xml ${1}_${$}.xml |
---|
175 | echo "iii : no xml transformation needed" |
---|
176 | ;; |
---|
177 | esac |
---|
178 | # |
---|
179 | CLASSPATH="$CLASSPATH:\ |
---|
180 | /sw/share/java/saxon/saxon.jar:\ |
---|
181 | /sw/share/xml/xsl/docbook-xsl/extensions/saxon653.jar" |
---|
182 | export CLASSPATH |
---|
183 | #java com.icl.saxon.StyleSheet \ |
---|
184 | # -o ${1}.html ${1}.xml \ |
---|
185 | # /sw/share/xml/xsl/docbook-xsl/html/docbook.xsl \ |
---|
186 | # use.extensions=1 section.autolabel=1 html.stylesheet="saxo.css" css.decoration=1 |
---|
187 | # |
---|
188 | # callout.graphics.path="/sw/share/xml/xsl/docbook-xsl/images/callouts/" |
---|
189 | |
---|
190 | java com.icl.saxon.StyleSheet -o ${1}.html ${1}_${$}.xml \ |
---|
191 | /sw/share/xml/xsl/docbook-xsl/html/docbook.xsl \ |
---|
192 | section.autolabel=1 html.stylesheet="saxo.css" css.decoration=1 |
---|
193 | |
---|
194 | case "${1}" in |
---|
195 | firststeps) |
---|
196 | java com.icl.saxon.StyleSheet -o all_plots_${$}.xml ${1}_${$}.xml \ |
---|
197 | all_plots_docbook.xsl |
---|
198 | java com.icl.saxon.StyleSheet -o all_plots.html all_plots_${$}.xml \ |
---|
199 | /sw/share/xml/xsl/docbook-xsl/html/docbook.xsl \ |
---|
200 | section.autolabel=1 html.stylesheet="saxo.css" css.decoration=1 |
---|
201 | rm -f all_plots_${$}.xml |
---|
202 | ;; |
---|
203 | esac |
---|
204 | rm -f ${1}_${$}.xml |
---|