Skip to content

Commit b4a7072

Browse files
committed
Idepix OLCI: adapted retrieval of resolution by product type to latest SNAP ProductUtils
1 parent 5bb7ba3 commit b4a7072

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

idepix-olci/src/main/java/org/esa/snap/idepix/olci/IdepixOlciUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ private static double getHeightFromCtp(double ctp, double p0, double ts) {
250250

251251
static boolean isReducedResolution(Product sourceProduct) {
252252
// return sourceProduct.getName().matches("S3.?_OL_1_.*RR_.*.SEN3");
253-
// less strict to allow subsets:
254-
return sourceProduct.getProductType().endsWith("RR");
253+
// less strict to allow subsets, adapted to definition in ProductUtils::
254+
return sourceProduct.getProductType().contains("OL_1_ERR");
255255
}
256256

257257
static boolean isFullResolution(Product sourceProduct) {
258258
// return sourceProduct.getName().matches("S3.?_OL_1_.*FR_.*.SEN3");
259-
// less strict to allow subsets:
260-
return sourceProduct.getProductType().endsWith("FR");
259+
// less strict to allow subsets, adapted to definition in ProductUtils:
260+
return sourceProduct.getProductType().contains("OL_1_EFR");
261261
}
262262

263263
static float[] interpolateViewAngles(PolynomialFitter curveFitter1, PolynomialFitter curveFitter2,

idepix-olci/src/test/java/org/esa/snap/idepix/olci/IdepixOlciUtilsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,19 @@ public void testGetMonthFromStartStopTime() throws ParseException {
252252

253253
@Test
254254
public void testIsReducedResolution() {
255-
Product testProduct = new Product("S3B_OL_1_EFR____blabla.SEN3", "test_FR", 1, 1);
255+
Product testProduct = new Product("S3B_OL_1_EFR____blabla.SEN3", "OL_1_EFR", 1, 1);
256256
assertFalse(IdepixOlciUtils.isReducedResolution(testProduct));
257257

258-
testProduct = new Product("S3B_OL_1_ERR____blabla.SEN3", "test_RR", 1, 1);
258+
testProduct = new Product("S3B_OL_1_ERR____blabla.SEN3", "OL_1_ERR", 1, 1);
259259
assertTrue(IdepixOlciUtils.isReducedResolution(testProduct));
260260
}
261261

262262
@Test
263263
public void testIsFullResolution() {
264-
Product testProduct = new Product("S3B_OL_1_EFR____blabla.SEN3", "test_FR", 1, 1);
264+
Product testProduct = new Product("S3B_OL_1_EFR____blabla.SEN3", "Derived from (OL_1_EFR)", 1, 1);
265265
assertTrue(IdepixOlciUtils.isFullResolution(testProduct));
266266

267-
testProduct = new Product("S3B_OL_1_ERR____blabla.SEN3", "test_RR", 1, 1);
267+
testProduct = new Product("S3B_OL_1_ERR____blabla.SEN3", "Derived from (OL_1_ERR)", 1, 1);
268268
assertFalse(IdepixOlciUtils.isFullResolution(testProduct));
269269
}
270270
}

0 commit comments

Comments
 (0)