#!/usr/bin/env perl

# gmt mapproject -W -Ja136/-4/1:984252 -R128/-22/144/-8r
# 68.6963027216  61.7723969653

use strict;

my ($findex,$roll,$pitch,$yaw) = @ARGV;

system(join ' ',split ' ',<<"--")==0 or die;
/data1/www-data/oceancolor.gsfc.nasa.gov/src/finderpixcoords/finderpixcoords
WG1_SE1_2020_083_15_48_42_0012_200770108_HWK2020077010747.L1A_SE1
$findex $roll $pitch $yaw
| gmt mapproject --PROJ_LENGTH_UNIT=inch
 -Ja136/-4/1:984252 -R128/-22/144/-8r
 -bi3f -bo3f
| gmt nearneighbor -Gtest.grd -I0.01
 -R0/68.7/0/61.77 -N4 -S0.05 -r -bi3f;
gmt grd2xyz test.grd -ZTLH >test.dat;
convert -size 6870x6177 -depth 16 GRAY:test.dat
 -transparent black -auto-level -evaluate log 10
/home/nkuring/oceanshare401/norman_kuring/Hawkeye/finder.png;
rm test.grd test.dat
--
