Enhanced generate_weights that takes warming levels and NaN in consideration #108
Closed
1 task done
Labels
enhancement
New feature or request
Addressing a Problem?
Not all simulations/experiments will reach a given warming level. If multiple warming levels exist in a single dataset (with dimension
horizon == ["+2C", "+3C", "+4C"]
), some combinations will be purely NaNs.This becomes a problem for ensemble statistics and specifically
generate_weights
, since that function does not look at the data and, thus, cannot infer that a model run is "invalid" and should not be counted.Example:
Current result:
weights == [0.25, 0.25, 0.25, 0.25]
for all warming levels.Expected result
weights == [0.25, 0.25, 0.25, 0.25]
for +2Cweights == [0, 0, 0.5, 0.5]
for +3Cweights == [0, 0, 0, 1]
for +4CPotential Solution
Add an argument that, when
True
, performs aisnull/count/whatever is fastest
along the other dimensions (or a specific dimension?), puts a weight of 0 if all entries are NaN, and ignores those realizations when generating weights.Since this will be much slower than the current method, I would make it optional.
Contribution
The text was updated successfully, but these errors were encountered: