到達時間 プロット メモ

#!/bin/bash

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

## makecpt
cpt="tmparrival.cpt"
gmt makecpt -Chaxby -I -T0/180/10 -D > $cpt

## plot for each
for f in SD*.arrival_time.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)}')

    fmin=${f//\.grd/\-min.grd}
    gmt grdmath $f 60 DIV = $fmin=cf

    gmt grdimage $fmin -J$proj -Baf -BneSW -R$f -C$cpt -K > $outps
    gmt grdcontour $fmin -J$proj -R$f -C30 -Wthinnest -K -O >> $outps && rm -f $fmin
    gmt psscale -C$cpt -Np -Bxa60f15g30 -By+lmin -DJMR+w5.0/0.3+o1.0/0.0+ef0.2 -J -R -O >> $outps

    ## convert
    gmt psconvert -A -Tf $outps # PS -> PDF
    gmt psconvert -A -TG $outps # PS -> PNG

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

done

rm $cpt

nankai03_SD02.arrival_time.png nankai03_SD03.arrival_time.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:38:07 (1247d)