Tracking issues with ADAMONT
Hi @lbatteCNRM,
I have developed an example using Apply that may fulfill your needs. I will try to summarize my proposal:
- the fundamental functions (rain1, rain01 ...) compares one exp field against one obs fields. They return a value for the accuracy.
- function
.analogs
requires a single exp field and an integer indicating the weather type. The function applies the user-defined method to specific observed weather type and its observed time steps. It returns the best 5 fields found. - function
AdamontAnalgos
consider any number of exp and obs dimensions. All dimensions need to be consistent (exp, obs, wt_obs, wt_exp, ...). In order to handle everything as expected, a parameter 'search_obsdims' needs to be provided. To sum up, this function converts ftime and sdate to 'time' dimension for observations and create a dim 'type' to classify weather types given in wt_obs. It returns a multidimensional array with 5 analogs stored in dimension 'time'. This final output can be reorder.
I attached the code which contains small examples for each function.ADAMONT_Apply.R
result <- AdamonAnalogs(exp, obs, wt_exp, wt_obs)
Please, let me know if you have doubts.
Cheers,
Núria