最大水位・最大流速のプロット メモ

最大水位

浸水深をプロットするにはもともとの地盤高と,(設定次第では)地震による変位を考慮する必要があるので注意.マニュアルに書いてあるのでそれを参照.

#!/bin/bash

## directory
figdir="_zmax"
if [ ! -e $figdir ]; then
    mkdir $figdir
fi

## makecpt
cpt="tmpzmax.cpt"
gmt makecpt -Cseis -I -T0/5 -D > $cpt

## plot for each
for f in SD*.zmax.grd
do

    ## filename
    outps=${f//\.grd/\.ps}

    ## plot
    proj="X"$(gmt grdinfo $f -Cn -o0,1,2,3  | awk '{print 10"/"10*($4-$3)/($2-$1)}')

    gmt grdimage $f -J$proj -Baf -BneSW -R$f -C$cpt -K > $outps
    gmt psscale -C$cpt -Bxa1f0.5 -By+lm -DJMR+w5.0/0.3+o1.0/0.0+ef0.2 -J -R -O >> $outps

    ## convert
    ps2pdf $outps ${outps//.ps/.pdf} && rm $outps # PDF
    pdfcrop --margins '5 5 5 5' ${outps//.ps/.pdf} | grep -iv pdf # PDF crop
    convert -density 300 ${outps//.ps/-crop.pdf} ${outps//.ps/.png} && rm ${outps//.ps/.pdf} # PDF to PNG

    ## move
    \mv ${outps//.ps/-crop.pdf} ${outps//.ps/.png} $figdir/

done

rm $cpt
nankai03_SD01.zmax.png
nankai03_SD05.zmax.png



最大流速

#!/bin/bash
## directory
figdir="_vmax"
if [ ! -e $figdir ]; then
    mkdir $figdir
fi

## makecpt
cpt="tmpvmax.cpt"
echo "0	gray80	0.0001	blue	L" > $cpt
gmt makecpt -Cjet -T0.0001/5 -D >> $cpt

## plot for each
for f in SD*.vmax.grd
do

    ## filename
    outps=${f//\.grd/\.ps}

    ## plot
    proj="X"$(gmt grdinfo $f -Cn -o0,1,2,3  | awk '{print 10"/"10*($4-$3)/($2-$1)}')

    gmt grdimage $f -J$proj -Baf -BneSW -R$f -C$cpt -K > $outps
    gmt psscale -C$cpt -Bxa1f0.5 -By+l"m/s" -DJMR+w5.0/0.3+o1.0/0.0+ef0.2 -J -R -O >> $outps

    ## convert
    ps2pdf $outps ${outps//.ps/.pdf} && rm $outps # PDF
    pdfcrop --margins '5 5 5 5' ${outps//.ps/.pdf} | grep -iv pdf # PDF crop
    convert -density 300 ${outps//.ps/-crop.pdf} ${outps//.ps/.png} && rm ${outps//.ps/.pdf} # PDF to PNG

    ## move
    \mv ${outps//.ps/-crop.pdf} ${outps//.ps/.png} $figdir/

done

rm $cpt

nankai03_SD03.vmax.png nankai03_SD04.vmax.png


Front page   Edit Diff Attach Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2021-05-12 (Wed) 17:48:42 (77d)