Closed ocefpaf closed 9 years ago
or if biggus could avoid attaching this property to non-masked objects.
I've been a little uncomfortable with biggus doing this too. It is certainly a break from numpy to make the Array object fundamentally have a fill_value
and it doesn't sit well in some circumstances IMHO.
@pelson Thanks for looking into this. Is there an easy solution? What would be the impact of adding this attribute only if the original array is a masked array? Currently I have to go through all my cubes and modify the fill_value
to be the same as the one assigned by biggus so I can merge them.
@ocefpaf - it is hard to be certain, but I think #105 addressed this problem. Do you have a simple case with which we can reproduce the problem?
Yes I do . I will test this later today (I am away from my laptop now) and close the issue if it works.
Yes, this is fixed! Thanks a lot @pelson
PS: I do not have a simple case, but I just removed my workaround for this issue and everything worked out fine in my notebooks.
Assigning a
fill_value
property in Array.fill_value will create a masked array defaultfill_value
even when the original data is not masked.That prevents cubes merging in iris.
The failure happens when slicing cubes and trying to merge them again. If one of the slices happens to be masked and the other is not the merging will fail. That occurs because the merging will be between the original
fill_value
, from the original cube metadata, and the defaultfill_value
assigned by bigguslazy_data()
.Don't know if the best approach would be for iris to preserve the original
fill_value
when slicing data that is masked (even when there is nothing to fill -- that would be an iris fix), or if biggus could avoid attaching this property to non-masked objects.