From 162bc90fc29f018ae396f2827f642bfa4d6d30ef Mon Sep 17 00:00:00 2001
From: "David P. Mayer" <dpmayer@usgs.gov>
Date: Wed, 23 Oct 2019 19:40:47 -0700
Subject: [PATCH] Remove half pixel shift from bin scripts in light of #127
 (#136)

---
 bin/isisnet2socet | 10 +++++-----
 bin/socetnet2isis |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/bin/isisnet2socet b/bin/isisnet2socet
index c72c5e0..04a688c 100644
--- a/bin/isisnet2socet
+++ b/bin/isisnet2socet
@@ -18,13 +18,13 @@ from plio.utils.utils import find_in_dict, split_all_ext
 def parse_args():
     parser = argparse.ArgumentParser()
 
-    parser.add_argument('cnet_file', help='Path to an isis control network.')
+    parser.add_argument('cnet_file', help='Path to an ISIS control network.')
     parser.add_argument('e_radius', type=float, help='The semimajor radius of a given target.')
     parser.add_argument('eccentricity', type=float, help='The eccentricity of a given target.')
     parser.add_argument('cub_list', help='Path to a list file of all cubes being used. This \
-                                                                 includes file paths an extnsions.')
+                                                                 includes file paths and extensions.')
     parser.add_argument('out_gpf', help='Path to save location of gpf file and new ipf files.')
-    parser.add_argument('--adjusted', help='Flag for saving apriori values or adjusted values',
+    parser.add_argument('--adjusted', help='Flag to save adjusted values instead of a priori values.',
                                       default=False, required = False)
 
     return parser.parse_args()
@@ -123,8 +123,8 @@ def fix_sample_line(record, serial_dict, cub_dict):
     line_size = find_in_dict(cube, 'Lines')
     sample_size = find_in_dict(cube, 'Samples')
 
-    new_line = record['l.'] - (int(line_size / 2.0)) - 1
-    new_sample = record['s.'] - (int(sample_size / 2.0)) - 1
+    new_line = record['l.'] - (int(line_size / 2.0)) - 0.5
+    new_sample = record['s.'] - (int(sample_size / 2.0)) - 0.5
 
     return new_line, new_sample
 
diff --git a/bin/socetnet2isis b/bin/socetnet2isis
index 673b5ce..550705c 100644
--- a/bin/socetnet2isis
+++ b/bin/socetnet2isis
@@ -63,8 +63,8 @@ def line_sample_size(record, path):
                 break
 
 
-        line_size = int(line_size)/2.0 + record['l.'] + 1
-        sample_size = int(sample_size)/2.0 + record['s.'] + 1
+        line_size = int(line_size)/2.0 + record['l.'] + 0.5
+        sample_size = int(sample_size)/2.0 + record['s.'] + 0.5
         return sample_size, line_size, img_index
 
 def get_axis(file):
-- 
GitLab