diag=$1
ShotNo=$2
BP=/golem/database



cp /golem/Dirigent/$diag/* . 2>/dev/null
Vacuum_shot=$(</golem/database/operation/shots/$ShotNo/Production/Parameters/vacuum_shot)

echo Doing $ShotNo/$diag ...


cp Script.m Script.sf
sed "s/ShotNo = 0/ShotNo = $ShotNo/g;s/vacuum_shot = 0/vacuum_shot = $Vacuum_shot/g" Script.sf > Script.m 
# matlab -nosplash -nodesktop -r Script_publish

FIGS="offset.png MHD_activity.png Spectrogram.png 	q.png offset.png animation.gif[0] pictures.png"

colspan=9

echo "<tr>
<td colspan=$colspan><a href=/shots/$ShotNo>#$ShotNo</a>,
($(< /golem/database/operation/shots/$ShotNo/shot_date),
$(< /golem/database/operation/shots/$ShotNo/shot_time)),
<a href=/shots/$Vacuum_shot>Vacuum shot: $Vacuum_shot</a><br>
</td></tr>">RetroRow.html
echo "<tr><td colspan=$colspan>$(< /golem/shots/$ShotNo/Production/Parameters/CommandLine)</td></tr>" >>RetroRow.html
echo "<tr><td colspan=$colspan>t<sub>pl</sub>=$(< /golem/shots/$ShotNo/Diagnostics/BasicDiagnostics/Results/t_plasma_duration) ms</td></tr>" >>RetroRow.html
echo '<tr><td>' >>RetroRow.html
echo "
<img src=/shots/$ShotNo/Diagnostics/BasicDiagnostics/graph.png></td>
<!--<td><img src=/shots/$ShotNo/$diag/graph.png></td>-->" \
>>RetroRow.html
for fig in $FIGS; do
    #echo $fig
#    convert -resize 180 $fig ${fig%%.*}-icon.png
    echo '<td><img src='/shots/$ShotNo/$diag/${fig%%.*}-icon.png'></td>' >>RetroRow.html
done    

echo "</tr>" >>RetroRow.html
#cat RetroRow.html














