@@ -66,8 +66,8 @@ void compute(Configuration config, NetcdfFile reader, NetcdfFileWriter writer) t
6666 // - get variable
6767 // - get data array
6868 final int numMatches = NetCDFUtils .getDimensionLength (FiduceoConstants .MATCHUP_COUNT , reader );
69- final int [] nwpShape = new int []{1 };
70- final int [] nwpOffset = new int []{0 };
69+ final int [] nwpShape = new int []{1 , 1 , 1 };
70+ final int [] nwpOffset = new int []{0 , 0 , 0 };
7171 final Index timeIndex = targetTimeArray .getIndex ();
7272 final Set <String > variableKeys = variables .keySet ();
7373 final HashMap <String , Array > targetArrays = allocateTargetData (writer , variables );
@@ -80,8 +80,8 @@ void compute(Configuration config, NetcdfFile reader, NetcdfFileWriter writer) t
8080 for (int m = 0 ; m < numMatches ; m ++) {
8181 nwpOffset [0 ] = m ;
8282
83- final Array lonLayer = lonArray .section (nwpOffset , nwpShape ). reduce () ;
84- final Array latLayer = latArray .section (nwpOffset , nwpShape ). reduce () ;
83+ final Array lonLayer = lonArray .section (nwpOffset , nwpShape );
84+ final Array latLayer = latArray .section (nwpOffset , nwpShape );
8585
8686 final InterpolationContext interpolationContext = Era5PostProcessing .getInterpolationContext (lonLayer , latLayer );
8787 final Rectangle layerRegion = interpolationContext .getEra5Region ();
@@ -94,6 +94,7 @@ void compute(Configuration config, NetcdfFile reader, NetcdfFileWriter writer) t
9494 final int timeStamp = targetTimeArray .getInt (timeIndex );
9595 final Variable variable = variableCache .get (variableKey , timeStamp );
9696
97+ // read and get rid of fake z-dimension
9798 Array subset = variable .read (offset , shape ).reduce ();
9899 subset = NetCDFUtils .scaleIfNecessary (variable , subset );
99100 final Index subsetIndex = subset .getIndex ();
0 commit comments