seismogramme_rec_array.sh 3.73 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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
#!/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

	PROFILE="_gx_"   
	suwind <  ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su \
	key=gelev min=2800000 max=2800000 | \
	suwind key=gx min=6000000 max=6000000 | \
	supswigb key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Receiver position / m" title="Model: $MODEL, Profile in x direction, Component: $value, Clip: $clip" clip=$clip > $MODEL$PROFILE$value.eps

	read clip <&5
	
	PROFILE="_gz_"
	suwind <  ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su \
	key=gelev min=2800000 max=2800000 | \
	suwind key=gy min=4000000 max=4000000 | \
	supswigb key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Receiver position / m" title="Model: $MODEL, Profile in z direction, Component: $value, Clip: $clip" clip=$clip > $MODEL$PROFILE$value.eps

      ;;

      *)
        #auto clip (no input of constant clip required)
	
	#---- 2D receiver array, profile in horizontal x direction
	
	#testrun in order to determine the clip at perc=$PERCENTAGE
	#stderr will be redirected to file clip.txt
	PROFILE="_gx_"
	suwind <  ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su \
	key=gelev min=2800000 max=2800000 | \
	suwind key=gx min=6000000 max=6000000 | \
	supswigb key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Tracenumber" title="Model $MODEL, Profile in x direction, Component: $value" perc=$PERCENTAGE 1> $MODEL$PROFILE$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
	suwind <  ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su \
	key=gelev min=2800000 max=2800000 | \
	suwind key=gx min=6000000 max=6000000 | \
	supswigb key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Tracenumber" title="Model: $MODEL, Profile in x direction, $value component; clip=$CLIP" clip=$CLIP 1> $MODEL$PROFILE$value.eps
	
	#---- 2D receiver array, profile in horizontal z direction
	
	#testrun in order to determine the clip at perc=$PERCENTAGE
	#stderr will be redirected to file clip.txt
	PROFILE="_gz_"
	suwind <  ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su \
	key=gelev min=2800000 max=2800000 | \
	  suwind key=gy min=4000000 max=4000000 | \
	supswigb key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Tracenumber" title="Model: $MODEL, Profile in z direction, Component: $value" perc=$PERCENTAGE 1> $MODEL$PROFILE$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
	suwind <  ../../../overnightbuilt/reference_value/$MODEL/su/$MODEL"_ref_"$value.su \
	key=gelev min=2800000 max=2800000 | \
	  suwind key=gy min=4000000 max=4000000 | \
	supswigb key=tracl hbox=9 wbox=9 \
	label1="Time / s" label2="Tracenumber" title="Model $MODEL, Profile in z direction, $value component; clip=$CLIP" clip=$CLIP 1> $MODEL$PROFILE$value.eps
	
      ;;
  esac
done < components.txt