AI4S2S / s2spy

A high-level python package integrating expert knowledge and artificial intelligence to boost (sub) seasonal forecasting
https://ai4s2s.readthedocs.io/
Apache License 2.0
20 stars 7 forks source link

Supporting multiple target intervals in `map_correlation`. #56

Closed BSchilperoort closed 1 year ago

BSchilperoort commented 2 years ago

Currently rgdr's map_correlation implementation will calculate the correlation coefficient and p-value between precursor data and target data. It will calculate this over the anchor_year dim, for every dimension in the input data (e.g. latitude, longitude, i_interval).

However, it does not take into account the Calendar's n_targets, more specifically the case where multiple intervals are labelled as target. A wrapper function is required to handle this. In the case of multiple target intervals, the precursor data and field data for those intervals are flattened over the i_interval dimension.

The following image serves as a visualization for this concept: image

Peter9192 commented 2 years ago

By multiple target periods you mean "a target period consisting of multiple data points/intervals", right?

BSchilperoort commented 2 years ago

a target period consisting of multiple data points/intervals

Yes, exactly. I'll clarify this in the issue