Created
August 23, 2011 22:53
-
-
Save kjordahl/1166837 to your computer and use it in GitHub Desktop.
Plot smoothed version of USGS Community Internet Intensity Map with GMT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
wget -O usgs.txt http://earthquake.usgs.gov/earthquakes/dyfi/events/se/082311a/us/cdi_zip.txt | |
gmtset COLOR_NAN white | |
gmtset FORMAT_GEO_MAP DF | |
gmtset FONT_LABEL '16p,Helvetica,black' | |
I=0.1 | |
R=`awk '{FS=","; print $6, $5, $2}' usgs.txt | minmax -I1` | |
echo $R | |
N=`awk 'BEGIN{FS=","}{SUM += $3} END {print SUM}' usgs.txt` | |
R=-R-85/-70/34/45 | |
awk '{FS=","; print $6, $5, $2, $3}' usgs.txt | blockmedian $R -I$I -Wi -V > filt.txt | |
nearneighbor filt.txt -Gshake.grd $R -I$I -S1 -N4 -V | |
makecpt -T0/6/1 -Z > shake.cpt | |
grdimage shake.grd -Cshake.cpt -JM6i -P -Y2.5i -B5f1 -V -K > shake.ps | |
pscoast -J -R -Dh -W1p -Swhite -N1 -N2 -A10000 -K -O >> shake.ps | |
psscale -Y-1.5i -D3i/1i/6i/0.25ih -Cshake.cpt -B1:Intensity: -Ur/1.5i/-0.25i/"Kelsey Jordahl <kjordahl@@alum.mit.edu>" -O >> shake.ps | |
gv shake.ps & | |
ps2raster shake.ps -A -P -Tg | |
echo $N reports |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is now an old poster but i guess things have changed..I cant locate the cdi_zip.txt file. I need to know exacly what those columns $6, $5 and $2 from the awk represents..that is if you can remember