Unidata / netcdf-java

The Unidata netcdf-java library
https://docs.unidata.ucar.edu/netcdf-java/current/userguide/index.html
BSD 3-Clause "New" or "Revised" License
142 stars 69 forks source link

Fix canonical order of coverage axes #1228

Closed tdrwenski closed 1 year ago

tdrwenski commented 1 year ago

Description of Changes

This resolves https://github.com/Unidata/netcdf-java/issues/1220

Coverages with both a time and an ensemble axis do not work due to a mismatch in the canonical order canonical order: (rt, e, t, z, y, x) used in DTCoverage::calcPermuteIndex() and the sort order for the AxisType enums used for ordering the CoordinateAxes in the coverage coordinate system. This would cause errors upon reading/writing due to index out of bounds.

This PR would use the canonical order: (rt, e, t, z, y, x) for the AxisType enum as well. There is a comment saying not to change the enum order due to its use in protobuf messages. The only proto that I see this used in is the cdmrFeature.proto which actually has the order I just updated AxisType to have. It seems that cmdrFeature is removed in TDS and so I am not sure how important it is to test that.

Additional TDS tests added in https://github.com/Unidata/tds/pull/411.

PR Checklist

tdrwenski commented 1 year ago

Two grib coverage tests failing on Jenkins: https://jenkins-aws.unidata.ucar.edu/view/Users/job/tara-netcdf-java/22/testReport/junit/

tdrwenski commented 1 year ago

Jenkins tests passing: https://jenkins-aws.unidata.ucar.edu/view/Users/job/tara-netcdf-java/23/ after fix for coverage axes sort order when the coverage is grib 2b67152