NASA-IMPACT / hls-sentinel

HLS Sentinel 2 processing container for generating S30 products.
MIT License
2 stars 0 forks source link

Apply ESA Quality Mask #150

Closed junchangju closed 1 year ago

junchangju commented 1 year ago

Apply ESA's image quality mask available for processing baseline 4.0 onward to filter the corrupted data.

  1. The code is hls_libs/esa_quality_mask/esa_quality_mask.c
  2. The make file that works on JJU's local system is hls_libs/esa_quality_mask/makefile. No new code or header is created, other than the above C code.
  3. The bash script hls_libs/esa_quality_mask/apply_esa_quality_mask.sh illustrates how to use the code. A few lines of bash code can be added into the sentinel_granule.sh, between addFmaskSDS and s2trim. The hdf is updated in place.

The basic flow is: If the quality masks in JP2 exist, convert each mask into the ENVI format and keep the ENVI filename for B01, and finally apply the code with the HDF name and the B01 mask name in ENVI. Masks for other bands are inferred from the B01 filename and applied as well.

Added 4 days later: To test the code, use tile 17SND on 2022-11-17, and 31QDA on 2022-10-13.