# Re: Missing Values

```On Fri, 16 Aug 2002, Steve Cocks wrote:
> I then compute the divergence from the same u and v components and
> write the data to *.nc file.  Lo and behold, now I have 256 missing
> values, over twice as many.
>
> 1)  What is ferret doing to produce the extra missing values?

To compute the divergence you need to compute horizontal differences.
Say you're using centered differences -- then if you're a valid point,
say, east of a missing value, you can't compute the centered difference of
u in x because you lack information.  Ferret "does the right thing" and
outputs a missing value at that point.  This is why the result has more
missing values than the input data.

If you really want the gradient (despite imperfect information) at those
neighboring points, you have several options: (1) Use a forward or
backward difference there (do this by filling in the @ddc missing values
using what you get from @ddf and @ddb).  (2) Fill the missing values
*before* differencing by using @fln or @fnr, then compute the difference,
then re-mask.  (3) Fill the missing values *after* differencing, then
re-mask.  You'll have to decide what makes most sense for your
application.

> 2)  In the future to track this problem, how can I get ferret to plot
> the missing value points on a horizontal map? (Tried
> "fill/pal=grey/level(-1.0E+34)/nolab variable"  and it didn't work)

"shade variable" should automatically show the missing values as white
"holes" in the data.  You could also say
shade/lev=(1) IF missing(variable,-9999) EQ -9999 THEN 1

> 3)  Whenever the shade or fill command is given for a variable does:
>
>      a) Ferret ignor the missing value and plots an average of the
> nearest neighbors to the missing value?
>      b)  Ferret  not plot the value at all unless told to?

SHADE plots the actual grid BOXES, and colors in the non-missing points.
FILL (or CONTOUR) uses a mixture of bilinear & spline interpolation to
produce a smooth contour field through the grid POINTS.  Missing points
are ignored for the FILL calculation, so they appear as "holes" in the
contour field.  And because each gridpoint is typically in the center of
its gridbox, the missing areas usually look a bit larger than with SHADE.

Hope that helps,

Andrew

----------------------------------------------------------------------
Andrew Wittenberg          Program in Atmospheric and Oceanic Sciences
andyw@splash.princeton.edu                        Princeton University
----------------------------------------------------------------------

```