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

moved reports to generate before figures; corrected formula for unscaling data

git-svn-id: https://svn.ssec.wisc.edu/repos/glance/trunk@72 8a9318a1-56ba-4d59-b755-99d26321be01
parent 3a6f22b5
No related branches found
No related tags found
No related merge requests found
...@@ -992,28 +992,6 @@ python -m glance ...@@ -992,28 +992,6 @@ python -m glance
isParent = True isParent = True
childPids = [] childPids = []
# loop to create the images for all our variables
if (runInfo['shouldIncludeImages']) :
for varKey in variableAnalysisInfo :
if (not ('shouldIncludeImages' in variableAnalysisInfo[varKey]['run_info'])) \
or (variableAnalysisInfo[varKey]['run_info']['shouldIncludeImages']) :
# create the images comparing that variable
print("\tcreating figures for: " + variableAnalysisInfo[varKey]['exp_name'])
plot.plot_and_save_figure_comparison(variableAnalysisInfo[varKey]['data']['A'],
variableAnalysisInfo[varKey]['data']['B'],
variableAnalysisInfo[varKey]['run_info'],
files['file A']['path'],
files['file B']['path'],
latitudeA, longitudeA,
latitudeB, longitudeB,
latitudeCommon, longitudeCommon,
spaciallyInvalidMaskA,
spaciallyInvalidMaskB,
outputPath, True,
doFork=runInfo['doFork'])
print("\tfinished creating figures for: " + variableAnalysisInfo[varKey]['exp_name'])
# reports are fast, so the parent thread will just do this # reports are fast, so the parent thread will just do this
# generate our general report pages once we've looked at all the variables # generate our general report pages once we've looked at all the variables
if (runInfo['shouldIncludeReport']) : if (runInfo['shouldIncludeReport']) :
...@@ -1054,6 +1032,28 @@ python -m glance ...@@ -1054,6 +1032,28 @@ python -m glance
print ('generating glossary') print ('generating glossary')
report.generate_and_save_doc_page(delta.STATISTICS_DOC, outputPath) report.generate_and_save_doc_page(delta.STATISTICS_DOC, outputPath)
# loop to create the images for all our variables
if (runInfo['shouldIncludeImages']) :
for varKey in variableAnalysisInfo :
if (not ('shouldIncludeImages' in variableAnalysisInfo[varKey]['run_info'])) \
or (variableAnalysisInfo[varKey]['run_info']['shouldIncludeImages']) :
# create the images comparing that variable
print("\tcreating figures for: " + variableAnalysisInfo[varKey]['exp_name'])
plot.plot_and_save_figure_comparison(variableAnalysisInfo[varKey]['data']['A'],
variableAnalysisInfo[varKey]['data']['B'],
variableAnalysisInfo[varKey]['run_info'],
files['file A']['path'],
files['file B']['path'],
latitudeA, longitudeA,
latitudeB, longitudeB,
latitudeCommon, longitudeCommon,
spaciallyInvalidMaskA,
spaciallyInvalidMaskB,
outputPath, True,
doFork=runInfo['doFork'])
print("\tfinished creating figures for: " + variableAnalysisInfo[varKey]['exp_name'])
# if we're the parent, wait for any children to catch up # if we're the parent, wait for any children to catch up
if isParent: if isParent:
if len(childPids) > 0 : if len(childPids) > 0 :
......
...@@ -82,11 +82,13 @@ class hdf(SD): ...@@ -82,11 +82,13 @@ class hdf(SD):
# get information about where the data is the missing value # get information about where the data is the missing value
missing_val = self.missing_value(name) missing_val = self.missing_value(name)
missing_mask = (raw_data_copy == missing_val) missing_mask = np.zeros(raw_data_copy.shape, dtype=np.bool)
missing_mask[raw_data_copy == missing_val] = True
# create the scaled version of the data # create the scaled version of the data
scaled_data_copy = np.array(raw_data_copy, dtype=data_type) scaled_data_copy = np.array(raw_data_copy, dtype=data_type)
scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] - add_offset) * scale_factor #TODO, type truncation issues? #scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] - add_offset) * scale_factor #TODO, type truncation issues?
scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] * scale_factor) + add_offset #TODO, type truncation issues?
return scaled_data_copy return scaled_data_copy
...@@ -146,11 +148,13 @@ class nc(CDF): ...@@ -146,11 +148,13 @@ class nc(CDF):
# get information about where the data is the missing value # get information about where the data is the missing value
missing_val = self.missing_value(name) missing_val = self.missing_value(name)
missing_mask = (raw_data_copy == missing_val) missing_mask = np.zeros(raw_data_copy.shape, dtype=np.bool)
missing_mask[raw_data_copy == missing_val] = True
# create the scaled version of the data # create the scaled version of the data
scaled_data_copy = np.array(raw_data_copy, dtype=data_type) scaled_data_copy = np.array(raw_data_copy, dtype=data_type)
scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] - add_offset) * scale_factor #TODO, type truncation issues? #scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] - add_offset) * scale_factor #TODO, type truncation issues?
scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] * scale_factor) + add_offset #TODO, type truncation issues?
return scaled_data_copy return scaled_data_copy
...@@ -222,11 +226,13 @@ class h5(object): ...@@ -222,11 +226,13 @@ class h5(object):
# get information about where the data is the missing value # get information about where the data is the missing value
missing_val = self.missing_value(name) missing_val = self.missing_value(name)
missing_mask = (raw_data_copy == missing_val) missing_mask = np.zeros(raw_data_copy.shape, dtype=np.bool)
missing_mask[raw_data_copy == missing_val] = True
# create the scaled version of the data # create the scaled version of the data
scaled_data_copy = np.array(raw_data_copy, dtype=data_type) scaled_data_copy = np.array(raw_data_copy, dtype=data_type)
scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] - add_offset) * scale_factor #TODO, type truncation issues? #scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] - add_offset) * scale_factor #TODO, type truncation issues?
scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] * scale_factor) + add_offset #TODO, type truncation issues?
return scaled_data_copy return scaled_data_copy
......
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