#!/usr/bin/env perl

# gmt mapproject -W -Ja-120.5/38.5/1:984252 -R-126/33.2/-115/42.5r
# 38.5975881681  41.2355262765

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_119_15_43_14_0016_201181854_HWK2020118185331.L1A_SE1
$findex $roll $pitch $yaw -13.4
| gmt mapproject --PROJ_LENGTH_UNIT=inch
 -Ja-120.5/38.5/1:984252 -R-126/33.2/-115/42.5r
 -bi3f -bo3f
| gmt nearneighbor -Gtest.grd -I0.01
 -R0/38.6/0/41.24 -N4 -S0.05 -r -bi3f;
gmt grd2xyz test.grd -ZTLH >test.dat;
convert -size 3860x4124 -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
--
