[cig-commits] r13665 - in seismo/3D/GRD_CMT3D: cmt3d scripts
liuqy at geodynamics.org
liuqy at geodynamics.org
Fri Dec 12 12:14:50 PST 2008
Author: liuqy
Date: 2008-12-12 12:14:50 -0800 (Fri, 12 Dec 2008)
New Revision: 13665
Modified:
seismo/3D/GRD_CMT3D/cmt3d/cmt3d_sub2.f90
seismo/3D/GRD_CMT3D/scripts/cp_data.bash
seismo/3D/GRD_CMT3D/scripts/cp_syn.bash
seismo/3D/GRD_CMT3D/scripts/mech_table2.pl
seismo/3D/GRD_CMT3D/scripts/plot_grid.pl
seismo/3D/GRD_CMT3D/scripts/plot_socal_events.pl
Log:
Update scripts for plotting
Modified: seismo/3D/GRD_CMT3D/cmt3d/cmt3d_sub2.f90
===================================================================
--- seismo/3D/GRD_CMT3D/cmt3d/cmt3d_sub2.f90 2008-12-12 20:10:47 UTC (rev 13664)
+++ seismo/3D/GRD_CMT3D/cmt3d/cmt3d_sub2.f90 2008-12-12 20:14:50 UTC (rev 13665)
@@ -168,7 +168,10 @@
! array indices of the start and end of the selected window
istart = max(floor((tstart-t0)/dt),1)
iend = min(ceiling((tend-t0)/dt) + 1,npts)
- if (istart >= iend) stop 'Check tstart and tend'
+ if (istart >= iend) then
+ print *, trim(data_file), trim(syn_file), tstart, tend
+ stop 'Check tstart and tend'
+ endif
if (station_correction) then
! matching syn(is:ie) with data(is+it:ie+it)
Modified: seismo/3D/GRD_CMT3D/scripts/cp_data.bash
===================================================================
--- seismo/3D/GRD_CMT3D/scripts/cp_data.bash 2008-12-12 20:10:47 UTC (rev 13664)
+++ seismo/3D/GRD_CMT3D/scripts/cp_data.bash 2008-12-12 20:14:50 UTC (rev 13665)
@@ -1,6 +1,5 @@
#!/bin/bash
-# this program tars the data that has already been collected by Carl
if [ $# != 1 ]; then
echo "Usage: cp_data.bash evid-file"; exit
fi
@@ -8,11 +7,11 @@
dir=/net/sierra/raid1/carltape/socal/socal_3D/DATA/FINAL
for evid in `cat $1`; do
- mkdir -p $evid/data; cd $evid/data
+ mkdir -p $evid/data $evid/backup; cd $evid/data
echo " == $evid ==="
ssh wagholi.gps.caltech.edu "cd $dir/$evid; tar cjvf ~/data_${evid}.tar.bz *.sac >/dev/null "
scp lqy at wagholi.gps.caltech.edu:data_${evid}.tar.bz .
ssh wagholi.gps.caltech.edu "rm -f data_${evid}.tar.bz"
- tar xjvf data_${evid}.tar.bz; mv data_${evid}.tar.gz ../backup
+ tar xjvf data_${evid}.tar.bz; mv data_${evid}.tar.bz ../backup
cd ../..
done
Modified: seismo/3D/GRD_CMT3D/scripts/cp_syn.bash
===================================================================
--- seismo/3D/GRD_CMT3D/scripts/cp_syn.bash 2008-12-12 20:10:47 UTC (rev 13664)
+++ seismo/3D/GRD_CMT3D/scripts/cp_syn.bash 2008-12-12 20:14:50 UTC (rev 13665)
@@ -61,12 +61,12 @@
cp ../../grd_cmt3d/cmt3d/INVERSION.PAR .
cp ../../grd_cmt3d/grid3d/GRID3D.PAR .
perl -pi -e "s/flexwin\.out/$mafile/g" INVERSION.PAR
- cp INVERSION.PAR INVERSION.PAR.SAVE
+ mv INVERSION.PAR INVERSION.PAR.SAVE
perl -pi -e "s/flexwin\.out/$mafile/g" GRID3D.PAR
## make sure you have the right dmoment, ddepth, and dlocation
dlat=`diff -b syn/CMTSOLUTION syn/CMTSOLUTION_lat | grep lat | awk '{print $3}' | perl -pi -e 's/\n/ /g' | awk '{print $2-$1}'`
ddep=`diff -b syn/CMTSOLUTION syn/CMTSOLUTION_dep | grep dep | awk '{print $3}' | perl -pi -e 's/\n/ /g' | awk '{print $2-$1}'`
- perl -pi -e "s/^.*1.0e22*/$dlat $ddep 1.0e22/" INVERSION.PAR
+ perl -pi -e "s/^.*1.0e22*/$dlat $ddep 1.0e22/" INVERSION.PAR.SAVE
####
cd ..;
done
Modified: seismo/3D/GRD_CMT3D/scripts/mech_table2.pl
===================================================================
--- seismo/3D/GRD_CMT3D/scripts/mech_table2.pl 2008-12-12 20:10:47 UTC (rev 13664)
+++ seismo/3D/GRD_CMT3D/scripts/mech_table2.pl 2008-12-12 20:14:50 UTC (rev 13665)
@@ -35,7 +35,7 @@
$ncols = 3;
$nrows = 3;
# plot size jx/jy, plot origin in xy
-($jx,$jy) = shift_xy("1 1","$ncols $nrows","7 8", \@xy,"0.8 0.8");
+($jx,$jy) = shift_xy("1 1","$ncols $nrows","7 7", \@xy,"0.8 0.8");
$JX = "-JX$jx/$jy"; $R="-R0/3/0/3";
$GMT_PLOT::paper_orient="-P";
@@ -95,7 +95,7 @@
$xy=$xy[$i][$j];($x,$y) = split(/\//,$xy);
plot_psxy(\*BASH,$psfile,"$JX -X$x -Y$y $R","");
if (-f "$outdir/$cmt[$k]") {
- plot_psmeca_raw(\*BASH,$psfile,"-JX -R -Sm1.0 -B3/3wesn","1.5 2","$outdir/$cmt[$k]");
+ plot_psmeca_raw(\*BASH,$psfile,"-JX -R -Sm1.0 ","1.5 2","$outdir/$cmt[$k]");
@output = `cmtsol2faultpar.pl $outdir/$cmt[$k]`;
(undef,$tmp1) = split(" ", $output[4]);
(undef,$tmp2) = split(" ", $output[6]);
@@ -103,7 +103,7 @@
$tex="1 1 9 0 4 CM $names[$k]\n";
$tex.="0.2 0.8 9 0 4 LM Mw/dep/eps/= $tmp1\n0.2 0.6 9 0 4 LM S/D/R= $s/$d/$r";
if ($k>=2) {$tex.=sprintf("\n0.2 0.4 9 0 4 LM Var=%6.2f%",$var[$k]);}
- plot_pstext(\*BASH,$psfile,"-JX -R -B -G0/0/255","$tex");
+ plot_pstext(\*BASH,$psfile,"-JX -R -G0/0/255","$tex");
}
if ($k==1) {
($nt) = split(" ",`grep 'T.sac.d' $meas[2] | wc | awk '{print \$1}'`);
@@ -113,7 +113,7 @@
($n3) = split(" ",`grep 'T003.*.sac.d' $meas[2] | wc | awk '{print \$1}'`);
($n6) = split(" ",`grep 'T006.*.sac.d' $meas[2] | wc | awk '{print \$1}'`);
- plot_pstext(\*BASH,$psfile,"-JX -R -B -N","1.5 4 12 0 4 CM $ename ($nz/$nr/$nt; $n2/$n3/$n6)");}
+ plot_pstext(\*BASH,$psfile,"-JX -R -N","1.5 4 12 0 4 CM $ename ($nz/$nr/$nt; $n2/$n3/$n6)");}
plot_psxy(\*BASH,$psfile,"-JX -X-$x -Y-$y","");
$k++;
}
Modified: seismo/3D/GRD_CMT3D/scripts/plot_grid.pl
===================================================================
--- seismo/3D/GRD_CMT3D/scripts/plot_grid.pl 2008-12-12 20:10:47 UTC (rev 13664)
+++ seismo/3D/GRD_CMT3D/scripts/plot_grid.pl 2008-12-12 20:14:50 UTC (rev 13665)
@@ -22,9 +22,9 @@
$ncols= 3;
@name=("S","D","R");
for ($i=1;$i<=$nrows-1;$i++) {
- $Bs[$i]="Wesn"; $Bd[$i]="Wesn"; $Br[$i]="Wesn";}
-$Bs[0]="WesN"; $Bd[0]="WesN"; $Br[0]="WesN";
-$Bs[-1]="WeSn"; $Bd[-1]="WeSn"; $Br[-1]="WeSn";
+ $Bs[$i]="Wesn"; $Bd[$i]="wesn"; $Br[$i]="wEsn";}
+$Bs[0]="WesN"; $Bd[0]="wesN"; $Br[0]="wEsN";
+$Bs[-1]="WeSn"; $Bd[-1]="weSn"; $Br[-1]="wESn";
# plot size jx/jy, plot origin in xy
($jx,$jy) = shift_xy("1 1.5","$ncols $nrows","7 8", \@xy,"0.84 0.84");
@@ -94,14 +94,17 @@
plot_psxy(\*CSH,$psfile,"$JX -X$x -Y$y","");
if ($i==0) {
$value=$ps[$j]; $B="-B$ddd/${ddr}$Bs[$j]";
+ if ($j==$nrows-1) {$B="-B$ddd:\"Dip\":/${ddr}:\"Rake\":$Bs[$j]";}
print CSH "awk '\$1==$ps[$j] {print \$2,\$3,\$4}' $result > tmp1\n";
print CSH "xyz2grd tmp1 -Gout.grd -I$td/$tr -R$sd/$ed/$sr/$er \n";
} elsif ($i==1) {
$value=$pd[$j]; $B="-B$dds/${ddr}$Bd[$j]";
+ if ($j==$nrows-1) {$B="-B$dds:\"Strike\":/${ddr}$Bd[$j]";}
print CSH "awk '\$2==$pd[$j] {print \$1,\$3,\$4}' $result > tmp1\n";
print CSH "xyz2grd tmp1 -Gout.grd -I$ts/$tr -R$ss/$es/$sr/$er \n";
} else {
$value=$pr[$j];$B="-B$dds/${ddd}$Br[$j]";
+ if ($j==$nrows-1) {$B="-B$dds:\"Strike\":/${ddd}:\"Dip\":$Br[$j]";}
print CSH "awk '\$3==$pr[$j] {print \$1,\$2,\$4}' $result > tmp1\n";
print CSH "xyz2grd tmp1 -Gout.grd -I$ts/$td -R$ss/$es/$sd/$ed \n";
}
@@ -113,7 +116,7 @@
print CSH "\n";
}
}
-print CSH "psscale -Ctemp.cpt -D4i/1.0i/2.5i/0.17h $db -K -O -V -P >> $psfile\n";
+print CSH "psscale -Ctemp.cpt -D4i/0.6i/2.5i/0.17h $db -K -O -V -P >> $psfile\n";
plot_psxy(\*CSH,$psfile,"$JX -O","");
close(CSH);
Modified: seismo/3D/GRD_CMT3D/scripts/plot_socal_events.pl
===================================================================
--- seismo/3D/GRD_CMT3D/scripts/plot_socal_events.pl 2008-12-12 20:10:47 UTC (rev 13664)
+++ seismo/3D/GRD_CMT3D/scripts/plot_socal_events.pl 2008-12-12 20:14:50 UTC (rev 13665)
@@ -31,7 +31,7 @@
print BASH "gmtset PAPER_MEDIA letter BASEMAP_TYPE plain PLOT_DEGREE_FORMAT D TICK_LENGTH 0.3c LABEL_FONT_SIZE 12 ANOT_FONT_SIZE 10 HEADER_FONT 1 ANOT_FONT 1 LABEL_FONT 1 HEADER_FONT_SIZE 18 FRAME_PEN 2p TICK_PEN 2p \n";
-plot_sc_all(\*BASH,$psfile,"$JM -R$R -W1.5 -w0.5 -B2/2WesN -W1p,0 -Na/1.0p,255/255/255 -I$file.int -C$file.cpt $file.grd -K","");
+plot_sc_all(\*BASH,$psfile,"$JM -R$R -W1.5 -w0.5 -B2/2WesN -Na/1.0p,255/255/255 -I$file.int -C$file.cpt $file.grd -K","");
plot_psxy(\*BASH,$psfile,"-JM -R -St0.07 -W0.3 -G255/0/0","$station");
More information about the CIG-COMMITS
mailing list