Hi,
iam a student please help me
i want to run this cod. my data ( long lat E N σE σN P EN site)
#!/bin/csh -f
#
if ( $#argv == 0 ) then
echo " read velocity file and triangulate it "
echo " "
echo " USAGE: sh_triangle -f file "
echo " "
echo " OPTIONS: "
echo " -f velocity file file name [Required] "
echo " -ps create ps file "
echo " -decim minlon,minlat,maxlon,maxlat select range to use "
echo " for triangulation "
echo " -kill nam1 nam2 ... station to remove "
echo " -tri file specific triangle file "
echo " -gmt write GMT script "
echo " -rm keep all temporay files"
echo " "
echo " ex : sh_strain2 -f iran_eura040303.vel -ps -decim 40,20,65,45 "
echo " "
exit
endif
#-----------------------------------------------------------------
# default
set f = ""
set ps = no
set decim = no
set dec = no
set kill = ""
set kil = no
set tri = no
set gmt = no
set rm = yes
#-----------------------------------------------------------------
while ($#argv > 0 )
set input = ( $argv )
switch($input[1])
case -f
set file = $input[2]
breaksw
case -ps
set ps = yes
breaksw
case -decim
set decim = $input[2]
set dec = yes
breaksw
case -kill:
set kill = (`echo $argv | cut -d- -f2`); shift kill
set kil = yes
breaksw
case -tri:
set tri = $input[2]
set tria = yes
breaksw
case -gmt:
set gmt = yes
breaksw
case -rm:
set rm = no
breaksw
endsw
shift argv
end
#-----------------------------------------------------------------
# remove comment line
grep -v "#" $file > tmp.vel
# remove oultiers lon and lat
if ( $dec == "yes" ) then
echo $decim > tmp.dec
echo tmp.vel >> tmp.dec
set program = decimll.exe
$program < tmp.dec
\mv decim.out tmp.vel
else
echo 0,0,360,90 > tmp.dec
echo tmp.vel >> tmp.dec
set program = decimll.exe
$program < tmp.dec
\mv decim.out tmp.vel
endif
# remove stations
if ( $kil == yes ) then
echo "Soft kill :" $kill
foreach i ( $kill )
grep -v $i tmp.vel > tmp1.vel
\mv tmp1.vel tmp.vel
end
endif
\mv tmp.vel triangle.vel
grep -v "(" triangle.vel > tmp.vel
# triangulate
if ( $tri == no ) then
triangulate tmp.vel > tmp.tri
else
\cp $tri tmp.tri
endif
# execution du program triangle.exe
set program = triangle.exe
$program
#-----------------------------------------------------------------
# execution de v2strain
echo triangle.vel > v2strain_sphere_ini
echo name.tri >> v2strain_sphere_ini
echo groupes_rotation >> v2strain_sphere_ini
echo ">" > groupes_rotation
echo " " >> groupes_rotation
set program = v2strain_sphere.exe
$program > /dev/null
#
echo " "
echo " "
echo " To view strain : xadeli2d "
echo " load : pfile "
echo " "
echo " "
#-----------------------------------------------------------------
# execution de rd_pfile.exe
echo 3 > tmp
echo 0 >> tmp
set program = rd_pfile.exe
$program < tmp > /dev/null
#
# strain axes
awk '{print $2,"0",$3}' strain_axe1 > tmp1
awk '{print $2,"0",$3}' strain_axe2 > tmp2
awk '{print $1,$2}' tricentr.xyz > tmp3
paste tmp3 tmp1 tmp2 > tmp
awk '{print $1,$2,$3,$6,$5}' tmp > strain_axe.xyz
# rotation
awk '{print $2}' rota > tmp1
#awk '{print $1,$2}' tricentr.xyz > tmp3
paste tmp3 tmp1 > rotation.xyz
# GMT
if ( $ps == "yes" ) then
# set Range for graphic
set Rx = `awk '{print $1,$2}' tri.xyz | minmax -I1`
psbasemap $Rx -JM15 -B5/5WESN -P -K -X2 -Y2 > strain_axe.ps
pscoast -R -JM -P -S0/0/250 -N1/0/0/0 -Df -K -O -W >> strain_axe.ps
psxy tri.xyz $Rx -JM15 -M -L -W2/0/0/0 -K -O >> strain_axe.ps
psvelo -JM -R -O -K -Sx4.02649e+14 strain_axe.xyz >> strain_axe.ps
#awk '{print $1,$2,"12 0 4 6",$8}' tmp.vel | pstext -N -O -JM $Rx -W -C0/0 >> strain_axe.ps
pstext tri.txt -N -O -JM $Rx -W -C0/0 >> strain_axe.ps
#
psbasemap $Rx -JM15 -B5/5WESN -P -K -X2 -Y2 > rotation.ps
pscoast -R -JM -P -S0/0/250 -N1/0/0/0 -Df -K -O -W >> rotation.ps
psxy tri.xyz $Rx -JM15 -M -L -W2/0/0/0 -K -O >> rotation.ps
#psxy tricentr.xyz $Rx -JM15 -M -L -Sc0.2 -G0/0/0 -K -O >> triangle.ps
psvelo -JM -R -O -K -Sw0.5/1 rotation.xyz >> rotation.ps
pstext tri.txt -N -O -JM $Rx -W -C0/0 >> rotation.ps
#
echo " "
echo " "
echo " To view postript files : gs strain_axe.ps "
echo " : gs rotation.ps "
echo " "
echo " "
endif
if ( $rm == "yes" ) then
\rm tmp
\rm tmp1
\rm tmp2
\rm tmp3
\rm tmp.dec
\rm tmp.tri
\rm tmp.vel
\rm strain_axe1
\rm strain_axe2
\rm rota
\rm poles98_rigide
\rm groupes_rotation
\rm polemin
\rm triangle.vel
\rm tricentr.xyz
\rm vitesses98_rigide
\rm name.tri
\rm v2strain_sphere_ini
if ( $gmt == "no" ) then
\rm tri.txt
\rm tri.xyz
endif
endif
#-----------------------------------------------------------------
if ( $gmt == "yes" ) then
# set Range for graphic
set Rx = `awk '{print $1,$2}' tri.xyz | minmax -I1`
echo "# strain axes" > GMT_strain_rota.scr
echo " " >> GMT_strain_rota.scr
echo "psbasemap $Rx -JM15 -B5/5WESN -P -K -X2 -Y2 > strain_axe.ps " >> GMT_strain_rota.scr
echo "pscoast -R -JM -P -S0/0/250 -N1/0/0/0 -Df -K -O -W >> strain_axe.ps" >> GMT_strain_rota.scr
echo "psxy tri.xyz $Rx -JM15 -M -L -W2/0/0/0 -K -O >> strain_axe.ps" >> GMT_strain_rota.scr
echo "psvelo -JM -R -O -K -Sx4.02649e+14 strain_axe.xyz >> strain_axe.ps" >> GMT_strain_rota.scr
echo "pstext tri.txt -N -O -JM $Rx -W -C0/0 >> strain_axe.ps" >> GMT_strain_rota.scr
echo " " >> GMT_strain_rota.scr
echo "# rotation " >> GMT_strain_rota.scr
echo " " >> GMT_strain_rota.scr
echo "psbasemap $Rx -JM15 -B5/5WESN -P -K -X2 -Y2 > rotation.ps" >> GMT_strain_rota.scr
echo "pscoast -R -JM -P -S0/0/250 -N1/0/0/0 -Df -K -O -W >> rotation.ps" >> GMT_strain_rota.scr
echo "psxy tri.xyz $Rx -JM15 -M -L -W2/0/0/0 -K -O >> rotation.ps" >> GMT_strain_rota.scr
echo "psvelo -JM -R -O -K -Sw0.5/1 rotation.xyz >> rotation.ps " >> GMT_strain_rota.scr
echo "pstext tri.txt -N -O -JM $Rx -W -C0/0 >> rotation.ps" >> GMT_strain_rota.scr
echo " "
echo " "
echo " GMT script : GMT_strain_rota.scr "
echo " "
echo " "
\chmod u+x GMT_strain_rota.scr
endif
end