<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div><div>Hi Dennis, </div><div><br></div><div>I have, but I let hours pass and had to kill the script. Let me try it on a subset of the domain which contains coastlines and see if it works well. After that, I might have to get more creative in speeding up the processing for a  6144 x 6144 grid. </div><div><br></div><div>More to come,</div><div>Greg</div><div><div id="MAC_OUTLOOK_SIGNATURE"></div></div></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>><br><span style="font-weight:bold">Date: </span> Friday, October 6, 2017 at 5:48 PM<br><span style="font-weight:bold">To: </span> Greg Deemer <<a href="mailto:greg.deemer@nsidc.org">greg.deemer@nsidc.org</a>><br><span style="font-weight:bold">Cc: </span> "<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>" <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br><span style="font-weight:bold">Subject: </span> Re: [ncl-talk] Best interpolation Opt for ESMF_Regrid to regrid a binary mask?<br></div><div><br></div><span style="mso-bookmark:_MailOriginalBody"><div dir="ltr">Did you try the nearest neighbor method?<br><div><br>---<br><br><a href="http://www.ncl.ucar.edu/Applications/">http://www.ncl.ucar.edu/Applications/</a><br><br>Under: 'Data Analysis' ... click 'ESMF Regridding'<br><br><b><b>"neareststod"</b></b> / "nearestdtos"
- <font color="red"><i>Available in <a href="http://www.ncl.ucar.edu/prev_releases.shtml#6.2.0">version 6.2.0</a> and later.</i></font> 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.<br><br><br></div><div>Examples 10, 31 use 'nearest..' method<br>---<br><br></div><div>Classification (not maskink) plots: <b><a href="http://www.ncl.ucar.edu/Applications/classification.shtml">http://www.ncl.ucar.edu/Applications/classification.shtml</a></b><br></div><div>---<br><br><br><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 4:02 PM, Greg Deemer <span dir="ltr"><<a href="mailto:greg.deemer@nsidc.org" target="_blank">greg.deemer@nsidc.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div><div><div>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 (<a href="http://nsidc.org/data/docs/daac/nsidc0622-valid-ice-masks/" target="_blank">http://nsidc.org/data/docs/<wbr>daac/nsidc0622-valid-ice-<wbr>masks/</a>). 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:</div></div></div><span id="gmail-m_8564269435036674993OLK_SRC_BODY_SECTION"><span><div style="color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div><br></div><div>NIC_mask<span class="gmail-m_8564269435036674993Apple-tab-span" style="white-space:pre-wrap">                 </span>= where (NIC_Flag.ne.1, default_fillvalue("integer"), NIC_Flag)</div></div></span></span><span id="gmail-m_8564269435036674993OLK_SRC_BODY_SECTION"><span><div style="color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div><br></div><div>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. </div><div><br></div><div>Later on in the code, I chose Opt@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. </div><div><br></div><div>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. </div><div><br></div><div>I was wondering if the folks have some explanation as to why bilinear would smearing the coastlines, or recommendations for avoiding this.</div><div><br></div><div>I suppose I can try to regrid a small subset that includes coastal regions  with different methods as a next step to save time….</div><div><br></div><div>Thank you for the discussion,</div><div>Greg</div><div><br></div><div>--</div><div><div id="gmail-m_8564269435036674993"><div><div><br></div></div><div><div style="font-family:-webkit-standard"><b>Greg Deemer</b></div><div style="font-family:-webkit-standard">User Services Office</div><div style="font-family:-webkit-standard">National Snow and Ice Data Center</div><div style="font-family:-webkit-standard"><a href="tel:%28303%29%20735-8068" value="+13037358068" target="_blank">(303) 735-8068</a></div><div style="font-family:-webkit-standard"><a href="http://nsidc.org/" target="_blank">http://nsidc.org</a></div><div style="font-family:-webkit-standard">Twitter: @NSIDC</div></div></div></div></div></span></span></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br><a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br><br></blockquote></div><br></div></div></span></span></body></html>