source: BOL/Multi_atlas/html_lma.sh @ 5126

Last change on this file since 5126 was 4342, checked in by musat, 2 years ago

Inclut environnement spirit et dernieres corrections (3/3)
IonelaMusat?

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1#!/bin/bash
2
3source ~/env_Multi_atlas.sh
4
5#A REFAIRE
6
7local=`pwd -P`
8
9if [ 1 == 0 ]; then
10login=`whoami`
11hostname=`hostname`
12if [ ${hostname:0:5} = cicla ] ; then
13DODSDIR=/thredds/ipsl
14dthredds=thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds
15HTML00=https://${dthredds}/$login
16machine=ciclad
17fi
18if [ ${hostname:0:5} = spiri ] ; then
19DODSDIR=/thredds/ipsl
20dthredds=thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds
21HTML00=https://${dthredds}/$login
22machine=spirit
23fi
24if [ ${hostname:0:5} = camel ] ; then
25DODSDIR=/thredds/ipsl
26fi
27if [ ${hostname:0:5} = irene ] ; then
28DODSDIR=
29fi
30if [ ${hostname:0:5} = jean- ] ; then
31DODSDIR=
32fi
33fi
34
35runstxt=$local/runs.txt
36PREF_F=$DODSDIR
37dthredds=thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds
38#PREF_W=http\://vesg.ipsl.upmc.fr/thredds/fileServer/IPSLFS
39PREF_W=http\://${dthredds}
40
41MULTIDIR=$PREF_F/$login/lmdz/MultiSimu
42#BASE_D=/home/fabric/users/dcugnet
43BASE_D=$local/LMA
44OUT_D=/prodigfs/$login/LMDZ6/AXE2/LMA_LMDZ
45#TS_DA=$PREF_F/fabric/lmdz/TS_DA
46
47#=== CHECK WETHER REQUIRED ARGUMENT HAS IS PRESENT
48if [ $# -ne 1 ]; then
49  echo "This script needs a single argument: the comparison name"
50  echo "   (the name of the folder containing the def.txt file)"
51  exit
52fi
53comp=$1
54
55#=== CHECK WETHER GIVEN ARGUMENT IS VALID
56COMP_D=$MULTIDIR/$comp
57if [ ! -f $COMP_D/def.txt ]; then
58  echo "Nonexisting comparison file $COMP_D/def.txt"; exit
59fi
60
61#=== SOME MORE PATHS/FILES
62AXE_D=$COMP_D/AXE2; if [ ! -d $AXE_D/AXE2 ]; then mkdir -p $AXE_D/AXE2; fi
63FIG_D=$AXE_D/METRICS         #--- FIGURES STORAGE PATH
64headf=$COMP_D/entete.html    #--- HTML PAGES HEADER
65compf=$COMP_D/lma2.html       #--- GENERATED HTML PAGE
66if [ ! -d $FIG_D ]; then mkdir -p $FIG_D; fi
67AXE_W=$(echo $AXE_D | sed -e "s%$PREF_F%$PREF_W%")
68FIG_W=$(echo $FIG_D | sed -e "s%$PREF_F%$PREF_W%")
69webf=$AXE_W/lma.html
70PLOT_D=$BASE_D/LMA_LMDZ/$comp
71
72#=== GENERATE THE pdf FILES ; CONVERT THEM INTO png FILES
73cd $PLOT_D
74./plot_lma.bash
75for f in `ls *.pdf`; do convert -density 600 $f -resample 600 $FIG_D/${f%.*}.png; done
76cd - 1> /dev/null
77
78#=== BUILD THE HTML PAGE
79boxes=($(ls $FIG_D/boxes_*.png))
80modes=($(ls $FIG_D/modes_*.png))
81cat $headf                                                             > $compf
82echo "</style> </head> <body>"                                        >> $compf
83echo "<h2> Local Modes Analysis (LMA) </h2>"                          >> $compf
84echo "<hr/> <!--- this draws a line --->"                             >> $compf
85echo "<div width=100%>"                                               >> $compf
86echo "<table>"                                                        >> $compf
87for i in $(eval echo {1..${#boxes[@]}}); do
88  box=${boxes[$((i-1))]}; mod=${modes[$((i-1))]}
89  echo "<tr><td><img src="$FIG_W/${box##*/}" width="100%" border=0></td></tr>" >> $compf
90  echo "<tr><td><img src="$FIG_W/${mod##*/}" width="100%" border=0></td></tr>" >> $compf
91done
92echo "</table>"                                                       >> $compf
93
94echo $compf | sed -e "s%$PREF_F%$PREF_W%"
Note: See TracBrowser for help on using the repository browser.