From 0351c58190ec5c7bb85b22094e39dc5250850ec9 Mon Sep 17 00:00:00 2001 From: "Boyd, Oliver S" <olboyd@usgs.gov> Date: Thu, 2 Jan 2020 17:46:47 +0000 Subject: [PATCH] Replace GetJK.m --- matlab/GetJK.m | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/matlab/GetJK.m b/matlab/GetJK.m index fc91ae9..e050084 100644 --- a/matlab/GetJK.m +++ b/matlab/GetJK.m @@ -1,6 +1,6 @@ function [J,K] = GetJK(Lat,Lon) -global mstruct LOv LAv jg kg +global LOv LAv jg kg X1 = -2600000; Y1 = 0; @@ -8,11 +8,6 @@ X2 = 2300000; Y2 = 3200000; nx = 4901; ny = 3201; -if length(which('projfwd')) > 0 - [X,Y] = projfwd(mstruct,double(Lat),double(Lon)); - J = (ny - 1)*(Y - Y1)/(Y2 - Y1) + 1; - 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 + +J = interp2(LOv,LAv,jg,Lon,Lat,'linear'); +K = interp2(LOv,LAv,kg,Lon,Lat,'linear'); -- GitLab