Skip to content
Snippets Groups Projects
Commit c9830d6f authored by (no author)'s avatar (no author)
Browse files

added correction to save the path to the doc page so it can be used when...

added correction to save the path to the doc page so it can be used when generating the variable report; also fixed bug with float values being overridden when data types were changed

git-svn-id: https://svn.ssec.wisc.edu/repos/glance/trunk@120 8a9318a1-56ba-4d59-b755-99d26321be01
parent 2030bcfb
No related branches found
No related tags found
No related merge requests found
......@@ -1181,6 +1181,7 @@ def reportGen_library_call (a_path, b_path, var_list=[ ],
LOG.debug("Variable directory (" + variableDir + ") does not exist.")
LOG.debug("Creating variable directory.")
os.makedirs(variableDir)
varRunInfo['doc_path'] = quote(os.path.join(pathsTemp['out'], './' + 'doc.html')) # should this be somewhere else?
# figure out the masks we want, and then do our statistical analysis
mask_a_to_use = None
......
......@@ -181,8 +181,10 @@ class DiffInfoObject (object) :
# figure out the shared type
type_to_return = data1.dtype
changed_type = False
if data1.dtype is not data2.dtype:
type_to_return = np.common_type(data1, data2)
changed_type = True
# upcast the type if we need to
if type_to_return in DiffInfoObject.DATATYPE_UPCASTS :
......@@ -193,21 +195,30 @@ class DiffInfoObject (object) :
# figure out the fill value
fill_value_to_return = None
# if we're looking at float or complex data, use a nan
if (np.issubdtype(type_to_return, np.float) or
np.issubdtype(type_to_return, np.complex)) :
fill_value_to_return = np.nan
# if we're looking at int data, use the minimum value
elif np.issubdtype(type_to_return, np.int) :
fill_value_to_return = np.iinfo(type_to_return).min
# if we're looking at unsigned data, use the maximum value
elif ((type_to_return is np.uint8) or
(type_to_return is np.uint16) or
(type_to_return is np.uint32) or
(type_to_return is np.uint64)) :
fill_value_to_return = np.iinfo(type_to_return).max
# if both of the old fill values exist and are the same, use them
if (fill1 is not None) and (fill1 == fill2) :
fill_value_to_return = fill1
if changed_type :
fill_value_to_return = type_to_return(fill_value_to_return)
else:
# if we're looking at float or complex data, use a nan
if (np.issubdtype(type_to_return, np.float) or
np.issubdtype(type_to_return, np.complex)) :
fill_value_to_return = np.nan
# if we're looking at int data, use the minimum value
elif np.issubdtype(type_to_return, np.int) :
fill_value_to_return = np.iinfo(type_to_return).min
# if we're looking at unsigned data, use the maximum value
elif ((type_to_return is np.uint8) or
(type_to_return is np.uint16) or
(type_to_return is np.uint32) or
(type_to_return is np.uint64)) :
fill_value_to_return = np.iinfo(type_to_return).max
return type_to_return, fill_value_to_return
......
......@@ -496,11 +496,18 @@ class NumericalComparisonStatistics (StatisticalData) :
if (include_basic_analysis) :
basic_dict = NumericalComparisonStatistics.basic_analysis(diffInfoObject.diff_data_object.data,
valid_in_both)
self.rms_diff = basic_dict['rms_diff']
self.std_diff = basic_dict['std_diff']
self.mean_diff = basic_dict['mean_diff']
self.median_diff = basic_dict['median_diff']
self.max_diff = basic_dict['max_diff']
if len(basic_dict) > 0 :
self.rms_diff = basic_dict['rms_diff']
self.std_diff = basic_dict['std_diff']
self.mean_diff = basic_dict['mean_diff']
self.median_diff = basic_dict['median_diff']
self.max_diff = basic_dict['max_diff']
else :
self.rms_diff = np.nan
self.std_diff = np.nan
self.mean_diff = np.nan
self.median_diff = np.nan
self.max_diff = np.nan
self.temp_analysis = basic_dict
def dictionary_form(self) :
......
......@@ -190,7 +190,7 @@ Copyright (c) 2009 University of Wisconsin SSEC. All rights reserved.
</dt>
<dd>
% for statName, statValue in sorted(list(dataSet.items())) :
${statName}<a href="../doc.html">*</a>: ${report.make_formatted_display_string(statValue)} <br>
${statName}<a href="${runInfo['doc_path']}">*</a>: ${report.make_formatted_display_string(statValue)} <br>
% endfor
<br>
<dd>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment