-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Peatland considered during disaggregation #738
Conversation
|
||
out <- peat_hr / dimSums(land_hr[, getYears(peat_hr), ], dim = 3) | ||
out[is.nan(out)] <- 0 | ||
out[is.infinite(out)] <- 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case do we get Inf here? When dimsums land_hr is 0 then peat_hr should also be zero, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flohump can maybe answer this better, since I only moved the code block further up. But I guess In some instances there might be cases where there is reported peatland, but LUH does not report land area. In R 1/0 = Inf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Many thanks for these improvements.
# Conflicts: # CHANGELOG.md
I found a bug in |
🐦 Description of this PR 🐦
extra/disaggregation.R
luscale::interpolateAvlCroplandWeighted()
, which is the main disaggregation function for MAgPIE land pools: pik-piam/luscale@51d2eba🔧 Checklist for PR creator 🔧
Label pull request from the label list.
Self-review own code
magpie4
R library has been updated accordingly and backwards compatible where necessary.scenario_config.csv
has been updated accordingly (important ifdefault.cfg
has been updated)Document changes
CHANGELOG.md
goxygen::goxygen()
and verify the modified code is properly documentedPerform test runs
Rscript start.R --> "compilation check"
Rscript start.R --> "test runs"
Rscript start.R --> "test runs"
📉 Performance changes 📈
🚨 Checklist for reviewer 🚨
CHANGELOG
is updated correctly