Skip to content

Commit

Permalink
Merge pull request #4708 from wri/data/tree_cover_gain_decoding
Browse files Browse the repository at this point in the history
Data/tree cover gain decoding
  • Loading branch information
willian-viana authored Jan 17, 2024
2 parents b65e29f + 4ad3a16 commit c2075ad
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion providers/datasets-provider/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,23 @@ const decodes = {
alpha = 1.;
}
}
color.r = red;
color.g = green;
color.b = blue;
`,
treeGain: `
// Multiply alpha (opacity) by a function that drops super low opacity
// pixels and scales the rest to higher values
// TODO: Explain the various coefficients and how they effect alpha
if (zoom < 12.) {
if (color.r == 0. && color.g == 0. && color.b == 0.) {
alpha = 0.;
} else {
alpha = 1.- (1.1 * pow(8. , -(12. * alpha / zoom)));
}
}
`,
newCarbonFlux: `
float red = color.r;
float green = color.g;
Expand Down Expand Up @@ -1058,4 +1070,5 @@ export default {
cumulativeCarbonGain: decodes.cumulativeCarbonGain,
netGHGFlux: decodes.netCarbonFlux,
formaAlerts: decodes.forma,
treeGain: decodes.treeGain,
};

0 comments on commit c2075ad

Please sign in to comment.