Issue #1821 Reshape grib data arrays in place to improve performance.
Former-commit-id:5d01725fea
[formerly4621133ff1
] [formerly75c8d46901
[formerly 30354883c5dff0fdbf196e7f405525451df1e81e]] Former-commit-id:75c8d46901
Former-commit-id:04028b0136
This commit is contained in:
parent
53b0411753
commit
e722fa0723
1 changed files with 5 additions and 3 deletions
|
@ -129,6 +129,8 @@ THINNED_GRID_VALUES = THINNED_GRID_PT_MAP.values()
|
||||||
# Date Ticket# Engineer Description
|
# Date Ticket# Engineer Description
|
||||||
# ------------ ---------- ----------- --------------------------
|
# ------------ ---------- ----------- --------------------------
|
||||||
# 04/7/09 #1994 bphillip Initial Creation.
|
# 04/7/09 #1994 bphillip Initial Creation.
|
||||||
|
# Mar 25, 2013 1821 bsteffen Reshape grib data arrays in
|
||||||
|
# place to improve performance.
|
||||||
#
|
#
|
||||||
class GribDecoder():
|
class GribDecoder():
|
||||||
|
|
||||||
|
@ -327,7 +329,7 @@ class GribDecoder():
|
||||||
if scanMode is not None:
|
if scanMode is not None:
|
||||||
|
|
||||||
if not thinnedGrid:
|
if not thinnedGrid:
|
||||||
numpyDataArray = numpy.resize(data, (ny, nx))
|
numpyDataArray = numpy.reshape(data, (ny, nx))
|
||||||
|
|
||||||
# Check if rows are scanned in opposite direction. If so, we need to flip them around
|
# Check if rows are scanned in opposite direction. If so, we need to flip them around
|
||||||
if scanMode & 16 == 16:
|
if scanMode & 16 == 16:
|
||||||
|
@ -373,7 +375,7 @@ class GribDecoder():
|
||||||
if subCoverage is not None:
|
if subCoverage is not None:
|
||||||
subGrid = spatialCache.getSubGrid(modelName, gridCoverage)
|
subGrid = spatialCache.getSubGrid(modelName, gridCoverage)
|
||||||
# resize the data array
|
# resize the data array
|
||||||
numpyDataArray = numpy.resize(numpyDataArray, (ny, nx))
|
numpyDataArray = numpy.reshape(numpyDataArray, (ny, nx))
|
||||||
startx = subGrid.getUpperLeftX()
|
startx = subGrid.getUpperLeftX()
|
||||||
starty = subGrid.getUpperLeftY()
|
starty = subGrid.getUpperLeftY()
|
||||||
subnx = subGrid.getNX()
|
subnx = subGrid.getNX()
|
||||||
|
@ -399,7 +401,7 @@ class GribDecoder():
|
||||||
# set the new coverage
|
# set the new coverage
|
||||||
gdsSectionValues['coverage'] = subCoverage
|
gdsSectionValues['coverage'] = subCoverage
|
||||||
|
|
||||||
numpyDataArray = numpy.resize(numpyDataArray, (1, metadata[4]))
|
numpyDataArray = numpy.reshape(numpyDataArray, (1, metadata[4]))
|
||||||
|
|
||||||
newAbbr = GribParamTranslator.getInstance().translateParameter(2, pdsSectionValues['parameterAbbreviation'], pdsSectionValues['centerid'], pdsSectionValues['subcenterid'], pdsSectionValues['genprocess'], dataTime, gridCoverage)
|
newAbbr = GribParamTranslator.getInstance().translateParameter(2, pdsSectionValues['parameterAbbreviation'], pdsSectionValues['centerid'], pdsSectionValues['subcenterid'], pdsSectionValues['genprocess'], dataTime, gridCoverage)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue