[ncl-talk] Best interpolation Opt for ESMF_Regrid to regrid a binary mask?

Dennis Shea shea at ucar.edu
Fri Oct 6 17:48:27 MDT 2017


Did you try the nearest neighbor method?

---

http://www.ncl.ucar.edu/Applications/

Under: 'Data Analysis' ... click 'ESMF Regridding'

*"neareststod"* / "nearestdtos" - *Available in version 6.2.0
<http://www.ncl.ucar.edu/prev_releases.shtml#6.2.0> and later.* The nearest
neighbor methods work by associating a point in one set with the closest
point in another set. If two points are equally close then the point with
the smallest index is arbitrarily used (i.e. the point with that would have
the smallest index in the weight matrix). There are two versions of this
type of interpolation available in the regrid weight generation
application. One of these is the nearest source to destination method
("neareststod"). In this method each destination point is mapped to the
closest source point. The other of these is the nearest destination to
source method ("nearestdtos"). In this method each source point is mapped
to the closest destination point. Note, that with this method the unmapped
destination point detection doesn't work, so no error will be returned even
if there destination points which don't map to any source point.


Examples 10, 31 use 'nearest..' method
---

Classification (not maskink) plots:
*http://www.ncl.ucar.edu/Applications/classification.shtml
<http://www.ncl.ucar.edu/Applications/classification.shtml>*
---





On Fri, Oct 6, 2017 at 4:02 PM, Greg Deemer <greg.deemer at nsidc.org> wrote:

> I am regridding a mask from coarse to fine resolution. The mask is a
> monthly binary field developed to remove spurious ice from certain
> satellite products (http://nsidc.org/data/docs/daac/nsidc0622-valid-ice-
> masks/). Mask = 1 where ice is valid, and Mask = 0 where ocean is valid.
> There are other flags for land/coastal land that I can ignore as well with
> the following command:
>
> NIC_mask = where (NIC_Flag.ne.1, default_fillvalue("integer"), NIC_Flag)
>
> As an interim step, I spit out “NIC_mask” to it’s own NC file and opened
> with NC View. Please see “OriginalMask.png” attached.
>
> Later on in the code, I chose Opt at InterpMethod = “bilinear” as I figured
> it was quickest and didn’t matter much since I’m dealing with 1’s and fill
> values. However, it looks like there is a not so insignificant amount of
> information being lost near the coastlines in the resulting interpolation.
> Please see a similar screen grab “BilinearInformationLoss.png” attached for
> the result generated by ESMF_Regrid.
>
> Since the regridding takes a while (20+ minutes) on my desktop for
> bilinear, and an unknown time for other interpolation methods, I have not
> tested each one. I figured running “neareststod” could produce more
> accurate results but I’ve let the code run for hours and it seems to be
> getting hung up…somewhere.
>
> I was wondering if the folks have some explanation as to why bilinear
> would smearing the coastlines, or recommendations for avoiding this.
>
> I suppose I can try to regrid a small subset that includes coastal regions
>  with different methods as a next step to save time….
>
> Thank you for the discussion,
> Greg
>
> --
>
> *Greg Deemer*
> User Services Office
> National Snow and Ice Data Center
> (303) 735-8068
> http://nsidc.org
> Twitter: @NSIDC
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171006/e053f6b4/attachment.html>


More information about the ncl-talk mailing list