[ncl-talk] Clarifcation and repost: masks from shapefile; problem at 90N and 180E

Mary Haley haley at ucar.edu
Wed Jan 24 15:54:40 MST 2018


Hi Denise,

Thanks for the clarification. I should have understood from the plot that I
created what you were talking about.  :-)

The reason you are seeing the gap is because the shapefile you're using has
gaps in those areas.

I wrote a separate script that plots the Bering Sea and Arctic Ocean
separately, over a polar stereographic map, and you can see the gap there.
The internal function that does the shapefile masking only looks within a
shapefile outline to see if a lat/lon point is inside or outside of that
polygon, and it doesn't have a way to look outside these slim gaps that are
in the shapefile.

We do have a modified version of the shapefile masking routine that allows
you to specify a kilometer distance outside of a shapefile in which to
include extra points, but I'm afraid this would give you more extra points
than what you want. I'm running this one now to see what happens.

The other option is to try to find a shapefile that doesn't have those gaps.

I found a few at:

http://www.naturalearthdata.com/downloads/

I had to hunt around the various shapefiles to find some that contain both
the Bering Sea and the Arctic Ocean.

At this site:

http://www.naturalearthdata.com/downloads/

the 10m and 50m shapefiles (ne_50m_geography_marine_polys.shp and
ne_10m_geography_marine_polys.shp)
​ produced better results for the masking than the world seas one.  I've
attached the images, comparing the world seas with the 10m, 50m, and 110m
(this last one doesn't have Bering Sea).

The purple outlines are the outlines from the shapefile, and the brownish
dots are what the shapefile masking routine kept inside those outlines.

--Mary
​




On Wed, Jan 24, 2018 at 11:10 AM, Denise Worthen - NOAA Affiliate via
ncl-talk <ncl-talk at ucar.edu> wrote:

> Hi All,
>
> In my attempt to create a lightweight test case for posting, I made it
> clear as mud what I am attempting to do. Mary suggested I repost my query
> with more explanation of what I am trying to accomplish and the problem I
> am seeing.
>
> I am using NCL's shapefile mask function to create a file containing a
> single mask for the Arctic Ocean. The mask will have different values for
> each of the Arctic Ocean's marginal seas. Once I create the mask, I can
> regrid it using ESMF weights to the tripole grid that the model is on. Then
> I can use the tripole mask to calculate various quantities for the marginal
> seas of the Arctic from the model. The regridding and statistics are done
> in F90 routines outside of NCL.
>
> The script make_arcticregs.ncl creates a file with a mask for each Arctic
> region and a "total" mask which is the sum of all the individual masks. It
> does a lot of what it does using NCO. There is probably a simpler NCL-way
> of doing it though.
>
> The script plot_arcticregions.ncl makes a polar plot of the "total" mask
> using the file produced by the 'make' script. The attached figure shows the
> result. There is a missing wedge along 180E and at 90N. The figure shows
> the case with a reduced number of regions (3) and a second figure shows all
> 10 regions.
>
> The only problem I have is the missing wedge. I can actually fix it fairly
> easy outside of NCL but I wasn't sure why the mask creation inside of NCL
> was resulting in the missing wedge.
>
> Thanks,
> Denise.
>
>
> _______________________________________________
> 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/20180124/431649f8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shapefile.000002.png
Type: image/png
Size: 175805 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180124/431649f8/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: natural_earth_110m.000002.png
Type: image/png
Size: 148745 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180124/431649f8/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: natural_earth_10m.000002.png
Type: image/png
Size: 173613 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180124/431649f8/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: world_seas.000002.png
Type: image/png
Size: 175805 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180124/431649f8/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: natural_earth_50m.000002.png
Type: image/png
Size: 173862 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180124/431649f8/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make_arcticreg1_mod_compare.ncl
Type: application/octet-stream
Size: 4996 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180124/431649f8/attachment-0001.obj>


More information about the ncl-talk mailing list