[ncl-talk] gc_inout; problem with polygons over equator & zonal extent > 180 degr

Devries, Andries a.devries at mpic.de
Sat Dec 17 11:38:16 MST 2016


Hello Mary,

Sorry for the double email, in the previous one I forgot to -cc- ncl-talk.

Thanks for the response. In the original script the longitudes were indeed from -180 to 180. I have reorganised the longitudes of the polygon following your suggestion and also have used the underlying grid with longitudes from 0 to 360, however, it didn't make any difference unfortunately.

I have attached:
- simplified & cleaned code using the gc_inout function for a box over the equator & having a zonal extent larger than 180 degrees (with lon 0->360)
- simplified & cleaned script for visualization of the output of the code
- the plot

I also sent a file to the ftp (using my emailaddress) you can use as input for the code; it contains era-interim on a guassian grid. Furthermore I sent to the ftp also plots of the real application I intended with gc_inout, demonstrating this issue with gc_inout for polygons with a zonal extent > 180 degrees over the equator

I'm looking forward very much to a solution or a way to work around the issue.
Thank you very much for your help thus far!

Kind regards,
Andries

________________________________
From: Mary Haley [haley at ucar.edu]
Sent: 15 December 2016 17:01
To: Devries, Andries
Cc: ncl-talk at ucar.edu
Subject: Re: [ncl-talk] gc_inout; problem with polygons over equator & zonal extent > 180 degr

Andries,

Sorry for the delay in response. We are working on getting a new release out and have a tight deadline.

I always thought gc_inout handled points across the equator just fine, but I haven't specifically tried this out. If your longitudes go from -180 to 180, then one thing you could try is converting them to go from 0 to 360, which may take care of that big jump:

lon = where(lon.lt.0,lon+360,lon)

If this doesn't help, can you send us a clean script that shows the issue?

--Mary

On Mon, Dec 12, 2016 at 2:41 PM, Devries, Andries <a.devries at mpic.de<mailto:a.devries at mpic.de>> wrote:
Dear NCL users/developers,

I ran into a problem with ncl (v.6.3.0) using the function gc_inout. I used the function to identify grid points on a gaussian grid (512x256) within a polygon. When the polygon has a zonal extent larger than 180 degrees and extends over the equator (covers partly both northern and southern hemispheres), a problem occurs; on the edges gridpoints are missing that should have been identified.

I attached 2 simple idealized plots that demonstrate the issue; all gridpoints should be identified within the boxes:
plot1) box lon-100:100, lat 10:30; everything fine
plot2) box lon-100:100, lat -10:10; gridpoints on both edges are missing

Is this a bug or a known issue as the description of gc_inout says: "and that the vertices can be contained in a hemisphere"?

Any suggestions how can I work around this issue?

Looking forward to suggestions!
Cheers,
Andries

_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto: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/20161217/8bb95b98/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alg_gcinout_testbox.ncl
Type: application/octet-stream
Size: 8370 bytes
Desc: alg_gcinout_testbox.ncl
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161217/8bb95b98/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: visualisation_testbox.ncl
Type: application/octet-stream
Size: 6971 bytes
Desc: visualisation_testbox.ncl
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161217/8bb95b98/attachment-0003.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_testbox.pdf
Type: application/pdf
Size: 327590 bytes
Desc: plot_testbox.pdf
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161217/8bb95b98/attachment-0001.pdf 


More information about the ncl-talk mailing list