Skip to content

Commit 179beca

Browse files
committed
Merge branches 'renovation' and 'master' of https://github.com/bcdev/snap-idepix
2 parents aa6904e + c334eef commit 179beca

File tree

20 files changed

+154
-219
lines changed

20 files changed

+154
-219
lines changed

idepix-avhrr/src/main/nbm/manifest.mf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ OpenIDE-Module-Display-Category: SNAP Supported Plugins
66
OpenIDE-Module-Specification-Version: 7.0.0
77
OpenIDE-Module-Long-Description: <p>Classification of pixels (cloud, snow, ice, land, water) originating from AVHRR.</p>
88
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
9-
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (
10-
Germany)</p><p><b>Copyright:</b> (C) 2014 by Brockmann Consult GmbH</
11-
p><p><b>Vendor:</b> Brockmann Consult GmbH</p><p><b>License:</b> http
12-
://www.gnu.org/licenses/gpl.html</p>
9+
<p><b>Release notes:</b> <a href="https://github.com/bcdev/snap-idepix/releases">Release notes on GitHub</a>
10+
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (Germany)</p>
11+
<p><b>Copyright:</b> (C) 2014 by Brockmann Consult GmbH</p>
12+
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
13+
<p><b>License:</b> <a href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3</a></p>
1314
OpenIDE-Module-Layer: layer.xml

idepix-core/src/main/java/org/esa/snap/idepix/core/util/IdepixIO.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ private static boolean isIdepixSpectralBand(Band b) {
176176
b.getName().startsWith("brr") || b.getName().startsWith("rho_toa");
177177
}
178178

