From 30dd811f4884c87fff9f99e4f4f422959fc7cb3a Mon Sep 17 00:00:00 2001
From: Geoff Cureton <geoff.cureton@ssec.wisc.edu>
Date: Mon, 19 Feb 2018 19:50:30 +0000
Subject: [PATCH] Some updates to the fusion_matlab and vnpaerdt submission
 scripts, to use some updated SIPS utility modules.

---
 submit_fusion_matlab.py | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/submit_fusion_matlab.py b/submit_fusion_matlab.py
index 3c6548b..bcc8b77 100644
--- a/submit_fusion_matlab.py
+++ b/submit_fusion_matlab.py
@@ -1,11 +1,10 @@
 import sys
-from datetime import datetime, timedelta
 import traceback
-import logging
 import calendar
+import logging
 
-from flo.time import TimeInterval
 from flo.ui import safe_submit_order
+from timeutil import TimeInterval, datetime, timedelta
 
 from flo.sw.fusion_matlab import FUSION_MATLAB
 from flo.sw.fusion_matlab.utils import setup_logging
@@ -17,17 +16,22 @@ setup_logging(2)
 
 comp = FUSION_MATLAB()
 
-satellite = 'aqua'
-#satellite = 'snpp'
+#satellite = 'aqua'
+#granule_length = timedelta(minutes=5)
+satellite = 'snpp'
+granule_length = timedelta(minutes=6)
 
 version = '1.0dev0'
 delivery_id = '20170920-1'
+version = '1.0dev0'
 
 # Specify the intervals
 #granule = datetime(2014, 7, 6, 2, 0) # Gala Wind
-granule = datetime(2015, 4, 17, 0, 0) # Bryan Baum
+granule = datetime(2015, 4, 17) # Bryan Baum
+#granule = datetime(2015, 4, 17, 17, 55) # Bryan Baum
 wedge = timedelta(seconds=1.)
 #intervals = [
+    #TimeInterval(granule, granule + granule_length - wedge)
     #TimeInterval(granule, granule + timedelta(hours=1) - wedge)
     #TimeInterval(granule, granule + timedelta(days=1) - wedge)
     #TimeInterval(granule - timedelta(hours=1), granule + timedelta(hours=1))
@@ -37,14 +41,14 @@ wedge = timedelta(seconds=1.)
     #TimeInterval(datetime(2015, 4, 25, 13,  0), datetime(2015, 4, 25,  14,  0) - wedge)
 #]
 
-intervals = [TimeInterval(datetime(2015, 4, day), datetime(2015, 4, day, 23, 59)) for day in range(1, calendar.monthrange(2016, 4)[1]+1)]
+intervals = [TimeInterval(datetime(2015, 4, day), datetime(2015, 4, day, 23, 59)) for day in range(1, calendar.monthrange(2015, 4)[1]+1)]
 
 
 LOG.info("Submitting intervals...")
 for interval in intervals:
     LOG.info("Submitting interval {} -> {}".format(interval.left, interval.right))
 
-    contexts =  comp.find_contexts(interval, satellite, delivery_id)
+    contexts =  comp.find_contexts(interval, satellite, version)
 
     LOG.info("\tThere are {} contexts in this interval".format(len(contexts)))
     contexts.sort()
-- 
GitLab