From 1a1c16daa3338561c50ddf449b6cfe7db7b88c88 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Tue, 27 Oct 2020 12:00:33 -0500
Subject: [PATCH] snapshot...

---
 modules/aeolus/aeolus_amv.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py
index b0c266a2..35b83e9a 100644
--- a/modules/aeolus/aeolus_amv.py
+++ b/modules/aeolus/aeolus_amv.py
@@ -440,7 +440,7 @@ def match_amvs_to_aeolus(aeolus_dict, amv_files_path, amv_source='OPS', band='14
 # aeolus_to_amv_dct: output from match_amvs_to_aeolus
 # aeolus_dct: output from get_aeolus_time_dict
 # amv_files: container representing specific AMV product info
-def create_file(filename, aeolus_to_amv_dct, aeolus_dct, amv_files):
+def create_file(filename, aeolus_to_amv_dct, aeolus_dct, amv_files, cld_lyr=False):
     keys = list(aeolus_to_amv_dct.keys())
 
     num_amvs = []
@@ -491,10 +491,11 @@ def create_file(filename, aeolus_to_amv_dct, aeolus_dct, amv_files):
     prf_lat.units = 'degrees north'
     prof_time.units = 'seconds since 1970-01-1 00:00:00'
 
-    prf_azm = rootgrp.createVariable('prof_azm', 'f4', ['profs'])
-    prf_azm.units = 'degree'
-    prf_spd = rootgrp.createVariable('prof_spd', 'f4', ['profs'])
-    prf_spd.units = 'm s-1'
+    if not cld_lyr:
+        prf_azm = rootgrp.createVariable('prof_azm', 'f4', ['profs'])
+        prf_azm.units = 'degree'
+        prf_spd = rootgrp.createVariable('prof_spd', 'f4', ['profs'])
+        prf_spd.units = 'm s-1'
     prf_hht = rootgrp.createVariable('prof_hht', 'f4', ['profs'])
     prf_hht.units = 'meter'
     prf_hhb = rootgrp.createVariable('prof_hhb', 'f4', ['profs'])
@@ -513,10 +514,14 @@ def create_file(filename, aeolus_to_amv_dct, aeolus_dct, amv_files):
         prof = prof_s
         if isinstance(prof_s, list):
             prof = prof_s[0]
-        prf_hht[i_c:i_d] = prof[:, 3]
-        prf_hhb[i_c:i_d] = prof[:, 4]
-        prf_azm[i_c:i_d] = prof[:, 5]
-        prf_spd[i_c:i_d] = prof[:, 6]
+        if not cld_lyr:
+            prf_hht[i_c:i_d] = prof[:, 3]
+            prf_hhb[i_c:i_d] = prof[:, 4]
+            prf_azm[i_c:i_d] = prof[:, 5]
+            prf_spd[i_c:i_d] = prof[:, 6]
+        else:
+            prf_hht[i_c:i_d] = prof[:, 2]
+            prf_hhb[i_c:i_d] = prof[:, 3]
         i_c += nlevs
 
         plat = prof[0, 0]
-- 
GitLab