Skip to content
Snippets Groups Projects
Commit 0351c581 authored by Boyd, Oliver S.'s avatar Boyd, Oliver S.
Browse files

Replace GetJK.m

parent d848c441
No related branches found
No related tags found
No related merge requests found
function [J,K] = GetJK(Lat,Lon) function [J,K] = GetJK(Lat,Lon)
global mstruct LOv LAv jg kg global LOv LAv jg kg
X1 = -2600000; X1 = -2600000;
Y1 = 0; Y1 = 0;
...@@ -8,11 +8,6 @@ X2 = 2300000; ...@@ -8,11 +8,6 @@ X2 = 2300000;
Y2 = 3200000; Y2 = 3200000;
nx = 4901; nx = 4901;
ny = 3201; ny = 3201;
if length(which('projfwd')) > 0
[X,Y] = projfwd(mstruct,double(Lat),double(Lon)); J = interp2(LOv,LAv,jg,Lon,Lat,'linear');
J = (ny - 1)*(Y - Y1)/(Y2 - Y1) + 1; K = interp2(LOv,LAv,kg,Lon,Lat,'linear');
K = (nx - 1)*(X - X1)/(X2 - X1) + 1;
else
J = interp2(LOv,LAv,jg,Lon,Lat,'linear');
K = interp2(LOv,LAv,kg,Lon,Lat,'linear');
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment