Skip to content

Commit

Permalink
Fix issue that missing values in a grib runtime axis would prevent al…
Browse files Browse the repository at this point in the history
…l times after from being read due to axis being marked regular
  • Loading branch information
tdrwenski committed Mar 5, 2024
1 parent 839d7c2 commit 8fab7bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ public CoverageCoordAxisBuilder setDependsOn(String dependsOn) {
// for point: values are the points, values[npts]
// for intervals: values are the edges, values[2*npts]: low0, high0, low1, high1

public void setMissingTolerance(double tolerance) {
missingTolerance = tolerance;
}

public void setSpacingFromValues(boolean isInterval) {
if (isInterval) {
setSpacingFromIntervalValues();
Expand Down Expand Up @@ -227,7 +231,7 @@ private void setSpacingFromIntervalValues() {
}
}

private static final double missingTolerance = .05;
private double missingTolerance = .05;

private boolean isRegular(Counters.Counter resol) {
if (resol.getUnique() == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ private CoverageCoordAxis makeRuntimeAuxCoord(CoordinateTimeAbstract time) {
CoverageCoordAxisBuilder builder =
new CoverageCoordAxisBuilder(refName, master.getUnit(), Grib.GRIB_RUNTIME, DataType.DOUBLE, AxisType.RunTime,
atts, CoverageCoordAxis.DependenceType.dependent, time.getName(), null, length, 0, 0, 0, data, this);
builder.setMissingTolerance(0.0);
builder.setSpacingFromValues(false);

return new CoverageCoordAxis1D(builder);
Expand Down

0 comments on commit 8fab7bf

Please sign in to comment.