worldbank / blackmarbler

Georeferenced Rasters and Statistics of Nighttime Lights from NASA Black Marble
https://worldbank.github.io/blackmarbler/
Other
16 stars 3 forks source link

Weighted Average using "Mandatory_Quality_Flag" when using bm_extract function #11

Open alexyshr opened 5 months ago

alexyshr commented 5 months ago

In the function bm_extract we can remove cells with specified quality flags (vector) using the parameter quality_flag_rm. Once you migrate to terra, using a weighted average considering quality flag values for each cell would be nice. For instance, add more weight to high-quality cells if the selected function is mean. Or even better have access to other bands different than variable to write personalized functions cell-by-cell like weighted average.

Best