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

adding support for correcting AWIPS data type distortion on load; note this...

adding support for correcting AWIPS data type distortion on load; note this isn't yet hooked up to the outer methods in compare

git-svn-id: https://svn.ssec.wisc.edu/repos/glance/trunk@209 8a9318a1-56ba-4d59-b755-99d26321be01
parent a62fa474
No related branches found
No related tags found
No related merge requests found
...@@ -230,7 +230,8 @@ def load_variable_data(fileObject, variableNameInFile, ...@@ -230,7 +230,8 @@ def load_variable_data(fileObject, variableNameInFile,
variableToFilterOn=None, variableToFilterOn=None,
variableBasedFilter=None, variableBasedFilter=None,
altVariableFileObject=None, altVariableFileObject=None,
fileDescriptionForDisplay="file") : fileDescriptionForDisplay="file",
correctForAWIPS=False) :
""" """
load data for a variable from a file load data for a variable from a file
optionally filter the variable data based on a data filter or another variable optionally filter the variable data based on a data filter or another variable
...@@ -249,6 +250,7 @@ def load_variable_data(fileObject, variableNameInFile, ...@@ -249,6 +250,7 @@ def load_variable_data(fileObject, variableNameInFile,
else : else :
try : try :
variableData = numpy.array(fileObject[variableNameInFile]) if forceDType is None else numpy.array(fileObject[variableNameInFile], dtype=forceDType) variableData = numpy.array(fileObject[variableNameInFile]) if forceDType is None else numpy.array(fileObject[variableNameInFile], dtype=forceDType)
variableData = variableData.astype(numpy.uint8) if correctForAWIPS else variableData
except Exception, ex : except Exception, ex :
import traceback import traceback
exceptionToRaise = ValueError('Unable to retrieve ' + variableNameInFile + ' data. The variable name ' + exceptionToRaise = ValueError('Unable to retrieve ' + variableNameInFile + ' data. The variable name ' +
......
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