From 721fed3cb8d9074027a0a48c51856f3051cf8a37 Mon Sep 17 00:00:00 2001
From: kgao <kenny.gao@ssec.wisc.edu>
Date: Mon, 15 Aug 2016 16:01:01 +0000
Subject: [PATCH] Added valid_min and max attributes schema contains valid_min
 and max values level_b1's nc.py now implements those values into the netCDF
 header:

---
 .gitignore                     | 11 ++++++++++-
 aosstower/level_b1/daily/nc.py |  5 +++++
 aosstower/schema.py            | 10 ++++++++--
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 16f2dc5..bee8335 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,10 @@
-*.csv
\ No newline at end of file
+*.csv
+
+*.egg-info
+build/*
+dist/*
+*.swp
+*.nc
+*__pycache__
+
+aosstower/level_b1/monthly/*
diff --git a/aosstower/level_b1/daily/nc.py b/aosstower/level_b1/daily/nc.py
index 501e5cb..c1b676f 100644
--- a/aosstower/level_b1/daily/nc.py
+++ b/aosstower/level_b1/daily/nc.py
@@ -100,10 +100,15 @@ def createVariables(ncFile, firstStamp, chunksizes, zlib):
         
         variable = ncFile.createVariable(entry, np.float32,
         dimensions=('time'), fill_value=float(-999), zlib=zlib, chunksizes=chunksizes)
+
         variable.standard_name = varTup[1]
         variable.description = varTup[3]
         variable.units = varTup[4]
 
+        if(varTup[5] != ''):
+            variable.valid_min = float(varTup[5])
+            variable.valid_max = float(varTup[6])
+
     #create global attributes
     ncFile.source = 'surface observation'
     ncFile.conventions = 'ARM-1.2 CF-1.6'
diff --git a/aosstower/schema.py b/aosstower/schema.py
index b89f72b..65fa4d2 100644
--- a/aosstower/schema.py
+++ b/aosstower/schema.py
@@ -11,7 +11,10 @@ database = dict(
         'air_temperature',
         'box_temp',
         'Auxillary Temperature',
-        'degC'),
+        'degC',
+        '',
+        ''
+        ),
     box_pressure=Var(
         float32,
         'air_pressure',
@@ -60,7 +63,10 @@ database = dict(
         '',
         'paro_cal_sig',
         '',
-        ''),
+        '',
+        '',
+        ''
+        ),
     box_rh=Var(
         float32,
         'relative_humidity',
-- 
GitLab