Skip to content
Snippets Groups Projects
Commit 9579c4fd authored by Eva Schiffer's avatar Eva Schiffer
Browse files

fixing an bug with how errors propagate from problems in image creation

parent df9b361f
No related branches found
No related tags found
No related merge requests found
......@@ -78,8 +78,8 @@ def _make_range(data_a, valid_a_mask, num_intervals, offset_to_range=0.0, data_b
minVal = min(delta.min_with_mask(data_b, valid_b_mask), minVal)
maxVal = max(delta.max_with_mask(data_b, valid_b_mask), maxVal)
minVal = minVal - offset_to_range
maxVal = maxVal + offset_to_range
minVal -= offset_to_range
maxVal += offset_to_range
return np.linspace(minVal, maxVal, num_intervals)
......
......@@ -420,11 +420,9 @@ class nc (object):
# get our raw data and scaling info
variable_object = self.get_variable_object(name)
#print ("*** opened variable: " + name)
""" # This scaling code is no longer required because the library automatically handles scaling
raw_data_copy = variable_object[:]
# load the scale factor and add offset
temp = self.attributeCache.get_variable_attributes(name)
if SCALE_FACTOR_STR in temp.keys() :
scale_factor = temp[SCALE_FACTOR_STR]
......@@ -443,8 +441,11 @@ class nc (object):
# create the scaled version of the data
scaled_data_copy = np.array(raw_data_copy, dtype=data_type)
scaled_data_copy[~missing_mask] = (scaled_data_copy[~missing_mask] * scale_factor) + add_offset #TODO, type truncation issues?
"""
return scaled_data_copy
scaled_data_copy = np.array(variable_object[:], dtype=data_type)
return scaled_data_copy
# TODO, this hasn't been supported in other file types
def close (self) :
......
......@@ -329,10 +329,14 @@ def plot_and_save_comparison_figures (aData, bData,
# only plot the compared images if we aren't short circuiting them
if (outputInfoList is not compared_images) or (not shortCircuitComparisons) :
_log_spawn_and_wait_if_needed(figLongDesc, childPids, figFunction, outputPath, figFileName,
makeSmall, doFork, shouldClearMemoryWithThreads, fullDPI=fullDPI, thumbDPI=thumbDPI)
# if we made an attempt to make the file, hang onto the name
outputInfoList.append(figFileName)
try :
_log_spawn_and_wait_if_needed(figLongDesc, childPids, figFunction, outputPath, figFileName,
makeSmall, doFork, shouldClearMemoryWithThreads, fullDPI=fullDPI, thumbDPI=thumbDPI)
# if we made an attempt to make the file, hang onto the name
outputInfoList.append(figFileName)
except ValueError, ve :
LOG.warn("Unable to create " + figDesc + " figure for " + variableDisplayName + ": " + str(ve))
# now we need to wait for all of our child processes to terminate before returning
if (isParent) : # just in case
......
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