[Thread Prev][Thread Next][Index]

[ferret_users] Adding non-consecutive levels containing missing values



Dear Ferret users,

I am on ferret 6.9.6 and I am trying to sum vertical layers which contain NaN's.

The first part of the question is how to add non-consecutive levels, for example I know I can use myvar[k=3:6@sum] for consecutive ones, but how, for example, to add levels 2,5, and 7? Do I have to add them individually? myvar[k=2]+myvar[k=5]+etc.? Or I can create some kind of non-consecutive index such as myvar[k=2/5/7], I can't find this information anywhere.

The second part, my data contains missing values, when I use @sum NaN are ignored and I get the desired result, for example if I have 3,NaN,2,0 the result is 5. But if instead I use the notation myvar[k=2]+myvar[k=5]+etc. then I get NaN in every cell where there is at least one NaN. It seems an inconsistent behavior.

I saw a few similar questions, but I don't want to convert my NaN to 0 because they have different meaning in my data.

Any help is appreciated. Thank you

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement