@silvia discovered that CST_RFWeights will not work properly when the target longitudes (lon
) are not monotonic, as happens in some cases when the original model uses longitudes in the range 0:360, but a window crossing Greenwich is used. Example [355, 356, 357, 358, 359 0 1 2 3 ...]. This small fix corrects that. It converts longitudes in such a case so that negative longitudes are used.
It is still responsibility of the user to provide a climatology file which is centered in such a way that it contains entirely the target area. This means that if the target area crosses Greenwich, but the climatology is global and its longitudes start at 0, then it should be shifted by 180 degrees so that it starts at -180.