[ncl-talk] Best interpolation Opt for ESMF_Regrid to regrid a binary mask?
Dennis Shea
shea at ucar.edu
Tue Oct 10 13:13:41 MDT 2017
Good news! Thx for the close-out note. I think the ESMF software may have a parallel option.
Also saving the weight file *may* be an option if the mask field is not a function of time.
Cheers
D
Sent from my iPhone
> On Oct 10, 2017, at 12:49 PM, Greg Deemer <greg.deemer at nsidc.org> wrote:
>
> Dennis,
>
> Just to close this out, I have successfully regridded a subset of my data with “neareststod", and it looks spot on. I will work on optimizing my code now for the true, larger, domain.
>
> Cheers,
> Greg
>
> From: ncl-talk <ncl-talk-bounces at ucar.edu> on behalf of Greg Deemer <greg.deemer at nsidc.org>
> Date: Friday, October 6, 2017 at 6:37 PM
> To: Dennis Shea <shea at ucar.edu>
> Cc: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
> Subject: Re: [ncl-talk] Best interpolation Opt for ESMF_Regrid to regrid a binary mask?
>
> Hi Dennis,
>
> 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.
>
> More to come,
> Greg
>
> From: Dennis Shea <shea at ucar.edu>
> Date: Friday, October 6, 2017 at 5:48 PM
> To: Greg Deemer <greg.deemer at nsidc.org>
> Cc: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
> Subject: Re: [ncl-talk] Best interpolation Opt for ESMF_Regrid to regrid a binary mask?
>
> 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 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
> ---
>
>
>
>
>
>> 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
>>
>
> _______________________________________________ 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/20171010/6d56405a/attachment.html>
More information about the ncl-talk
mailing list