"Everything is related to everything else, but near things are more related than distant things"
Iran Major Faults
Rem Ehsan Momeni
rem **************************************************************
rem ********* Setting the parameters
set filename=Ehsan_Momeni_Final_Report.ps
set range=43/64/25/40
set Input_Cpt=dem3.cpt
set Input_grid=D:\University\GMT\Data\tbase180.grd
set Iran_grid=Iran_grid.grd
gmt gmtset PROJ_LENGTH_UNIT = inch
gmtset MAP_LOGO_POS=BL/-1c/-9c
set coord_sys=M6.5i
rem **************************************************************
rem ********* Iran Baseman and topography and title
gmt grdcut %Input_grid% -G%Iran_grid% -R%range% -V
gmt grd2cpt %Iran_grid% -L0/6020 -S0/6020/500 -Z -C%Input_Cpt% > New_Cpt.cpt
gmt grdgradient %Iran_grid% -A50 -G%Iran_grid%.int -Ne0.8 -fg
gmt psbasemap -J%coord_sys% -R%range% -B5f1 -Y5i -P -K -V -BWESN > %filename%
echo 50.8 41 28,20 -23 Iran Map | pstext -J%coord_sys% -R -F+f+a0+j -N -O -K -V >> %filename%
gmt grdimage %Iran_grid% -J%coord_sys% -R%range% -CNew_Cpt.cpt -I%Iran_grid%.int -P -O -K -V >> %filename%
gmt psscale -CNew_Cpt.cpt -D3.1/-0.5/5.5/0.15h -P -Bxa1000f500+l"Elevation" -By+lm -I -V -K -O -UBL/-1/-4.75>> %filename%
REM **************************************************************
REM ********* Adding Different Layers
REM ******************** Adding point layers
gmt psxy 1_Cities.gmt -JM -R -Ss0.13 -Gyellow -W0.005 -O -K -P -V >> %filename%
gmt psxy 2_Villages.gmt -JM -R -Ss0.03 -Gmagenta -W0.005 -O -K -P -V >> %filename%
gmt psxy 3_Towns.gmt -JM -R -Ss0.07 -Gcyan -W0.005 -O -K -P -V >> %filename%
gmt psxy Earthquake_5_6_1980_2015.gmt -JM -R -Sc0.02 -Gred -W0.005,255/128/0 -O -K -P -V >> %filename%
gmt psxy Earthquake_6_6.5_1980_2015.gmt -JM -R -Sc0.05 -Gred -W0.005,255/128/0 -O -K -P -V >> %filename%
gmt psxy Earthquake_6.5_10_1980_2015.gmt -JM -R -Sc0.1 -Gred -W0.005,255/128/0 -O -K -P -V >> %filename%
REM REM ******************** Adding linear layers
gmt psxy faults.gmt -JM -R -W0.05c,red -O -K -P -V >> %filename%
gmt psxy Raiways.gmt -JM -R -W0.005c,magenta -O -K -P -V >> %filename%
gmt psxy Roads.gmt -JM -R -W0.005c,black -O -K -P -V >> %filename%
gmt psxy Waterways.gmt -JM -R -W0.005c,blue -O -K -P -V >> %filename%
gmt psxy trench.gmt -JM -R -W0.05c,green -O -K -P -V >> %filename%
REM REM ******************** Adding Polygon layers
gmt psxy Forests.gmt -JM -R -W0.01p,100 -L -Ggreen -P -O -K -V >> %filename%
gmt psxy Proviences.gmt -JM -R -W1p,black -L -P -O -K -V >> %filename%
gmt psxy Water_Body.gmt -JM -R -Gblue -W0.1p,black -L -P -O -K -V >> %filename%
REM **************************************************************
REM ********* Adding Volcano
REM extract_volcanoes volcanos_of_the_world.txt -R%range% -Z -V > volcanos.txt
REM gawk "{print $1, $2}" volcanos.txt > Iran_volcanos.txt
gmt psxy Iran_volcanos.txt -Skvolcano/0.2 -Gmagenta -R -J -W0.1p -O -K -V >>%filename%
rem **************************************************************
rem ********* Adding Focal Mechanism
gawk "{if ($16 >= 52 && $10 <= 35) print $3, $2, $5, $18, $19, $20, $6, $3, $2 }" Iran_Earthquack_Data.txt | psmeca -JM -R -Sa0.15/0/0 -G0/0/255 -C -P -O -K -L -V >> %filename%
gawk "{if ($16 < 52 && $16 >= 40 && $10 <= 20) print $3, $2, $5, $18, $19, $20, $6, $3, $2 }" Iran_Earthquack_Data.txt | psmeca -JM -R -Sa0.15/0/0 -G0/200/255 -C -P -O -K -L -V >> %filename%
gawk "{if ($16 < 40 && $10 <= 20 && $13 >=45) print $3, $2, $5, $18, $19, $20, $6, $3, $2 }" Iran_Earthquack_Data.txt | psmeca -JM -R -Sa0.15/0/0 -G0/255/0 -C -P -O -K -L -V >> %filename%
gawk "{if ($16 <= 20 && $10 < 40 && $13 >=45) print $3, $2, $5, $18, $19, $20, $6, $3, $2 }" Iran_Earthquack_Data.txt | psmeca -JM -R -Sa0.15/0/0 -G0/255/0 -C -P -O -K -L -V >> %filename%
gawk "{if ($16 <= 20 && $10 >= 40 && $10 < 52) print $3, $2, $5, $18, $19, $20, $6, $3, $2 }" Iran_Earthquack_Data.txt | psmeca -JM -R -Sa0.15/0/0 -G255/200/0 -C -P -O -K -L -V >> %filename%
gawk "{if ($16 <= 35 && $10 >= 52) print $3, $2, $5, $18, $19, $20, $6, $3, $2 }" Iran_Earthquack_Data.txt | psmeca -JM -R -Sa0.15/0/0 -G255/0/0 -C -P -O -K -L -V >> %filename%
rem **************************************************************
rem ********* Adding Coastlines
gmt pscoast -Sblue -R -J%coord_sys% -Df -P -O -K -V -Lf60/39.5/35/500+u -N1/1.2p,0 -W1p >> %filename%
rem **************************************************************
rem ********* Adding Islands as a point layer
gmt psxy Islands.gmt -JM -R -Sc0.05 -Ggray -W0.005,red -O -K -P -V >> %filename%
rem **************************************************************
rem ********* Adding Earth Globe
pslegend legendre.txt -Dx3.2i/-1.4i/6.5i/2.9i/TC -Jx1i -R0/8/0/8 -F+g255/248/220+i1p/3p,blue+r10p -O -V -K >> %filename%
gmt pscoast -Rg -JA40/40/1.5i -Bg -Dc -A100 -Ggreen -Sblue -N1/0.25p,- -W0.25p,white -P -O -K -X.16 -Y.16 >> %filename%
echo 52 30 0.2 | gmt psxy -JA -Sc -W2p,red -R -P -O -K -V >> %filename%
rem **************************************************************
rem ********* Adding Texts
echo 50.5 37.8 CB Caspian Sea | pstext -J%coord_sys% -R%range% -F+f13,14,white+a0+j -N -O -K -V >> %filename%
echo 51 26.2 CB Persian Gulf | pstext -J%coord_sys% -R%range% -F+f13,14,white+a330+j -N -O -K -V >> %filename%
echo 56.8 24.7 CB Oman Sea | pstext -J%coord_sys% -R%range% -F+f8,14,white+a0+j -N -O -K -V >> %filename%
echo 62 32 CB Afghanistan | pstext -J%coord_sys% -R%range% -F+f15,18,white+a270+j -N -O -K -V >> %filename%
echo 60 37 CB Turkmenistan | pstext -J%coord_sys% -R%range% -F+f15,18,white+a315+j -N -O -K -V >> %filename%
echo 47 39.3 CB Azerbaijan | pstext -J%coord_sys% -R%range% -F+f7,18,white+a0+j -N -O -K -V >> %filename%
echo 45.1 39 CB Armenia | pstext -J%coord_sys% -R%range% -F+f5,18,white+a330+j -N -O -K -V >> %filename%
echo 43 38 CB Turkey | pstext -J%coord_sys% -R%range% -F+f14,18,white+a90+j -N -O -K -V >> %filename%
echo 44 33 CB Iraq | pstext -J%coord_sys% -R%range% -F+f15,18,white+a90+j -N -O -K -V >> %filename%
echo 48 25 CB Saudi Arabia | pstext -J%coord_sys% -R%range% -F+f8,18,white+a0+j -N -O -K -V >> %filename%
echo 62.7 27 CB Pakistan | pstext -J%coord_sys% -R%range% -F+f12,18,white+a270+j -N -O -K -V >> %filename%
rem **************************************************************
rem ********* Adding Texts for footprint
echo 47 10 12,20 -23 GMT Final Report by Ehsan Momeni | pstext -J%coord_sys% -R -F+f+a0+j -N -O -V >> %filename%
rem **************************************************************
rem ********* Removing Extra files
del gmt.conf gmt.history Iran_grid.grd Iran_grid.grd.int New_Cpt.cpt
rem **************************************************************
rem ********* Opening the Postscript
%filename%
