Skip to content

Commit

Permalink
Merge pull request #4898 from wri/develop
Browse files Browse the repository at this point in the history
PROD Deploy 2024-12-12 11:15am EST
  • Loading branch information
wri7tno authored Dec 12, 2024
2 parents d899164 + ce76905 commit c006dc3
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/map-menu/sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const datasetsSections = compact([
subCategories: [
{
slug: 'deforestationAlerts',
title: 'Deforestation Alerts',
title: 'Disturbance Alerts',
},
{
slug: 'fireAlerts',
Expand Down
46 changes: 46 additions & 0 deletions providers/datasets-provider/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,51 @@ const decodes = {
alpha = 0.;
}
`,
distAlerts: `
// values for creating power scale, domain (input), and range (output)
float confidenceValue = 0.;
if (confirmedOnly > 0.) {
confidenceValue = 1.;
}
float r = color.r * 255.;
float g = color.g * 255.;
float b = color.b * 255.;
// **** CHECK THIS
// 1461 = days from 2019/01/01 to 2014/12/31
// 1870 = days from 2020/02/14 to 2014/12/31
float day = (r * 255.) + g;
float confidence = floor(b / 100.);
if (
day > 0. &&
day >= startDayIndex &&
day <= endDayIndex &&
confidence >= confidenceValue &&
alpha > 0.
) {
// get intensity
float intensity = mod(b, 100.) * 50.;
// float intensity = 255.;
if (intensity > 255.) {
intensity = 255.;
}
if (confidence < 2.) {
color.r = 238. / 255.;
color.g = 177. / 255.;
color.b = 177. / 255.;
alpha = intensity / 255.;
} else {
color.r = 137. / 255.;
color.g = 82. / 255.;
color.b = 119. / 255.;
alpha = intensity / 255.;
}
} else {
alpha = 0.;
}
`,
RADDsCoverage: `
float red = color.r;
float green = color.g;
Expand Down Expand Up @@ -1058,6 +1103,7 @@ export default {
GLADs: decodes.GLADs,
RADDs: decodes.RADDs,
RADDs2yearsTimeline: decodes.RADDs2yearsTimeline,
distAlerts: decodes.distAlerts,
RADDsCoverage: decodes.RADDsCoverage,
staticRemap: decodes.staticRemap,
staticRemapAlpha: decodes.staticRemapAlpha,
Expand Down

0 comments on commit c006dc3

Please sign in to comment.