File: sample.sh

package info (click to toggle)
gmt 6.6.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 62,184 kB
  • sloc: ansic: 294,045; sh: 30,961; lisp: 86; fortran: 49; makefile: 43; perl: 32; csh: 9
file content (15 lines) | stat: -rwxr-xr-x 582 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
# Testing gmt grdsample

ps=sample.ps

Rg=-20/20/-20/20
# Create  grid by evaluating a Kelvin-Bessel * sqrt(r) function
gmt grdmath -R$Rg -I1 0 0 CDIST 0.1 MUL KEI 0 0 CDIST 0.1 MUL SQRT ADD DUP UPPER DIV 10 MUL = tmp.nc
gmt makecpt -Crainbow -T-6/10/1 > t.cpt
# Draw all nodes as open circles
gmt grdimage tmp.nc -JX4.5i -Ct.cpt -P -K -B10f5 -BWSne -Xc -Y0.75i > $ps
gmt psscale -Dx5i/4.75i+w6i/0.15i+jML+e+n -O -K -Ct.cpt >> $ps
# Resample to 0.2 spacing
gmt grdsample tmp.nc -I0.2 -Gout.nc
gmt grdimage out.nc -JX4.5i -Ct.cpt -O -B10f5 -BWSne -Xc -Y5i >> $ps