From 53cc1e7d1192514086b855dc03034f5271a659a8 Mon Sep 17 00:00:00 2001
From: Levi Pfantz <lpfantz@wisc.edu>
Date: Wed, 3 Jul 2024 16:08:16 -0500
Subject: [PATCH] add G19 support

---
 .../libexec/gridded_glm/_minute_gridder.py       | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/gridded_glm/libexec/gridded_glm/_minute_gridder.py b/gridded_glm/libexec/gridded_glm/_minute_gridder.py
index 4e9cabd..295d64c 100644
--- a/gridded_glm/libexec/gridded_glm/_minute_gridder.py
+++ b/gridded_glm/libexec/gridded_glm/_minute_gridder.py
@@ -65,6 +65,9 @@ warnings.filterwarnings("ignore")
 import dask
 dask.config.set(num_workers=1)
 
+GOES_SAT_POSITIONS={'G16': 'east', 'G17': 'west', 'G18': 'west', 'G19': 'east',}
+
+
 def create_parser():
     def bounded_float(afloat, inclusive_min, inclusive_max):
         value = float(afloat)
@@ -118,12 +121,11 @@ def get_resolution(args):
 
 # if provided "auto" position, we determine the sensor from the filename
 def get_goes_position(filenames):
-    if all("_G16_" in f for f in filenames):
-        return "east"
-    if all("_G17_" in f for f in filenames):
-        return "west"
-    if all("_G18_" in f for f in filenames):
-        return "west"
+
+#Check that all files are the same sat
+    for key, value in GOES_SAT_POSITIONS.items():
+        if all(f"_{key}_" in f for f in filenames):
+            return value
 
     # we require that all files are from the same sensor and raise an exception if not
     raise ValueError("could not determine GOES position - did you provide a mix of satellites?")
@@ -484,4 +486,4 @@ def main():
         return 0
 
 if __name__ == '__main__':
-    sys.exit(main())
\ No newline at end of file
+    sys.exit(main())
-- 
GitLab