source: BOL/Multi_atlas/html_lma.sh @ 4318

Last change on this file since 4318 was 4307, checked in by musat, 2 years ago

Fusion entre la version commune (compte fabric) et la version perso
du multi-atlas incluant

  • la fiabilisation de la realisation des cartes
  • la correction des coupes (latitude,altitude) pour les biais
  • l'ajout d'une option pour des multi-atlas par rapport a une simulation de reference
  • l'ajout d'options pour un multi-atlas regional
  • la mise a jour des thredds (repertoire & html) pour ciclad

IonelaMusat?

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