bcdev / snap-idepix

Collection of IdePix pixel classification modules for various sensors
GNU General Public License v3.0
4 stars 1 forks source link

New Cirrus definition for S2 IdePix #61

Closed JanWev closed 1 year ago

JanWev commented 2 years ago

We urgently need to adapt the current cirrus mask, which is using elevation. Currently this is cutting all cirrus masks above 2000m, which is not the best solution. I found a solution based on the approach by Baeten et al.

B10 > threshold + (threshold * exp(elevation/1000))

I also realized that something got lost during the transfer to JAVA back in the days. „cw“ (Cirrus over Water) and „cl“ (Cirrus over Land), have been bound to a water difinition, like the names indicate. I have added this in the adapted code below. Without this criterion the two thresholds do not makle any sense.

Nevertheless, some water experts form GeoInfo shall take a look.

In detail that means: https://github.com/bcdev/snap-idepix/blob/master/idepix-s2msi/src/main/java/org/esa/snap/idepix/s2msi/S2IdepixOp.java cwThresh = 0.0035 (line 107) clThrsh = 0.0035 (line 119)

https://github.com/bcdev/snap-idepix/blob/master/idepix-s2msi/src/main/java/org/esa/snap/idepix/s2msi/S2IdepixAlgorithm.java Lines 96-98: public boolean isCirrus() { final boolean cw = refl[10] > cwThresh + cwThresh (elevation/1000)^2 && isB3B11Water(); final boolean cl = refl[10] > clThresh + clThresh (elevation/1000)^2 && !isB3B11Water();

CLA_THRESH = 0.001 (Line 61)

Lines 105-106: public boolean isCirrusAmbiguous() { final boolean cla = refl[10] > CLA_THRESH + CLA_THRESH * (elevation/1000)^2;

This is based on findings from January 2021. Therefore the location in code might have changed.

marpet commented 1 year ago

New expressions are: isCirrus = B10 > 0.007 + (0.007 exp(elevation/1000)) isCirrusAmbiguous = B10 > 0.004 + (0.004 exp(elevation/1000))