Skip to content

Commit

Permalink
resolution mapping done
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-sauer committed Jul 2, 2024
1 parent 52d1a7f commit 3788164
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '3595746'
ValidationKey: '3782140'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
8 changes: 4 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ message: If you use this software, please cite it using the metadata from this f
type: software
title: 'mrdownscale: Downscale and harmonize MAgPIE output using LUH2 as reference
data'
version: 0.18.1
date-released: '2024-05-23'
version: 0.19.0
date-released: '2024-07-02'
abstract: Downscale and harmonize MAgPIE output using LUH2 as reference data.
authors:
- family-names: Sauer
given-names: Pascal
email: [email protected]
orcid: 0000-0002-6856-8239
orcid: https://orcid.org/0000-0002-6856-8239
affiliation: Potsdam Institute for Climate Impact Research
- family-names: Dietrich
given-names: Jan Philipp
email: [email protected]
orcid: 0000-0002-4309-6431
orcid: https://orcid.org/0000-0002-4309-6431
affiliation: Potsdam Institute for Climate Impact Research
license: LGPL-3.0
repository-code: https://github.com/pik-piam/mrdownscale
Expand Down
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: mrdownscale
Title: Downscale and harmonize MAgPIE output using LUH2 as reference data
Version: 0.18.1
Date: 2024-05-23
Version: 0.19.0
Date: 2024-07-02
Authors@R: c(
person("Pascal", "Sauer", , "[email protected]", role = c("aut", "cre"),
comment = c(affiliation = "Potsdam Institute for Climate Impact Research", ORCID = "0000-0002-6856-8239")),
Expand All @@ -12,7 +12,7 @@ Authors@R: c(
Description: Downscale and harmonize MAgPIE output using LUH2 as reference
data.
License: LGPL-3
URL:https://github.com/pik-piam/mrdownscale,
URL: https://github.com/pik-piam/mrdownscale,
https://doi.org/10.5281/zenodo.11244475
BugReports: https://github.com/pik-piam/mrdownscale/issues
Depends:
Expand All @@ -34,4 +34,4 @@ Suggests:
usethis
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
1 change: 0 additions & 1 deletion R/calcLandHarmonized.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ calcLandHarmonized <- function(input = "magpie", target = "luh2mod",
target <- calcOutput("LandTarget", target = target, aggregate = FALSE)
# bring target data to spatial resolution of input data
ref <- as.SpatVector(input[, 1, 1])[, c(".region", ".id")]
# TODO use extended cell to cluster mapping
target <- terra::extract(target, ref, sum, na.rm = TRUE, bind = TRUE)
target <- as.magpie(target)
stopifnot(setequal(getItems(input, 3), getItems(target, 3)))
Expand Down
2 changes: 1 addition & 1 deletion R/calcResolutionMapping.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ toolResolutionMapping <- function(mapping, targetGrid) {
toolStatusMessage("warn", paste0("nearest neighbor distances: ",
"max = ", round(max(near$distance) / 1000, 1), "km",
", 90% quantile = ",
round(quantile(near$distance, probs = 0.90) / 1000, 1), "km",
round(stats::quantile(near$distance, probs = 0.90) / 1000, 1), "km",
", mean = ", round(mean(near$distance) / 1000, 1), "km"))

near <- as.data.frame(near)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Downscale and harmonize MAgPIE output using LUH2 as reference data

R package **mrdownscale**, version **0.18.1**
R package **mrdownscale**, version **0.19.0**

[![CRAN status](https://www.r-pkg.org/badges/version/mrdownscale)](https://cran.r-project.org/package=mrdownscale) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11244475.svg)](https://doi.org/10.5281/zenodo.11244475) [![R build status](https://github.com/pik-piam/mrdownscale/workflows/check/badge.svg)](https://github.com/pik-piam/mrdownscale/actions) [![codecov](https://codecov.io/gh/pik-piam/mrdownscale/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrdownscale)

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Pascal Sauer <pascal.sauer@pik-po

To cite package **mrdownscale** in publications use:

Sauer P, Dietrich J (2024). _mrdownscale: Downscale and harmonize MAgPIE output using LUH2 as reference data_. doi:10.5281/zenodo.11244475 <https://doi.org/10.5281/zenodo.11244475>, R package version 0.18.1, <https://github.com/pik-piam/mrdownscale>.
Sauer P, Dietrich J (2024). _mrdownscale: Downscale and harmonize MAgPIE output using LUH2 as reference data_. doi:10.5281/zenodo.11244475 <https://doi.org/10.5281/zenodo.11244475>, R package version 0.19.0, <https://github.com/pik-piam/mrdownscale>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {mrdownscale: Downscale and harmonize MAgPIE output using LUH2 as reference data},
author = {Pascal Sauer and Jan Philipp Dietrich},
year = {2024},
note = {R package version 0.18.1},
note = {R package version 0.19.0},
url = {https://github.com/pik-piam/mrdownscale},
doi = {10.5281/zenodo.11244475},
}
Expand Down
2 changes: 1 addition & 1 deletion man/readMagpieFulldataGdx.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/toolDownscaleMagpieClassic.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/toolResolutionMapping.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3788164

Please sign in to comment.