|
26 | 26 | import fr.jmmc.oitools.meta.Units; |
27 | 27 | import fr.jmmc.oitools.meta.WaveColumnMeta; |
28 | 28 | import fr.jmmc.oitools.model.ModelVisitor; |
| 29 | +import fr.jmmc.oitools.model.OIData; |
29 | 30 | import fr.jmmc.oitools.model.OIFitsChecker; |
30 | 31 | import fr.jmmc.oitools.model.OITable; |
31 | 32 | import fr.jmmc.oitools.model.Rule; |
@@ -1144,9 +1145,8 @@ public final Object getMinMaxColumnValue(final String name) { |
1144 | 1145 | if (sValues == null) { |
1145 | 1146 | break; |
1146 | 1147 | } |
1147 | | - short[] sRowValues; |
1148 | 1148 | for (int i = 0, len = sValues.length; i < len; i++) { |
1149 | | - sRowValues = sValues[i]; |
| 1149 | + final short[] sRowValues = sValues[i]; |
1150 | 1150 | for (int j = 0, jlen = sRowValues.length; j < jlen; j++) { |
1151 | 1151 | if (sRowValues[j] < sMin) { |
1152 | 1152 | sMin = sRowValues[j]; |
@@ -1182,9 +1182,8 @@ public final Object getMinMaxColumnValue(final String name) { |
1182 | 1182 | if (iValues == null) { |
1183 | 1183 | break; |
1184 | 1184 | } |
1185 | | - int[] iRowValues; |
1186 | 1185 | for (int i = 0, len = iValues.length; i < len; i++) { |
1187 | | - iRowValues = iValues[i]; |
| 1186 | + final int[] iRowValues = iValues[i]; |
1188 | 1187 | for (int j = 0, jlen = iRowValues.length; j < jlen; j++) { |
1189 | 1188 | if (iRowValues[j] < iMin) { |
1190 | 1189 | iMin = iRowValues[j]; |
@@ -1220,15 +1219,21 @@ public final Object getMinMaxColumnValue(final String name) { |
1220 | 1219 | if (dValues == null) { |
1221 | 1220 | break; |
1222 | 1221 | } |
1223 | | - double[] dRowValues; |
| 1222 | + // use column flag if present (OIData tables): |
| 1223 | + final boolean[][] flags = (this instanceof OIData) ? ((OIData)this).getFlag(): null; |
| 1224 | + |
1224 | 1225 | for (int i = 0, len = dValues.length; i < len; i++) { |
1225 | | - dRowValues = dValues[i]; |
| 1226 | + final double[] dRowValues = dValues[i]; |
| 1227 | + final boolean[] rowFlags = (flags != null) ? flags[i] : null; |
| 1228 | + |
1226 | 1229 | for (int j = 0, jlen = dRowValues.length; j < jlen; j++) { |
1227 | | - if (dRowValues[j] < dMin) { |
1228 | | - dMin = dRowValues[j]; |
1229 | | - } |
1230 | | - if (dRowValues[j] > dMax) { |
1231 | | - dMax = dRowValues[j]; |
| 1230 | + if ((rowFlags == null) || !rowFlags[j]) { |
| 1231 | + if (dRowValues[j] < dMin) { |
| 1232 | + dMin = dRowValues[j]; |
| 1233 | + } |
| 1234 | + if (dRowValues[j] > dMax) { |
| 1235 | + dMax = dRowValues[j]; |
| 1236 | + } |
1232 | 1237 | } |
1233 | 1238 | } |
1234 | 1239 | } |
@@ -1371,7 +1376,9 @@ public void checkColumns(final OIFitsChecker checker) { |
1371 | 1376 | if (!column.isOptional()) { |
1372 | 1377 | /* No column with columnName name */ |
1373 | 1378 | // rule [GENERIC_COL_MANDATORY] check if the required column is present |
1374 | | - checker.ruleFailed(Rule.GENERIC_COL_MANDATORY, this, columnName); |
| 1379 | + if (checker != null) { |
| 1380 | + checker.ruleFailed(Rule.GENERIC_COL_MANDATORY, this, columnName); |
| 1381 | + } |
1375 | 1382 | } |
1376 | 1383 | } |
1377 | 1384 | if ((value == null) && OIFitsChecker.isInspectRules()) { |
|
0 commit comments