179+
// TODO (mp:2022-01-13) - This should be specifcally implemented in the modules.
180+
// For example AVHRR and AATSR are not valid inputs. Because we have disabled it.
181+
// Also in addition it is strange if the OLCI IdePix states that L8 and Proba-V are valid.
179182
private static boolean isInputValid(Product inputProduct) {
180183
if (!isValidAvhrrProduct(inputProduct) &&
181184
!isValidLandsat8Product(inputProduct) &&

idepix-core/src/main/javahelp/org/esa/snap/idepix/core/docs/core/IdepixTool.html

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,43 @@ <h3>Introduction</h3>
8585

8686
<br>
8787
IdePix is continuously being improved for already supported sensors and extended for further sensors in the frame
88-
of various projects, such as the ESA LandCover ([1],[2]) and OceanColour ([3]) CCI projects.
88+
of various projects, such as the ESA LandCover ([1]) and OceanColour ([2]) CCI projects.
8989

9090
<br>
9191

9292
<h3>References</h3>
9393

9494
<p class="i1">
9595

96-
<b>[1]</b>
97-
LandCover Project Web Site: <a href="http://www.esa-landcover-cci.org/">www.esa-landcover-cci.org</a><br><br>
96+
<b>[1]</b> LandCover Project Web Site<br>
97+
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
98+
<param name="content" value="http://www.esa-landcover-cci.org">
99+
<param name="text" value="<html><u>http://www.esa-landcover-cci.org</u></html>">
100+
<param name="textFontSize" value="bigger">
101+
</object>
102+
103+
<b>[2]</b> OceanColour Project Web Site:<br>
104+
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
105+
<param name="content" value="http://www.esa-oceancolour-cci.org">
106+
<param name="text" value="<html><u>http://www.esa-oceancolour-cci.org</u></html>">
107+
<param name="textFontSize" value="bigger">
108+
</object>
109+
110+
<b>[3]</b> LandCover CCI ATBD Pre-processing<br>
111+
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
112+
<param name="content" value="https://www.esa-landcover-cci.org/?q=webfm_send/136">
113+
<param name="text" value="<html><u>LC-CCI ATBD Pre-processing</u></html>">
114+
<param name="textFontSize" value="bigger">
115+
</object>
116+
117+
<b>[3]</b> IdePix Release Notes<br>
118+
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
119+
<param name="content" value="https://github.com/bcdev/snap-idepix/releases">
120+
<param name="text" value="<html><u>Release notes on GitHub</u></html>">
121+
<param name="textFontSize" value="bigger">
122+
</object>
98123

99-
<b>[2]</b>
100-
LandCover CCI ATBD. Version 1.0, 28 June 2012.<br><br>
101124

102-
<b>[3]</b>
103-
OceanColour Project Web Site: <a href="http://www.esa-oceancolour-cci.org/">www.esa-oceancolour-cci.org</a><br><br>
104125
</p>
105126
<br>
106127

idepix-core/src/main/nbm/manifest.mf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ OpenIDE-Module-Java-Dependencies: Java > 1.8
55
OpenIDE-Module-Display-Category: SNAP Supported Plugins
66
OpenIDE-Module-Long-Description: <p>Core Functionality for generic classification of pixels (cloud, snow, ice, land, water) originating from optical sensors.</p>
77
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
8-
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (
9-
Germany)</p><p><b>Copyright:</b> (C) 2014 by Brockmann Consult GmbH</
10-
p><p><b>Vendor:</b> Brockmann Consult GmbH</p><p><b>License:</b> http
11-
://www.gnu.org/licenses/gpl.html</p>
8+
<p><b>Release notes:</b> <a href="https://github.com/bcdev/snap-idepix/releases">Release notes on GitHub</a>
9+
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (Germany)</p>
10+
<p><b>Copyright:</b> (C) 2014 by Brockmann Consult GmbH</p>
11+
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
12+
<p><b>License:</b> <a href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3</a></p>
1213
OpenIDE-Module-Layer: layer.xml

idepix-landsat8/src/main/nbm/manifest.mf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ OpenIDE-Module-Java-Dependencies: Java > 1.8
55
OpenIDE-Module-Display-Category: SNAP Supported Plugins
66
OpenIDE-Module-Long-Description: <p>Classification of pixels (cloud, snow, ice, land, water) originating from Landsat 8</p>
77
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
8-
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (
9-
Germany)</p><p><b>Copyright:</b> (C) 2017 by Brockmann Consult GmbH</
10-
p><p><b>Vendor:</b> Brockmann Consult GmbH</p><p><b>License:</b> http
11-
://www.gnu.org/licenses/gpl.html</p>
8+
<p><b>Release notes:</b> <a href="https://github.com/bcdev/snap-idepix/releases">Release notes on GitHub</a>
9+
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (Germany)</p>
10+
<p><b>Copyright:</b> (C) 2017 by Brockmann Consult GmbH</p>
11+
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
12+
<p><b>License:</b> <a href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3</a></p>
1213
OpenIDE-Module-Layer: layer.xml

idepix-meris/src/main/nbm/manifest.mf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ OpenIDE-Module-Java-Dependencies: Java > 1.8
55
OpenIDE-Module-Display-Category: SNAP Supported Plugins
66
OpenIDE-Module-Long-Description: <p>Classification of pixels (cloud, snow, ice, land, water) originating from MERIS</p>
77
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
8-
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (
9-
Germany)</p><p><b>Copyright:</b> (C) 2017 by Brockmann Consult GmbH</
10-
p><p><b>Vendor:</b> Brockmann Consult GmbH</p><p><b>License:</b> http
11-
://www.gnu.org/licenses/gpl.html</p>
8+
<p><b>Release notes:</b> <a href="https://github.com/bcdev/snap-idepix/releases">Release notes on GitHub</a>
9+
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (Germany)</p>
10+
<p><b>Copyright:</b> (C) 2017 by Brockmann Consult GmbH</p>
11+
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
12+
<p><b>License:</b> <a href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3</a></p>
1213
OpenIDE-Module-Layer: layer.xml
1314

idepix-modis/src/main/nbm/manifest.mf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ OpenIDE-Module-Java-Dependencies: Java > 1.8
55
OpenIDE-Module-Display-Category: SNAP Supported Plugins
66
OpenIDE-Module-Long-Description: <p>Classification of pixels (cloud, snow, ice, land, water) originating from MODIS</p>
77
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
8-
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (
9-
Germany)</p><p><b>Copyright:</b> (C) 2017 by Brockmann Consult GmbH</
10-
p><p><b>Vendor:</b> Brockmann Consult GmbH</p><p><b>License:</b> http
11-
://www.gnu.org/licenses/gpl.html</p>
8+
<p><b>Release notes:</b> <a href="https://github.com/bcdev/snap-idepix/releases">Release notes on GitHub</a>
9+
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (Germany)</p>
10+
<p><b>Copyright:</b> (C) 2017 by Brockmann Consult GmbH</p>
11+
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
12+
<p><b>License:</b> <a href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3</a></p>
1213
OpenIDE-Module-Layer: layer.xml
1314

idepix-olci/src/main/nbm/manifest.mf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ OpenIDE-Module-Java-Dependencies: Java > 1.8
55
OpenIDE-Module-Display-Category: SNAP Supported Plugins
66
OpenIDE-Module-Long-Description: <p>Classification of pixels (cloud, snow, ice, land, water) originating from OLCI</p>
77
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
8-
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (
9-
Germany)</p><p><b>Copyright:</b> (C) 2017 by Brockmann Consult GmbH</
10-
p><p><b>Vendor:</b> Brockmann Consult GmbH</p><p><b>License:</b> http
11-
://www.gnu.org/licenses/gpl.html</p>
8+
<p><b>Release notes:</b> <a href="https://github.com/bcdev/snap-idepix/releases">Release notes on GitHub</a>
9+
<p><b>Contact address:</b> Chrysanderstr. 1, 21029 Hamburg (Germany)</p>
10+
<p><b>Copyright:</b> (C) 2017 by Brockmann Consult GmbH</p>
11+
<p><b>Vendor:</b> Brockmann Consult GmbH</p>
12+
<p><b>License:</b> <a href="http://www.gnu.org/licenses/gpl-3.0.html">GPLv3</a></p>
1213
OpenIDE-Module-Layer: layer.xml
1314

idepix-olcislstr/src/main/java/org/esa/snap/idepix/olcislstr/OlciSlstrClassificationOp.java

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ public class OlciSlstrClassificationOp extends Operator {
4545
@SourceProduct(alias = "reflOlci")
4646
private Product olciRad2reflProduct;
4747

48-
@SourceProduct(alias = "reflSlstr")
49-
private Product slstrRad2reflProduct;
50-
5148
@SourceProduct(alias = "waterMask")
5249
private Product waterMaskProduct;
5350

@@ -58,11 +55,9 @@ public class OlciSlstrClassificationOp extends Operator {
5855
Band cloudFlagBand;
5956

6057
private Band[] olciReflBands;
61-
private Band[] slstrReflBands;
6258

6359
private Band landWaterBand;
6460

65-
// public static final String OLCISLSTR_ALL_NET_NAME = "11x9x6x4x3x2_57.8.net";
6661
public static final String OLCISLSTR_ALL_NET_NAME = "11x10x4x3x2_207.9.net";
6762

6863
private static final double THRESH_LAND_MINBRIGHT1 = 0.3;
@@ -94,16 +89,6 @@ public void setBands() {
9489
olciReflBands[i] = olciRad2reflProduct.getBand(reflBandname + "_reflectance");
9590
}
9691

97-
// e.g. S4_reflectance_an
98-
//make sure that these are all *_an bands, as the NN uses only these
99-
slstrReflBands = new Band[OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES.length];
100-
for (int i = 0; i < OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES.length; i++) {
101-
final int suffixStart = OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES[i].indexOf("_");
102-
final String reflBandname = OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES[i].substring(0, suffixStart);
103-
final int length = OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES[i].length();
104-
slstrReflBands[i] = slstrRad2reflProduct.getBand(reflBandname + "_reflectance_an");
105-
}
106-
10792
landWaterBand = waterMaskProduct.getBand("land_water_fraction");
10893
}
10994

@@ -124,7 +109,7 @@ void createTargetProduct() throws OperatorException {
124109
ProductUtils.copyGeoCoding(sourceProduct, targetProduct);
125110
targetProduct.setStartTime(sourceProduct.getStartTime());
126111
targetProduct.setEndTime(sourceProduct.getEndTime());
127-
ProductUtils.copyMetadata(sourceProduct, targetProduct);
112+
// ProductUtils.copyMetadata(sourceProduct, targetProduct);
128113

129114
if (outputSchillerNNValue) {
130115
final Band nnValueBand = targetProduct.addBand(IdepixConstants.NN_OUTPUT_BAND_NAME, ProductData.TYPE_FLOAT32);
@@ -141,18 +126,15 @@ public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, P
141126
final Band olciQualityFlagBand = sourceProduct.getBand(OlciSlstrConstants.OLCI_QUALITY_FLAGS_BAND_NAME);
142127
final Tile olciQualityFlagTile = getSourceTile(olciQualityFlagBand, rectangle);
143128

129+
final Band slstrCloudAnFlagBand = sourceProduct.getBand(OlciSlstrConstants.SLSTR_CLOUD_AN_FLAG_BAND_NAME);
130+
final Tile slstrCloudAnFlagTile = getSourceTile(slstrCloudAnFlagBand, rectangle);
131+
144132
Tile[] olciReflectanceTiles = new Tile[Rad2ReflConstants.OLCI_REFL_BAND_NAMES.length];
145133
float[] olciReflectance = new float[Rad2ReflConstants.OLCI_REFL_BAND_NAMES.length];
146134
for (int i = 0; i < Rad2ReflConstants.OLCI_REFL_BAND_NAMES.length; i++) {
147135
olciReflectanceTiles[i] = getSourceTile(olciReflBands[i], rectangle);
148136
}
149137

150-
Tile[] slstrReflectanceTiles = new Tile[OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES.length];
151-
float[] slstrReflectance = new float[OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES.length];
152-
for (int i = 0; i < OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES.length; i++) {
153-
slstrReflectanceTiles[i] = getSourceTile(slstrReflBands[i], rectangle);
154-
}
155-
156138
final Band cloudFlagTargetBand = targetProduct.getBand(IdepixConstants.CLASSIF_BAND_NAME);
157139
final Tile cloudFlagTargetTile = targetTiles.get(cloudFlagTargetBand);
158140

@@ -177,24 +159,18 @@ public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, P
177159
olciReflectance[i] = olciReflectanceTiles[i].getSampleFloat(x, y);
178160
}
179161

180-
for (int i = 0; i < OlciSlstrConstants.SLSTR_REFL_AN_BAND_NAMES.length; i++) {
181-
slstrReflectance[i] = slstrReflectanceTiles[i].getSampleFloat(x, y);
182-
}
183-
184162
final boolean l1Invalid = olciQualityFlagTile.getSampleBit(x, y, OlciSlstrConstants.L1_F_INVALID);
185163
boolean reflectancesValid = IdepixIO.areAllReflectancesValid(olciReflectance);
186-
reflectancesValid &= IdepixIO.areAllReflectancesValid(slstrReflectance);
187164
cloudFlagTargetTile.setSample(x, y, IdepixConstants.IDEPIX_INVALID, l1Invalid || !reflectancesValid);
188165

166+
final boolean isSlstrCloudAn137Thresh =
167+
slstrCloudAnFlagTile.getSampleBit(x, y, OlciSlstrConstants.CLOUD_AN_F_137_THRESH);
168+
final boolean isSlstrCloudAnGrossCloud =
169+
slstrCloudAnFlagTile.getSampleBit(x, y, OlciSlstrConstants.CLOUD_AN_F_GROSS_CLOUD);
170+
189171
if (reflectancesValid) {
190172
SchillerNeuralNetWrapper nnWrapper = olciSlstrAllNeuralNet.get();
191173
double[] inputVector = nnWrapper.getInputVector();
192-
// for (int i = 0; i < inputVector.length - 6; i++) {
193-
// inputVector[i] = Math.sqrt(olciReflectance[i]);
194-
// }
195-
// for (int i = inputVector.length - slstrReflectance.length; i < inputVector.length; i++) {
196-
// inputVector[i] = Math.sqrt(slstrReflectance[i - olciReflectance.length]);
197-
// }
198174
// use OLCI net instead of OLCI/SLSTR net:
199175
for (int i = 0; i < inputVector.length; i++) {
200176
inputVector[i] = Math.sqrt(olciReflectance[i]);
@@ -216,7 +192,11 @@ public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, P
216192

217193
cloudFlagTargetTile.setSample(x, y, IdepixConstants.IDEPIX_CLOUD_AMBIGUOUS, cloudAmbiguous);
218194
cloudFlagTargetTile.setSample(x, y, IdepixConstants.IDEPIX_CLOUD_SURE, cloudSure);
195+
// request RQ, GK, 20220111:
196+
final boolean isSynCloud = cloudAmbiguous || cloudSure || isSlstrCloudAn137Thresh ||
197+
isSlstrCloudAnGrossCloud;
219198
cloudFlagTargetTile.setSample(x, y, IdepixConstants.IDEPIX_CLOUD, cloudAmbiguous || cloudSure);
199+
cloudFlagTargetTile.setSample(x, y, IdepixConstants.IDEPIX_CLOUD, isSynCloud);
220200
cloudFlagTargetTile.setSample(x, y, IdepixConstants.IDEPIX_SNOW_ICE, nnInterpreter.isSnowIce(nnOutput));
221201
}
222202

idepix-olcislstr/src/main/java/org/esa/snap/idepix/olcislstr/OlciSlstrConstants.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ class OlciSlstrConstants {
1212
static final int L1_F_INVALID = 25;
1313
// static final int L1_F_GLINT = 22;
1414

15-
static final String OLCI_QUALITY_FLAGS_BAND_NAME = "quality_flags";
15+
/* SLSTR Cloud AN Flags Positions */
16+
static final int CLOUD_AN_F_137_THRESH = 1;
17+
static final int CLOUD_AN_F_GROSS_CLOUD = 7;
1618

17-
final static String[] SLSTR_REFL_AN_BAND_NAMES = new String[]{
18-
"S1_reflectance_an", "S2_reflectance_an", "S3_reflectance_an",
19-
"S4_reflectance_an", "S5_reflectance_an", "S6_reflectance_an"
20-
};
19+
static final String OLCI_QUALITY_FLAGS_BAND_NAME = "quality_flags";
20+
static final String SLSTR_CLOUD_AN_FLAG_BAND_NAME = "cloud_an";
2121

2222
// todo: RENOVATION: code duplication, move to core
2323
static final double[] referencePressureLevels = {

0 commit comments

Comments
 (0)