We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2046707 commit 011ed19Copy full SHA for 011ed19
1 file changed
cdm/core/src/main/java/ucar/nc2/dataset/CoordinateAxis1D.java
@@ -972,10 +972,18 @@ private boolean makeBoundsFromAux() {
972
private void makeEdges() {
973
int size = (int) getSize();
974
edge = new double[size + 1];
975
- if (size < 1)
+ if (size < 1) {
976
return;
977
- for (int i = 1; i < size; i++)
+ }
978
+ if (size == 1) {
979
+ // if the axis size is one, edges are the same as the coord
980
+ edge[0] = coords[0];
981
+ edge[1] = coords[0];
982
+ return;
983
984
+ for (int i = 1; i < size; i++) {
985
edge[i] = (coords[i - 1] + coords[i]) / 2;
986
987
edge[0] = coords[0] - (edge[1] - coords[0]);
988
edge[size] = coords[size - 1] + (coords[size - 1] - edge[size - 1]);
989
isContiguous = true;
0 commit comments