From 4e2cd7032209242d6be7b1d26f2bc6518d7ed62d Mon Sep 17 00:00:00 2001
From: "R.K.Garcia" <rayg@ssec.wisc.edu>
Date: Tue, 20 Jun 2017 17:34:51 -0500
Subject: [PATCH] alternate calculation of line and column

---
 goesr/l1b.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/goesr/l1b.py b/goesr/l1b.py
index c82d133..0060e86 100644
--- a/goesr/l1b.py
+++ b/goesr/l1b.py
@@ -433,14 +433,14 @@ class PugL1bTools(object):
         # convert to nadir-meters using proj4
         xm, ym = proj(lon, lat, inverse=False)
         # divide out height to get back to projection view angles
-        h = self.nav['perspective_point_height']
-        y, x = ym / h, xm / h
+        h = float(self.nav['perspective_point_height'])
+        # y, x = ym / h, xm / h
         # extract scale factor and add offset to back out to line-from-0, column-from-0
         yvar, xvar = self.nc[self.y_var_name], self.nc[self.x_var_name]
-        ysf, yao = yvar.scale_factor, yvar.add_offset
-        xsf, xao = xvar.scale_factor, xvar.add_offset
+        ysf, yao = float(yvar.scale_factor) * h, float(yvar.add_offset) * h
+        xsf, xao = float(xvar.scale_factor) * h, float(xvar.add_offset) * h
         # reverse scale factor and add offset to get line and column
-        line, column = (y - yao) / ysf, (x - xao) / xsf
+        line, column = (ym - yao) / ysf, (xm - xao) / xsf
         # round to nearest integer
         if round:
             return np.round(line).astype(np.int32), np.round(column).astype(np.int32)
-- 
GitLab