CST_QuantileMapping doesn't handle correctly exp_cor
As reported by an external user, CST_QuantileMapping fails when sdates doesn't match between exp, obs and exp_cor. Here the original comment:
As described in the documentation “CST_QuantileMapping” function allows to apply the correction to an object of class s2dv_cube specified in “exp_cor”. In our experiment we used two objects of class s2dv_cube in “exp” and in “obs” with same dim(sdate)=24 (years: 1993/2016) and an object of class s2dv_cube in “exp_cor” with dim(sdate)=4 (years:2017/2020). Our intension is the following: using a common period (1993-2016) for downscaling calibration, then use that for calibrating another period 2017-2020, even included the latest forecast.
The function fails with this message: Error in Apply(list(exp, obs, exp_cor), target_dims = sample_dims, fun = qmapcor, : Found one or more margin dimensions with the same name and different length in some of the input objects in 'data’.
If we try to use object with the same dim(sdate), (e.g. using just 4 years such as: exp (years: 1993/1996), obs (years: 1993/1996), exp_cor (years: 2017/2020)), CST_QuantileMapping runs properly. We tried also exp(1993-2016) obs(1993-2016) and exp_cor(1993-2020) with a similar Error Message. Thus it seems that only time series of identical length could run.
How can we apply the correction to the latest available ECMWF data? In this case the time length of forecasts naturally exceeds the observations, thus how to deal with this situation?