FIXME in rechunk_necdf() there should not be NaN values in the counterfactual if the factual data (input file) is not NaN for this cell. I am not sure what happens if the factual data is nan only for some of the time steps. That should not happen because it is a reanalysis dataset.
If NaN values are in the counterfactual but not the factual are there anyways, it should be further investigated and discussed how to handle those cases. If they can't be avoided, should they be set to the factual value (as currently) or something else?
Todo in attrici.postprocess.py
[x] In replace_nan_inf_with_orig The part to count NaN values does not work correctly yet. What should be done is to count only cells in cfactual which are nan but not in factual something like:
isnan = np.isnan(v) & (~np.isnan(v_orig))
This code snipped, currently doesn't work because v and v_orig are masked arrays. Should change how v and v_orig are loaded from the netcdf file (e.g. with xarray), such that they are normal arrays. Note that this masking has nothing to do with the landseamask
FIXME in
rechunk_necdf()
there should not be NaN values in the counterfactual if the factual data (input file) is not NaN for this cell. I am not sure what happens if the factual data is nan only for some of the time steps. That should not happen because it is a reanalysis dataset. If NaN values are in the counterfactual but not the factual are there anyways, it should be further investigated and discussed how to handle those cases. If they can't be avoided, should they be set to the factual value (as currently) or something else?Todo in
attrici.postprocess.py
replace_nan_inf_with_orig
The part to count NaN values does not work correctly yet. What should be done is to count only cells in cfactual which are nan but not in factual something like:isnan = np.isnan(v) & (~np.isnan(v_orig))
This code snipped, currently doesn't work because v and v_orig are masked arrays. Should change how v and v_orig are loaded from the netcdf file (e.g. with xarray), such that they are normal arrays. Note that this masking has nothing to do with the landseamask