make_pics.sh 1.26 KB
Newer Older
Sergey Kireev's avatar
Sergey Kireev committed
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
#!/bin/bash

initial_step=0

if [ $# -gt 0 ]; then
  initial_step=$1
fi

echo "Initial step: ${initial_step}"

source ./parameters.sh

# Check if directory with the same name exist
if [ ! -d $name ]; then
  echo "Directory '$name' does not exist!"
  exit
fi

# Set cell geometry
if [ "$cell" != "hex" ]; then
  script_png="$scripts_dir/make_png_sqr.plt"
  script_gif="$scripts_dir/make_gif_sqr.plt"
else
  script_png="$scripts_dir/make_png_hex.plt"
  script_gif="$scripts_dir/make_gif_hex.plt"
fi

cd ${name}/dat

echo "Making gif..."
gnuplot -e "nx=${nx}; ny=${ny}; nt=${initial_step}+${nt}; nts=${nts}; nt0=${initial_step};
            prefix=\"${prefix}\"; suffix=\"${suffix}\"; 
            title=\"${pic_title}\"; sx=${pic_size_x}; sy=${pic_size_y};
            colorn=\"${colorN}\"; colorl=\"${colorL}\"; colore=\"${colorE}\"" ../../${script_gif}
mv -f ${prefix}.gif ../${name}.gif

echo "Making png..."
gnuplot -e "nx=${nx}; ny=${ny}; nt=${initial_step}+${nt}; nts=${nts}; nt0=${initial_step};
            prefix=\"${prefix}\"; suffix=\"${suffix}\";
            title=\"${pic_title}\"; sx=${pic_size_x}; sy=${pic_size_y};
            colorn=\"${colorN}\"; colorl=\"${colorL}\"; colore=\"${colorE}\"" ../../${script_png}
[ ! -d ../png ] && mkdir ../png
mv -f *.png ../png

cd ../..