Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: Missing Values

Hi Cameron,

> I have a field where some of the values are NaN.
> I would like to remove these missing values by changing them
> to their nearest neighbor (or some other algorithm).
> Is there a visad way of doing this?
> Or do I have to define some sort of custom interpolation?

It all depends on how dense your missing points are.  If
most points are missing, then you could treat the non-missing
points as samples of an IrregularSet.  The IrregularSet
constructor will invoke a Delaunay algorithm, which will be
quite slow.  Then you can resample that IrregularSet back
to your original GriddedSet.  A faster way (still for most
points missing) would be to use an objective analysis
algorithm.  We've got some Fortran for this at:

  ftp://hyde.ssec.wisc.edu/pub/misc/fbarn.f

Also, I believe your advisor James Kelly is an expert on
objective analysis.

If your missing points are sparse, then you should be
probably just use a simple spot noise filter.  For example,
replace each missing point by the average of adjacent
non-missing points.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690