Omaha #4259 Fix lat/lon grids and ifpnetCDF parmList issues

Change-Id: Ie1437c6455a7c88a31ba0152bd56976ab6ce70c3

Former-commit-id: 26faf2500b76504bddcda0e6eb5dbe334e6cdc3f
This commit is contained in:
Ron Anderson 2015-07-07 10:16:36 -05:00
parent 6ed473f7ac
commit 2853d08519
4 changed files with 8 additions and 13 deletions

View file

@ -1702,7 +1702,7 @@ class SmartScript(BaseTool.BaseTool):
def getLatLonGrids(self):
gridLoc = self.getGridLoc()
latLonGrid = gridLoc.getLatLonGrid().getNDArray();
latLonGrid = gridLoc.getLatLonGrid()
# FIXME We reverse the x and y dimensions because that's what AWIPS 1
# did and that makes the pre-existing python code compatible. Java
# ordering is x,y while python is ordering is y,x. So our latlonGrid

View file

@ -209,7 +209,7 @@ def advection(windGrid, scalarGrid):
# in any SmartTool.
def getLatLonGrids(gridLoc):
# Fetch the grids
latLonGrid = gridLoc.getLatLonGrid().__numpy__[0];
latLonGrid = gridLoc.getLatLonGrid()
latLonGrid = reshape(latLonGrid, (2,gridLoc.getNy().intValue(),gridLoc.getNx().intValue()), order='F')
return latLonGrid[1], latLonGrid[0]

View file

@ -370,7 +370,7 @@ def storeLatLonGrids(client, file, databaseID, invMask, krunch, clipArea):
gridLoc = IFPServerConfigManager.getServerConfig(DatabaseID(databaseID).getSiteId()).dbDomain()
pDict = gridLoc.getProjection()
latLonGrid = gridLoc.getLatLonGrid().getNDArray()
latLonGrid = gridLoc.getLatLonGrid()
latLonGrid = numpy.reshape(latLonGrid, (2,gridLoc.getNy().intValue(),gridLoc.getNx().intValue()), order='F')
@ -1270,10 +1270,9 @@ def main(outputFilename, parmList, databaseID, startTime,
# AFPS.DBSubsystem_getBuiltBy(), AFPS.DBSubsystem_getBuiltOn(),
# AFPS.DBSubsystem_getBuildVersion())
try:
len(parmList)
except TypeError:
if hasattr(parmList, 'java_name'):
parmList = JUtil.javaObjToPyVal(parmList)
argDict = {"outputFilename": outputFilename,
"parmList": parmList,
"databaseID": databaseID,

View file

@ -980,17 +980,13 @@ public class GridLocation extends PersistableDataObject<String> implements
PixelOrientation.CENTER, this);
mt.transform(gridCells, 0, latLon, 0, gridCells.length / 2);
} catch (Exception e) {
e.printStackTrace();
statusHandler.error("Error computing lat/lon grid", e);
}
/*
* FIXME We reverse the x and y dimensions because that's what AWIPS 1
* did and that makes the pre-existing python code compatible. Java
* ordering is x,y while python is ordering is y,x. It's confusing and
* questionable at best so someday someone should correct all that. Good
* luck.
* return the 1-d array and let python reshape it
*/
return new NDArray<float[]>(latLon, ny, nx, 2);
return new NDArray<float[]>(latLon, 1, latLon.length);
}
/**