@@ -125,16 +125,6 @@ public class IdepixOlciClassificationOp extends Operator {
125125
126126 private Band [] olciReflBands ;
127127
128- private Band solarFlux13Band ;
129- private Band solarFlux14Band ;
130- private Band solarFlux15Band ;
131-
132- private RasterDataNode szaBand ;
133-
134- private Band harmoRad13Band ;
135- private Band harmoRad14Band ;
136- private Band harmoRad15Band ;
137-
138128 private Band surface13Band ;
139129 private Band trans13Band ;
140130
@@ -188,15 +178,6 @@ public void initialize() throws OperatorException {
188178 initLakeSeaIceClassification ();
189179
190180 if (o2CorrProduct != null ) {
191- szaBand = l1bProduct .getRasterDataNode ("SZA" );
192-
193- solarFlux13Band = l1bProduct .getBand ("solar_flux_band_13" );
194- solarFlux14Band = l1bProduct .getBand ("solar_flux_band_14" );
195- solarFlux15Band = l1bProduct .getBand ("solar_flux_band_15" );
196-
197- harmoRad13Band = l1bProduct .getBand ("radiance_13" );
198- harmoRad14Band = l1bProduct .getBand ("radiance_14" );
199- harmoRad15Band = l1bProduct .getBand ("radiance_15" );
200181 surface13Band = o2CorrProduct .getBand ("surface_13" );
201182 trans13Band = o2CorrProduct .getBand ("trans_13" );
202183 gf = new GeometryFactory ();
@@ -300,39 +281,6 @@ public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, P
300281 trans13Tile = getSourceTile (trans13Band , rectangle );
301282 }
302283
303- Tile szaTile = null ;
304- if (szaBand != null ) {
305- szaTile = getSourceTile (szaBand , rectangle );
306- }
307-
308- Tile solarFlux13Tile = null ;
309- if (solarFlux13Band != null ) {
310- solarFlux13Tile = getSourceTile (solarFlux13Band , rectangle );
311- }
312- Tile solarFlux14Tile = null ;
313- if (solarFlux14Band != null ) {
314- solarFlux14Tile = getSourceTile (solarFlux14Band , rectangle );
315- }
316- Tile solarFlux15Tile = null ;
317- if (solarFlux15Band != null ) {
318- solarFlux15Tile = getSourceTile (solarFlux15Band , rectangle );
319- }
320-
321- Tile harmoRad13Tile = null ;
322- if (harmoRad13Band != null ) {
323- harmoRad13Tile = getSourceTile (harmoRad13Band , rectangle );
324- }
325-
326- Tile harmoRad14Tile = null ;
327- if (harmoRad14Band != null ) {
328- harmoRad14Tile = getSourceTile (harmoRad14Band , rectangle );
329- }
330-
331- Tile harmoRad15Tile = null ;
332- if (harmoRad15Band != null ) {
333- harmoRad15Tile = getSourceTile (harmoRad15Band , rectangle );
334- }
335-
336284 final Band olciQualityFlagBand = l1bProduct .getBand (IdepixOlciConstants .OLCI_QUALITY_FLAGS_BAND_NAME );
337285 final Tile olciQualityFlagTile = getSourceTile (olciQualityFlagBand , rectangle );
338286
@@ -374,16 +322,10 @@ public void computeTileStack(Map<Band, Tile> targetTiles, Rectangle rectangle, P
374322 // todo: for cglops, coastlines are treated as LAND
375323 if ((isLandFromAppliedMask && !isInlandWaterFromAppliedMask ) || isCoastlineFromAppliedMask ) {
376324 classifyOverLand (olciReflectanceTiles , cloudFlagTargetTile , nnTargetTile ,
377- surface13Tile , trans13Tile ,
378- solarFlux13Tile , solarFlux14Tile , solarFlux15Tile ,
379- harmoRad13Tile , harmoRad14Tile , harmoRad15Tile ,
380- szaTile , x , y );
325+ surface13Tile , trans13Tile , x , y );
381326 } else {
382327 classifyOverWater (olciQualityFlagTile , olciReflectanceTiles ,
383- cloudFlagTargetTile , nnTargetTile ,
384- solarFlux13Tile , solarFlux14Tile , solarFlux15Tile ,
385- harmoRad13Tile , harmoRad14Tile , harmoRad15Tile ,
386- szaTile , x , y , isInlandWaterFromAppliedMask );
328+ cloudFlagTargetTile , nnTargetTile , x , y , isInlandWaterFromAppliedMask );
387329 }
388330 }
389331 }
@@ -399,16 +341,10 @@ private boolean classifyCoastline(Tile olciQualityFlagTile, int x, int y, int wa
399341 }
400342
401343 private void classifyOverWater (Tile olciQualityFlagTile , Tile [] olciReflectanceTiles ,
402- Tile cloudFlagTargetTile , Tile nnTargetTile ,
403- Tile solarFlux13Tile , Tile solarFlux14Tile , Tile solarFlux15Tile ,
404- Tile harmoRad13Tile , Tile harmoRad14Tile , Tile harmoRad15Tile ,
405- Tile szaTile , int x , int y , boolean isInlandWater ) {
406-
407- final double [] o2HarmoRefls = getO2HarmoReflectances (solarFlux13Tile , solarFlux14Tile , solarFlux15Tile ,
408- harmoRad13Tile , harmoRad14Tile , harmoRad15Tile , szaTile , x , y );
344+ Tile cloudFlagTargetTile , Tile nnTargetTile , int x , int y , boolean isInlandWater ) {
409345
410- final double nnOutput = getOlciNNOutput (x , y , olciReflectanceTiles , o2HarmoRefls );
411346
347+ double nnOutput = getOlciNNOutput (x , y , olciReflectanceTiles );
412348 if (!cloudFlagTargetTile .getSampleBit (x , y , IdepixConstants .IDEPIX_INVALID )) {
413349 cloudFlagTargetTile .setSample (x , y , IdepixConstants .IDEPIX_CLOUD_AMBIGUOUS , false );
414350 cloudFlagTargetTile .setSample (x , y , IdepixConstants .IDEPIX_CLOUD_SURE , false );
@@ -458,14 +394,9 @@ private void classifyOverWater(Tile olciQualityFlagTile, Tile[] olciReflectanceT
458394 private void classifyOverLand (Tile [] olciReflectanceTiles ,
459395 Tile cloudFlagTargetTile , Tile nnTargetTile ,
460396 Tile surface13Tile , Tile trans13Tile ,
461- Tile solarFlux13Tile , Tile solarFlux14Tile , Tile solarFlux15Tile ,
462- Tile harmoRad13Tile , Tile harmoRad14Tile , Tile harmoRad15Tile ,
463- Tile szaTile , int x , int y ) {
397+ int x , int y ) {
464398
465- final double [] o2HarmoRefls = getO2HarmoReflectances (solarFlux13Tile , solarFlux14Tile , solarFlux15Tile ,
466- harmoRad13Tile , harmoRad14Tile , harmoRad15Tile , szaTile , x , y );
467-
468- final double nnOutput = getOlciNNOutput (x , y , olciReflectanceTiles , o2HarmoRefls );
399+ final double nnOutput = getOlciNNOutput (x , y , olciReflectanceTiles );
469400
470401 if (!cloudFlagTargetTile .getSampleBit (x , y , IdepixConstants .IDEPIX_INVALID )) {
471402 cloudFlagTargetTile .setSample (x , y , IdepixConstants .IDEPIX_CLOUD_AMBIGUOUS , false );
@@ -524,32 +455,6 @@ private void classifyOverLand(Tile[] olciReflectanceTiles,
524455 }
525456 }
526457
527- private static double [] getO2HarmoReflectances (Tile solarFlux13Tile , Tile solarFlux14Tile , Tile solarFlux15Tile , Tile harmoRad13Tile , Tile harmoRad14Tile , Tile harmoRad15Tile , Tile szaTile , int x , int y ) {
528- float sza ;
529- float sf13 ;
530- float sf14 ;
531- float sf15 ;
532- float harmoRad13 ;
533- float harmoRad14 ;
534- float harmoRad15 ;
535- if (szaTile != null && solarFlux13Tile != null && solarFlux14Tile != null && solarFlux15Tile != null &&
536- harmoRad13Tile != null && harmoRad14Tile != null && harmoRad15Tile != null ) {
537- sza = szaTile .getSampleFloat (x , y );
538- sf13 = solarFlux13Tile .getSampleFloat (x , y );
539- sf14 = solarFlux14Tile .getSampleFloat (x , y );
540- sf15 = solarFlux15Tile .getSampleFloat (x , y );
541- harmoRad13 = harmoRad13Tile .getSampleFloat (x , y );
542- harmoRad14 = harmoRad14Tile .getSampleFloat (x , y );
543- harmoRad15 = harmoRad15Tile .getSampleFloat (x , y );
544-
545- final double harmoRefl13 = RsMathUtils .radianceToReflectance (harmoRad13 , sza , sf13 );
546- final double harmoRefl14 = RsMathUtils .radianceToReflectance (harmoRad14 , sza , sf14 );
547- final double harmoRefl15 = RsMathUtils .radianceToReflectance (harmoRad15 , sza , sf15 );
548- return new double []{harmoRefl13 , harmoRefl14 , harmoRefl15 };
549- }
550- return null ;
551- }
552-
553458 private boolean isOlciLandPixel (int x , int y , Tile olciL1bFlagTile , int waterFraction ) {
554459 if (waterFraction < 0 ) {
555460 boolean landFlag = olciL1bFlagTile .getSampleBit (x , y , IdepixOlciConstants .L1_F_LAND );
@@ -597,7 +502,7 @@ private boolean isOlciInlandWaterPixel(int x, int y, Tile olciL1bFlagTile, int w
597502 }
598503 }
599504
600- private double getOlciNNOutput (int x , int y , Tile [] rhoToaTiles , double [] o2HarmoRefls ) {
505+ private double getOlciNNOutput (int x , int y , Tile [] rhoToaTiles ) {
601506 SchillerNeuralNetWrapper nnWrapper ;
602507 try {
603508 nnWrapper = olciAllNeuralNet .get ();
@@ -608,11 +513,6 @@ private double getOlciNNOutput(int x, int y, Tile[] rhoToaTiles, double[] o2Harm
608513 for (int i = 0 ; i < nnInput .length ; i ++) {
609514 nnInput [i ] = Math .sqrt (rhoToaTiles [i ].getSampleFloat (x , y ));
610515 }
611- if (o2HarmoRefls != null ) {
612- for (int i = 0 ; i < 3 ; i ++) {
613- nnInput [i + 12 ] = Math .sqrt (o2HarmoRefls [i ]);
614- }
615- }
616516 return nnWrapper .getNeuralNet ().calc (nnInput )[0 ];
617517 }
618518
0 commit comments