climr icon indicating copy to clipboard operation
climr copied to clipboard

downscale_core custom refmap too restrictive

Open cmahony opened this issue 11 months ago • 4 comments

climr_downscale() currently has unnecessary barriers to downscaling a user-provided refmap (i.e., not from input_refmap()). first, the name of the DEM layer is required to be "dem2_WNA". could we make this more flexible? also, it is required that isTRUE(attr(refmap, "builder") == "climr"). this is easily added to a user script, but it seems unnecessary.

currently a user needs two extra lines to bypass these restrictions:

mosaic.raw <- rast("//objectstore2.nrs.bcgov/ffec/Climatologies/climr_mosaic/climr_mosaic.tif")
names(mosaic.raw)[length(names(mosaic.raw))] <- "dem2_WNA" 
attr(mosaic.raw, "builder") <- "climr" # necessary to trick the package into thinking this is climr input
climr.all <- downscale_core(grid, refmap = mosaic.raw, vars = list_vars(set="Monthly"))

cmahony avatar Jan 02 '25 15:01 cmahony

@kdaust consider for this release but not essential

cmahony avatar May 05 '25 22:05 cmahony

There are a few complexities here, so I'm suggesting we wait for the next minor release

kdaust avatar May 05 '25 23:05 kdaust

roger that.

cmahony avatar May 05 '25 23:05 cmahony

I added a known issues vignette but we should still resolve this.

cmahony avatar May 09 '25 21:05 cmahony