logger.debug("subset grid var = {}", grid2.getVariable()); Array data = grid.readVolumeData(0); Array data2 = grid2.readVolumeData(0);
private void doRead4Volume( GridDataset ds, String varName) throws IOException { GeoGrid gg = ds.findGridByName( varName); CoordinateAxis1D timeAxis = gg.getCoordinateSystem().getTimeAxis1D(); for (int t=0; t<timeAxis.getSize(); t++) { Array aa = gg.readVolumeData(t); int[] shape = aa.getShape(); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { for (int k=0; k<shape[2]; k++) { double got = aa.getDouble( ima.set(i,j,k)); double want = ((double) (t*1000 + i*100 + j*10 + k)); assert (got == want) : "got "+got+ " want "+want; } } } } System.out.println("*** ok reading doRead4Volume for "+varName); }
private void doRead4Volume( GridDataset ds, String varName) throws IOException { GeoGrid gg = ds.findGridByName( varName); CoordinateAxis1D timeAxis = gg.getCoordinateSystem().getTimeAxis1D(); for (int t=0; t<timeAxis.getSize(); t++) { Array aa = gg.readVolumeData(t); int[] shape = aa.getShape(); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { for (int k=0; k<shape[2]; k++) { double got = aa.getDouble( ima.set(i,j,k)); double want = ((double) (t*1000 + i*100 + j*10 + k)); assert (got == want) : "got "+got+ " want "+want; } } } } System.out.println("*** ok reading doRead4Volume for "+varName); }
private void doRead4Volume( GridDataset ds, String varName) throws IOException { GeoGrid gg = ds.findGridByName( varName); CoordinateAxis1D timeAxis = gg.getCoordinateSystem().getTimeAxis1D(); for (int t=0; t<timeAxis.getSize(); t++) { Array aa = gg.readVolumeData(t); int[] shape = aa.getShape(); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { for (int k=0; k<shape[2]; k++) { double got = aa.getDouble( ima.set(i,j,k)); double want = ((double) (t*1000 + i*100 + j*10 + k)); assert (got == want) : "got "+got+ " want "+want; } } } } System.out.println("*** ok reading doRead4Volume for "+varName); }
private void doRead3Volume( GridDataset ds, String varName) throws IOException { GeoGrid gg = ds.findGridByName( varName); CoordinateAxis1D timeAxis = gg.getCoordinateSystem().getTimeAxis1D(); int[] w = getWeights( gg); for (int t=0; t<timeAxis.getSize(); t++) { Array aa = gg.readVolumeData(t); int[] shape = aa.getShape(); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { double got = aa.getDouble( ima.set(i,j)); double want = ((double) (t*1000 + i*w[1] + j*w[2])); assert (got == want) : "got "+got+ " want "+want; } } } System.out.println("*** ok reading doRead3Volume for "+varName); }
private void doRead3Volume( GridDataset ds, String varName) throws IOException { GeoGrid gg = ds.findGridByName( varName); CoordinateAxis1D timeAxis = gg.getCoordinateSystem().getTimeAxis1D(); int[] w = getWeights( gg); for (int t=0; t<timeAxis.getSize(); t++) { Array aa = gg.readVolumeData(t); int[] shape = aa.getShape(); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { double got = aa.getDouble( ima.set(i,j)); double want = ((double) (t*1000 + i*w[1] + j*w[2])); assert (got == want) : "got "+got+ " want "+want; } } } System.out.println("*** ok reading doRead3Volume for "+varName); }
private void doRead3Volume( GridDataset ds, String varName) throws IOException { GeoGrid gg = ds.findGridByName( varName); CoordinateAxis1D timeAxis = gg.getCoordinateSystem().getTimeAxis1D(); int[] w = getWeights( gg); for (int t=0; t<timeAxis.getSize(); t++) { Array aa = gg.readVolumeData(t); int[] shape = aa.getShape(); Index ima = aa.getIndex(); for (int i=0; i<shape[0]; i++) { for (int j=0; j<shape[1]; j++) { double got = aa.getDouble( ima.set(i,j)); double want = ((double) (t*1000 + i*w[1] + j*w[2])); assert (got == want) : "got "+got+ " want "+want; } } } System.out.println("*** ok reading doRead3Volume for "+varName); }
Array data = grid_section.readVolumeData(1); assert data != null; assert data.getRank() == 2;