From 1c3c8a3370f786029f3cc2f871589d3bb49b14be Mon Sep 17 00:00:00 2001
From: "(no author)" <(no author)@8a9318a1-56ba-4d59-b755-99d26321be01>
Date: Tue, 6 Oct 2009 21:42:24 +0000
Subject: [PATCH] absolutely minimal changes needed to do stats and stats only
 reports on hdf5 ipopp data files

git-svn-id: https://svn.ssec.wisc.edu/repos/glance/trunk@81 8a9318a1-56ba-4d59-b755-99d26321be01
---
 pyglance/glance/compare.py | 10 ++++++++--
 pyglance/glance/io.py      |  9 ++++-----
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/pyglance/glance/compare.py b/pyglance/glance/compare.py
index a772d7e..6290cdc 100644
--- a/pyglance/glance/compare.py
+++ b/pyglance/glance/compare.py
@@ -334,6 +334,12 @@ def _load_config_or_options(optionsSet, originalArgs) :
         
         # note: there is no way to set the tolerances from the command line 
     
+    # if we can't use a longitude / latitude
+    # we also don't want to make images!
+    # TODO, make this actually control the comparison logic and report
+    if ("shouldIgnoreLonLat" in runInfo) and (runInfo["shouldIgnoreLonLat"]) :
+        runInfo["shouldIncludeImages"] = False
+    
     return paths, runInfo, defaultsToUse, requestedNames, usedConfigFile
 
 def _get_and_analyze_lon_lat (fileObject,
@@ -927,7 +933,7 @@ python -m glance
             # if not then create it
             variableDir = outputPath + "/" + displayName
             varRunInfo['variable_dir'] = variableDir
-            varRunInfo['variable_report_path_escaped'] = quote(displayName + "/" + technicalName + '.html')
+            varRunInfo['variable_report_path_escaped'] = quote("./" + displayName + "/" + os.path.split(technicalName)[1] + '.html')
             LOG.debug ("Directory selected for variable information: " + varRunInfo['variable_report_path_escaped'])
             if not (os.path.isdir(variableDir)) :
                 LOG.debug("Variable directory (" + variableDir + ") does not exist.")
@@ -1036,7 +1042,7 @@ python -m glance
                                                          variableAnalysisInfo[varKey]['var_stats'],
                                                          spatialInfo,
                                                          variableAnalysisInfo[varKey]['run_info']['variable_dir'],
-                                                         variableAnalysisInfo[varKey]['run_info']['variable_name'] + ".html")
+                                                         (os.path.split(variableAnalysisInfo[varKey]['run_info']['variable_name'])[1]) + ".html")
             
             print ('generating summary report')
             # get the current time
diff --git a/pyglance/glance/io.py b/pyglance/glance/io.py
index f898d36..9bc16ab 100644
--- a/pyglance/glance/io.py
+++ b/pyglance/glance/io.py
@@ -218,11 +218,10 @@ class h5(object):
         variable_object = self.get_variable_object(name)
         raw_data_copy = variable_object[:]
         # load the scale factor and add offset
-        temp_attributes = variable_object.attributes()
-        if ('scale_factor' in temp_attributes) :
-            scale_factor = temp_attributes['scale_factor']
-        if ('add_offset' in temp_attributes) :
-            add_offset = temp_attributes['add_offset']
+        if ('scale_factor' in variable_object.attrs) :
+            scale_factor = variable_object.attrs['scale_factor']
+        if ('add_offset' in variable_object.attrs) :
+            add_offset = variable_object.attrs['add_offset']
         # todo, does cdf have an equivalent of endaccess to close the variable?
         
         # don't do lots of work if we don't need to scale things
-- 
GitLab