[ncl-talk] using gc_inout over the Central Arctic

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Fri Dec 2 12:45:03 MST 2016


NCL support,

Would you please fix gc_inout to make it functional over all regions of the
globe, including polar regions?  No hurry for me.  Thanks.

--Dave


On Fri, Dec 2, 2016 at 2:47 AM, Rym Msadek <msadek at cerfacs.fr> wrote:

> Thanks Dave for your reply. I thought about this option too. I just find
> it unfortunate that there isn’t a simpler option given that the function is
> allowed in matlab and python.
>
> Rym
>
> Le 1 déc. 2016 à 23:37, Dave Allured - NOAA Affiliate <
> dave.allured at noaa.gov> a écrit :
>
> Another approach would be to break up your polygon into three separate
> wedge shaped polygons, each of which is carefully designed to exclude the
> pole and a tiny region around it.  Then create three separate grid masks
> with gc_inout, and merge them for your final data mask.  This would avoid
> the need to rotate or reproject the data.
>
> I suggest making each wedge so that the pole is excluded not only from the
> polygon itself, but also from the convex hull of the polygon.  I would also
> suggest making the wedges overlap each other slightly along their common
> east/west boundaries, to eliminate the rare possibility of missing grid
> points that sit exactly on a boundary line.
>
> If your data grid actually includes the pole itself, then manually set
> those mask values(s) to True to handle the special case.
>
> --Dave
>
>
> On Thu, Dec 1, 2016 at 8:54 AM, Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi Rym,
>>
>> I don't definitively know a solution, but I wonder if you might be able
>> to get what you need by either i) rotating/translating your data somewhere
>> off pole to do the in/out calculation, then rotating back,  or ii)
>> performing the calculation in a map projection, and again, deprojecting the
>> results back ?
>>
>> Rick
>>
>> On Thu, Dec 1, 2016 at 7:10 AM, Rym Msadek <msadek at cerfacs.fr> wrote:
>>
>>> Hi,
>>>
>>> I am trying to use the gc_inout function to define a polygon over the
>>> Arctic region and use that as a mask to average an oceanic field like
>>> potential temperature.
>>> I have an issue when the longitudes and latitudes of the polygon cover a
>>> region that crosses the North pole. gcinout gives me a contour that is not
>>> closed and I can’t figure out how to overcome this issue.
>>>
>>> Here are the lon lat that define my polygon, over the Eurasian basin of
>>> the Arctic.
>>> ---------
>>> latC=(/81,81.5,82,82.7,82.4,81.6,80,78.8,77,78,79,81,82,84,8
>>> 8,88.5,89,86,85,85,84,83,82,82,81/)
>>> lonC=(/27,36,48,60,77,94,107,114,121,134,140,141,145,149,132
>>> ,149,-79,-55,-43,-22,-20,-17,-9,5,27/)
>>>
>>> in_obs=gc_inout(nav_lono,nav_lato,lonC,latC)
>>>
>>> mask_eurasia = where(in_obs.eq.True,1,0)
>>> plot= gsn_csm_contour_map_polar(wks,mask_eurasia,res)
>>> --------
>>> I’m attaching the resulting plot that I get.
>>> Note that I have used this same gc_inout function to define other
>>> polygons in the Arctic and it works fine when the region was not over the
>>> central Arctic.
>>>
>>> Any help would be appreciated.
>>>
>>> Thanks,
>>>
>>> Rym
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161202/ab3dfc20/attachment.html 


More information about the ncl-talk mailing list