seismogramme.sh 1.77 KB
Newer Older
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#!/bin/sh
# Seismogramme als eps erstellen

# input from command line
MODEL=$1
AUTOCLIP=$2
PERCENTAGE=99

#example command line call:
#./seismogramme.sh fullspace
#./seismogramme.sh fullspace clip

#if the command line argument AUTOCLIP='' then NO clip is specifically set
#instead the supswigb option perc=98 is used
#if the command line argument AUTOCLIP='clip' then a there will be a command line 
#prompt that asked for constant clip for each individual component



exec 5<&0

#loop over components
while read value
do
  case "$AUTOCLIP" in 
     clip)
  
        #manual clip ( input of constant clip required)
	echo "Clipwert: "
	read CLIP <&5

    
	supswigb < ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Tracenumber" title="Model $MODEL, $value component; clip=$CLIP" clip=$clip > $MODEL"_"$value.eps

      ;;

      *)
        #auto clip (no input of constant clip required)
	
	#testrun in order to determine the clip at perc=$PERCENTAGE
	#stderr will be redirected to file clip.txt
	supswigb < ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Tracenumber" title="Model $MODEL, $value component" perc=$PERCENTAGE 1>$MODEL"_"$value.eps 2>clip.txt
	
	#extract clip from file clip.txt
	while read line;
	do 
	    if [ "$line" != "" ]; then
		  CLIP=`echo $line | cut -c 32-45`

	    fi
	done < clip.txt
	
	
	#use CLIP to add this CLIP into the title of the eps figure
	supswigb < ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Tracenumber" title="Model $MODEL, $value component; clip=$CLIP" clip=$CLIP 1>$MODEL"_"$value.eps

      ;;
  esac
done < components.txt