Skip to content
Snippets Groups Projects
Commit 6aad3d5e authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

Fix shape

parent 4ac0a6cb
No related branches found
No related tags found
2 merge requests!96Production Release | nshmp-ws-static,!94Dynamic indices
...@@ -137,15 +137,15 @@ public class BoundingReaderGroundMotions extends BoundingReader<XySequence> { ...@@ -137,15 +137,15 @@ public class BoundingReaderGroundMotions extends BoundingReader<XySequence> {
// Build origin array, e.g [0, siteClass] // Build origin array, e.g [0, siteClass]
var origin = netcdf.netcdfShape().buildShape() var origin = netcdf.netcdfShape().buildShape()
.add(IndexKey.IMT, 0)
.add(IndexKey.SITE_CLASS, iSiteClass) .add(IndexKey.SITE_CLASS, iSiteClass)
.add(IndexKey.IML, 0)
.reduce() .reduce()
.build(); .build();
// Build shape array, e.g. [nImts, 1] // Build shape array, e.g. [nImts, 1]
var shape = netcdf.netcdfShape().buildShape() var shape = netcdf.netcdfShape().buildShape()
.add(IndexKey.SITE_CLASS, 1)
.add(IndexKey.IMT, imts.size()) .add(IndexKey.IMT, imts.size())
.add(IndexKey.SITE_CLASS, 1)
.reduce() .reduce()
.build(); .build();
......
...@@ -70,21 +70,22 @@ public class BoundingReaderHazardCurves extends BoundingReader<StaticDataHazardC ...@@ -70,21 +70,22 @@ public class BoundingReaderHazardCurves extends BoundingReader<StaticDataHazardC
// Build target shape array, e.g. [2, 2, nIML, nIMT, nSiteClass] // Build target shape array, e.g. [2, 2, nIML, nIMT, nSiteClass]
var targetShape = netcdfShape.buildShape() var targetShape = netcdfShape.buildShape()
.add(IndexKey.SITE_CLASS, netcdfData.siteClasses().size())
.add(IndexKey.LATITUDE, 2)
.add(IndexKey.LONGITUDE, 2) .add(IndexKey.LONGITUDE, 2)
.add(IndexKey.IMT, netcdfData.imts().size()) .add(IndexKey.LATITUDE, 2)
.add(IndexKey.IML, netcdfData.nIml()) .add(IndexKey.IML, netcdfData.nIml())
.add(IndexKey.IMT, netcdfData.imts().size())
.add(IndexKey.SITE_CLASS, netcdfData.siteClasses().size())
.build(); .build();
var aHazards = targetGroup.findVariableLocal(Key.HAZARD).read(targetOrigin, targetShape); var aHazards = targetGroup.findVariableLocal(Key.HAZARD).read(targetOrigin, targetShape);
// Build final shape array, e.g. [1, 1, nIML, nIMT, nSiteClass]
var shape = netcdfShape.buildShape() var shape = netcdfShape.buildShape()
.add(IndexKey.SITE_CLASS, netcdfData.siteClasses().size())
.add(IndexKey.LATITUDE, 1)
.add(IndexKey.LONGITUDE, 1) .add(IndexKey.LONGITUDE, 1)
.add(IndexKey.IMT, netcdfData.imts().size()) .add(IndexKey.LATITUDE, 1)
.add(IndexKey.IML, netcdfData.nIml()) .add(IndexKey.IML, netcdfData.nIml())
.add(IndexKey.IMT, netcdfData.imts().size())
.add(IndexKey.SITE_CLASS, netcdfData.siteClasses().size())
.build(); .build();
for (var boundingLocation : boundingLocations) { for (var boundingLocation : boundingLocations) {
...@@ -115,7 +116,6 @@ public class BoundingReaderHazardCurves extends BoundingReader<StaticDataHazardC ...@@ -115,7 +116,6 @@ public class BoundingReaderHazardCurves extends BoundingReader<StaticDataHazardC
Array hazards) { Array hazards) {
var netcdfData = ((NetcdfHazardCurves) netcdf).netcdfData(); var netcdfData = ((NetcdfHazardCurves) netcdf).netcdfData();
var vsImtHazardMap = StaticData.<StaticDataHazardCurves> builder(); var vsImtHazardMap = StaticData.<StaticDataHazardCurves> builder();
var logger = Logger.getAnonymousLogger();
for (int iSiteClass = 0; iSiteClass < netcdfData.siteClasses().size(); iSiteClass++) { for (int iSiteClass = 0; iSiteClass < netcdfData.siteClasses().size(); iSiteClass++) {
var siteClass = netcdfData.siteClasses().get(iSiteClass); var siteClass = netcdfData.siteClasses().get(iSiteClass);
...@@ -126,17 +126,17 @@ public class BoundingReaderHazardCurves extends BoundingReader<StaticDataHazardC ...@@ -126,17 +126,17 @@ public class BoundingReaderHazardCurves extends BoundingReader<StaticDataHazardC
// Build origin array, e.g [0, imt, siteClass] // Build origin array, e.g [0, imt, siteClass]
var origin = netcdf.netcdfShape().buildShape() var origin = netcdf.netcdfShape().buildShape()
.add(IndexKey.SITE_CLASS, iSiteClass)
.add(IndexKey.IMT, iImt)
.add(IndexKey.IML, 0) .add(IndexKey.IML, 0)
.add(IndexKey.IMT, iImt)
.add(IndexKey.SITE_CLASS, iSiteClass)
.reduce() .reduce()
.build(); .build();
// Build shape array, e.g. [nIML, 1, 1] // Build shape array, e.g. [nIML, 1, 1]
var shape = netcdf.netcdfShape().buildShape() var shape = netcdf.netcdfShape().buildShape()
.add(IndexKey.SITE_CLASS, 1)
.add(IndexKey.IMT, 1)
.add(IndexKey.IML, netcdfData.nIml()) .add(IndexKey.IML, netcdfData.nIml())
.add(IndexKey.IMT, 1)
.add(IndexKey.SITE_CLASS, 1)
.reduce() .reduce()
.build(); .build();
......
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