Hi Gwin,
actually I do mask the data at the pixel level.
I apply the algorithm by command mode, and I mask the data as on example 3:
; initialize the result (new band data chlor_a to be created)
;
result = b1
result(*) = -999.9
;
; use the IDL function ARRAY_BIT to get all the pixles (iy, array of pixel
; index) from the l2_flags (r3, band 3 raw data) that have the atmospheric
; correction algorithm failure (bit 1), land (bit 2), sun glint (bit 4),
; total radiance greater than knee value (bit 5), or cloud and ice (bit 10)
; masks set
; set the result of those pixles to 0.0
;
iy = ARRAY_BIT(r4, [1,2,4,5,10], jcnt)
if (jcnt GT 0) then result(iy) = 0.0
;
; the following calculations are based on the MedOC3 algorithm that is
; proposed by Santoleri
;
; set the result to 0.0 for pixels in nLw_443 (b1, band 1 geophysical value)
; or nLw_488 (b2, band 2 geophysical value) or Lw_547 (b3, band 3 geophysical value) that have values less or equal
; 0.0
;
iy = WHERE(b2 LE 0.0 OR b3 LE 0.0 OR b1 LT 0.0, jcnt)
if (jcnt GT 0) then result(iy) = 0.0
Please find attached one of the files which give me troubles.
Thank you
Chiara