#!/bin/bash
# $Id: illum_manip.sh 12114 2013-09-03 19:19:00Z fwobbe $
# Test the generation of illumination with yet another algorithm

ps=illum_manip.ps

gmt grdmath -R-15/15/-15/15 -I0.3 X Y HYPOT DUP 2 MUL PI MUL 8 DIV COS EXCH NEG 10 DIV EXP MUL = somb.nc

gmt grd2cpt somb.nc -Cjet > pal.cpt

gmt grdgradient somb.nc -Em225/45 -Gintensity.nc

gmt grdview somb.nc -JX6i -JZ2i -B5 -Bz0.5 -BSEwnZ -N-1/white -Qi100 -Iintensity.nc -X1.5i -Cpal.cpt \
	-R-15/15/-15/15/-1/1 -K -p120/30 > $ps

rm -f somb.nc intensity.nc pal.cpt