Re: dim_stat4 and missing_values

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Sat, 1 Sep 2007 08:03:05 -0600 (MDT)

Hi Jamie,

Some of our older functions don't handle missing values in the best
way, and this might be one of them. I think you're right that
the function should just return missing values for the subset
that is all missing in the time dimension.

Adam pointed out (in an offline email) that the documentation seems
to indicate it should handle missing values, but unfortunately,
the documentation doesn't indicate what happens if it encounters
an array that is *all* missing in an dimension.

Maybe for now you get get around this problem by looping across the
dimensions yourself, and if one subset is all missing, don't bother
calling dim_stat4 or stat4: just set the output array to missing
yourself. I know looping across dimensions is a no-no in NCL, but
this may be the only way you can get around this for now. Meanwhile,
I'll see if I can change these functions to behave better.

--Mary

On Fri, 31 Aug 2007, Jamie Scott wrote:

> I have a 3D array dimensioned x(lat,lon,time) that I'm passing to dim_stat4.
> The array has
> all values over land set to missing_value (and _FillValue). When the array
> is passed to dim_stat4 (or stat4),
> I get an error: "fatal:stat4: The first input array contains all missing
> values."
>
> Apparently it's complaining about the land points where all time values are
> set to _FillValue. I had hoped the function
> would return _FillValue for these points and compute the statistics over the
> ocean grid points that are not set to _FillValue. :(
>
> So I'd like to pass the non-land points only in a 2D array (npts,time) to
> dim_stat4 and take the resulting array (4,npts) and put it
> back into the lat/lon grid (4,lat,lon) in the correct non-missing (ocean
> points) locations. I figure I need to use ndtooned, ind, ind_resolve
> and onedtond in some capacity, but am struggling with this problem. Does
> anyone have any suggestions?
>
> -Thanks,
>
>
> Jamie Scott
> NOAA/ESRL/PSD
> james.d.scott_at_noaa.gov
>
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Sep 01 2007 - 08:03:05 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 05 2007 - 08:49:23 MDT