Open aaronspring opened 2 years ago
I wonder if this issue is solved?
No. Isn’t
Hi, I am facing the same trouble. If there is NaN values in my data, the bias correction won't work properly.
You could try to drop NaNs in all arrays where one array has NaNs before using bias_correction. Once that works you could share that code here and we can merged it with the skipna keyword. PR welcome.
the point is NANs come because the timeseries of the model and historical and refernce is not equal. e.g. if you have historical and reference data for 1980-2015, the model 2016 -2022. in this case you deal with non equal timeseries. to make it consistent in time you have to fill the data in nan in long timeseries 1980-2022.
Right. So in xarray logic usually the non overlapping part would be dropped. Would be nice to implement that here as well.
in xarray many functions drop indexes where NaN is the value.
in
bias_correction
I sometimes getValueError: array must not contain infs or NaNs
from https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.lstsq.htmlThis happens when my input data has
NaN
s.Traceback:
How to fix: have a check for NaNs and drop them in
reference
andmodel
ordata_to_be_corrected