tar xvfz winv_exercise.tar.gz |
#! /bin/bash -u # 横軸の設定 (Configuration of the lateral axis) Emin=137:10:00 Emax=137:15:00 Etics=5m mini_Etics=1m # 縦軸の設定 (Configuration of the vertical axis) Nmin=34:20:00 Nmax=34:25:00 Ntics=5m mini_Ntics=1m # 標高の設定 (Configuration of the elevation) zmin=1000.0 zmax=3100.0 zinc=1.0 ztics=1000.0 mini_ztics=500.0 # グラフのプロット位置とサイズの設定 (Configuration of the plotting location and size) x0=3.0 y0=3.0 width=8.0 # カラーバーの設定 (Configuration of the color bar) colorbar_x=`echo $x0 $width | awk '{ print $1+$2+0.5 }'` colorbar_y=`echo $y0 $width | awk '{ print $1+$2/2.0 }'` colorbar_length=`echo $width | awk '{ print 0.7*$1 }'` # 出力ファイル名 (The output file name) outputfile_noExt=map # プロットの開始 (Start plotting) gmt begin $outputfile_noExt ps # 座標軸の文字サイズを設定 (Set font size for coordinate axes) gmt set FONT_ANNOT_PRIMARY 10p # 地形データをgrdファイルに変換 (Convert the topography data to a grd format) awk '{ print $2,$1,$3 }' topography.dat | gmt surface -R${Emin}/${Emax}/${Nmin}/${Nmax} -Gtopography.grd -I2s/2s # カラーパレットの作成 (Create a color pallete) gmt makecpt -Cdem1 -T${zmin}/${zmax}/${zinc} -Z # 地形を色で表現 (Plot the topography by colors) gmt grdimage topography.grd -R${Emin}/${Emax}/${Nmin}/${Nmax} -JM${width} -Xa${x0} -Ya${y0} # カラーバーのプロット (Plot a colorbar) gmt colorbar -Dx${colorbar_x}/${colorbar_y}/${colorbar_length}/0.2 -Bxa${ztics}f${mini_ztics} # カラーバーのレジェンドのプロット (Plot a colorbar legend) echo ${colorbar_x} ${colorbar_y} | awk '{ print $1+1.4,$2,"Elevation (m)" }' | gmt text -R0/21/0/29.7 -JX21/29.7 -Xa0 -Ya0 -F+f10p+a270+jCB # 細い等高線(100 m間隔)をプロット (Plot thin topography contours at 100 m intervals) gmt grdcontour topography.grd -R${Emin}/${Emax}/${Nmin}/${Nmax} -JM${width} -Xa${x0} -Ya${y0} -C100 -W0.4,200/150/100 # 太い等高線(500 m間隔)をプロット (Plot thick topography contours at 500 m intervals) gmt grdcontour topography.grd -R${Emin}/${Emax}/${Nmin}/${Nmax} -JM${width} -Xa${x0} -Ya${y0} -C500 -W1.2,200/150/100 # 観測点位置を記号でプロット (Plot station locations by stations) awk '{ print $3,$2 }' stations_latlon.dat | gmt plot -R${Emin}/${Emax}/${Nmin}/${Nmax} -JM${width} -Xa${x0} -Ya${y0} -St0.3 -G0/0/0 # 観測点コードをプロット (Plot station codes) awk '{ print $3,$2-0.001,$1 }' stations_latlon.dat | gmt text -R${Emin}/${Emax}/${Nmin}/${Nmax} -JM${width} -Xa${x0} -Ya${y0} -F+f10p+jCT -Bxa${Etics}f${mini_Etics} -Bya${Ntics}f${mini_Ntics} -BWSen # プロットの終了 (Finish the plotting) gmt end # png形式に変換 (Convert to a png format) convert -trim -density 150 $outputfile_noExt.ps $outputfile_noExt.png |
![]() 図1-1. 使用する架空の地形と観測点。 Fig. 1-1. The virtual topography and stations used. |
cd waveforms for sacfile in *.sac do textfile=`basename $sacfile .sac` textfile=${textfile}.seq2 sac_timeseq2sequence $sacfile $textfile done cd .. |
#! /bin/bash -u # 横軸の設定 (Configuration of the lateral axis) tmin=0.0 tmax=300.0 ttics=60.0 # グラフのプロット位置とサイズの設定 (Configuration of the plotting location and size) total_x0=3.0 total_y0=3.0 width=4.0 height=2.0 interval_x=0.5 interval_y=0.2 # 線の色と太さ (Line color and width) GMT_W='-W0.8,0/127/255' # 出力ファイル名 (The output file name) outputfile_noExt=waveforms_raw # プロットの開始 (Start plotting) gmt begin $outputfile_noExt ps # 座標軸の文字サイズを設定 (Set font size for coordinate axes) gmt set FONT_ANNOT_PRIMARY 10p # 各観測点の波形をプロット (Plot the waveforms of each station) y0=$total_y0 for station in NU.NW1 NU.NE1 NU.E01 NU.SE2 NU.N01 NU.SE1 NU.S01 do # 縦軸のスケールの決定 (Determine the vertical axis scale) amp=`gmt info -C waveforms/${station}.?.seq2 -H4 | gmt info -C | awk '{ if(-$5>$8){ print -1.05*$5 }else{ print 1.05*$8 } }'` amp_tics=`echo $amp | awk '{ printf("%0.e",$1/2.0) }'` # 各成分の波形をプロット (Plot the waveform of each component) x0=$total_x0 for component in E N U do # -Bオプションを決定 (Determine -B option) if [ "$x0" == "$total_x0" -a "$y0" == "$total_y0" ] then GMT_B="-Bx${ttics} -By${amp_tics} -BWS" elif [ "$x0" == "$total_x0" ] then GMT_B="-By${amp_tics} -BW" elif [ "$y0" == "$total_y0" ] then GMT_B="-Bx${ttics} -BS" else GMT_B='' fi # 波形をプロット (Plot an waveform) gmt plot waveforms/${station}.${component}.seq2 -H4 -R${tmin}/${tmax}/-${amp}/${amp} -JX${width}/${height} -Xa${x0} -Ya${y0} $GMT_W $GMT_B # 観測点・成分コードをプロット (Plot station and component codes) gmt text -R0/1/0/1 -JX${width}/${height} -Xa${x0} -Ya${y0} -F+f10p+jRT <<EOF 0.99 0.99 ${station}.${component} EOF # プロット位置を更新 (Update the plot location) x0=`echo $x0 $width $interval_x | awk '{ print $1+$2+$3 }'` done # プロット位置を更新 (Update the plot location) y0=`echo $y0 $height $interval_y | awk '{ print $1+$2+$3 }'` done # 座標軸の説明のプロット (Plot coordinate axis legends) xlabel_x=`echo $total_x0 $width $interval_x | awk '{ print $1+$2+$3+$2/2.0 }'` xlabel_y=`echo $total_y0 | awk '{ print $1-0.6 }'` ylabel_x=`echo $total_x0 | awk '{ print $1-1.6 }'` ylabel_y=`echo $total_y0 $height $interval_y | awk '{ print $1+3.0*($2+$3)+$2/2.0 }'` gmt text -R0/21/0/29.7 -JX21/29.7 -Xa0 -Ya0 -F+f10p+a+j <<EOF $xlabel_x $xlabel_y 0 CT Time (s) from 2:30:00 on Jan. 1, 2099 $ylabel_x $ylabel_y 90 CB Velocity (m/s) EOF # プロットの終了 (Finish the plotting) gmt end # png形式に変換 (Convert to a png format) convert -trim -density 150 $outputfile_noExt.ps $outputfile_noExt.png |
![]() 図1-2. 生波形。 Fig. 1-2. Raw waveforms. |
cd waveforms for rawfile in NU.???.?.seq2 do lpfile=`basename $rawfile .seq2` lpfile=${lpfile}.lp1Hz.seq2 sequencefile_lowpass $rawfile $lpfile --cornerFreq=1.0 done cd .. |
![]() 図1-3. 1 Hzのローパスフィルターを掛けた波形。 Fig. 1-3. Waveforms low-pass-filtered at 1 Hz. |
![]() 図1-4. 0.1 Hzのローパスフィルターを掛けた波形。 Fig. 1-4. Waveforms low-pass-filtered at 0.1 Hz. |