From f1843fd036f2e3a670f8afc4c94e892e9b8bc018 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Wed, 5 Oct 2022 12:36:16 -0500
Subject: [PATCH] snapshot...

---
 modules/amv/caliop_clavrx_amv.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/amv/caliop_clavrx_amv.py b/modules/amv/caliop_clavrx_amv.py
index b7b227d8..74d312a9 100644
--- a/modules/amv/caliop_clavrx_amv.py
+++ b/modules/amv/caliop_clavrx_amv.py
@@ -244,12 +244,16 @@ def create_file(match_dct, output_path, target_filepath, caliop_clavrx_params, a
     nc4_vars = []
     var_s = rg_exmpl.variables
     for pidx, param in enumerate(amv_params):
-        v = var_s[param]
-        attr_s = v.ncattrs()
+        attr_s = []
+        dtype = 'f4'
+        if param in var_s:
+            v = var_s[param]
+            attr_s = v.ncattrs()
+            dtype = v.dtype
         if '_FillValue' in attr_s:
-            var = rootgrp.createVariable(param, v.dtype, ['num_caliop_profs', 'max_num_amvs'], fill_value=v.getncattr('_FillValue'))
+            var = rootgrp.createVariable(param, dtype, ['num_caliop_profs', 'max_num_amvs'], fill_value=v.getncattr('_FillValue'))
         else:
-            var = rootgrp.createVariable(param, v.dtype, ['num_caliop_profs', 'max_num_amvs'])
+            var = rootgrp.createVariable(param, dtype, ['num_caliop_profs', 'max_num_amvs'])
         # copy attributes from example to new output variable of the same name
         for attr in attr_s:
             if attr != '_FillValue':
-- 
GitLab