From 3ccf4d75c0e9116d7d798523e0ac42b257f17879 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Thu, 29 Jun 2023 12:19:05 -0500
Subject: [PATCH] snapshot...

---
 modules/util/infer_cloud_fraction.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/util/infer_cloud_fraction.py b/modules/util/infer_cloud_fraction.py
index be92f61a..92b4949e 100644
--- a/modules/util/infer_cloud_fraction.py
+++ b/modules/util/infer_cloud_fraction.py
@@ -7,7 +7,7 @@ from util.util import get_cartopy_crs, write_cld_frac_file_nc4
 import numpy as np
 
 
-def infer_cloud_fraction(clvrx_path, output_dir, full_disk=True, satellite='GOES16', domain='FD'):
+def infer_cloud_fraction(clvrx_path, output_dir, full_disk=True, satellite='GOES16', domain='FD', pattern=None):
     # -- location of the trained model
     ckpt_dir_s = os.listdir(model_path)
     ckpt_dir = model_path + ckpt_dir_s[0]
@@ -24,7 +24,11 @@ def infer_cloud_fraction(clvrx_path, output_dir, full_disk=True, satellite='GOES
     nn = SRCNN()
     nn.setup_inference(ckpt_dir)
 
-    clvrx_ds = CLAVRx(clvrx_path)
+    if pattern is not None:
+        clvrx_ds = CLAVRx(clvrx_path, pattern=pattern)
+    else:
+        clvrx_ds = CLAVRx(clvrx_path)
+
     for fname, t_start, t_stop in clvrx_ds:
         dto = clvrx_ds.get_datetime(fname)
         clvrx_str_time = dto.strftime('%Y-%m-%d_%H:%M')
-- 
GitLab