diff --git a/app/routes/titiler/algorithms/alerts.py b/app/routes/titiler/algorithms/alerts.py index 1e0e6ed6..f2490cdf 100644 --- a/app/routes/titiler/algorithms/alerts.py +++ b/app/routes/titiler/algorithms/alerts.py @@ -18,7 +18,6 @@ class Alerts(BaseAlgorithm): title: str = "Deforestation Alerts" description: str = "Decode and visualize alerts" - conf_colors: OrderedDict = OrderedDict( { IntegratedAlertConfidence.low: AlertConfig( @@ -33,7 +32,6 @@ class Alerts(BaseAlgorithm): } ) - record_start_date: str = "2014-12-31" start_date: Optional[str] = None diff --git a/app/routes/titiler/algorithms/dist_alerts.py b/app/routes/titiler/algorithms/dist_alerts.py index 6db2d16d..b21b6fcf 100644 --- a/app/routes/titiler/algorithms/dist_alerts.py +++ b/app/routes/titiler/algorithms/dist_alerts.py @@ -52,13 +52,13 @@ def create_mask(self): ) if self.tree_cover_loss_mask: - # Tree cover loss before 2020 can't be used to filter out pixels as not forest - # if they had tree cover loss. Instead we use tree cover height taken that year - # is used as source of truth. + # Tree cover loss data before 2020 can't be used to filter out pixels as not forest + # if they had tree cover loss. Instead, we use tree cover height taken that + # year as source of truth. For example, if a pixel had tree cover loss on + # 2018, but has tree cover height (2020) that meets the forest threshold, the pixel meets + # the forest criteria for alerts. mask *= ( - (self.tree_cover_loss_data.array[0, :, :] >= self.tree_cover_loss_mask) - | (self.tree_cover_loss_data.array[0, :, :] == 0) - | (self.tree_cover_loss_data.array[0, :, :] <= 2020) - ) + self.tree_cover_loss_data.array[0, :, :] >= self.tree_cover_loss_mask + ) | (self.tree_cover_loss_data.array[0, :, :] <= 2020) return mask