Re: mask 2D lat/lon grid with 1D shapefile

From: Leif Truelsen <truelsen.leif_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 27 2013 - 18:50:40 MDT

Dave and Maria,

Thank you very much. Simply inputting my lon2d and lat2d variables into
the create_new_mask function did the trick.

A separate problem I am having is that any data with a western longitude is
masked, even if it is within a shapefile polygon. For example, see the
attached plot and weddellSea.shp file. This happens regardless of the
gridded data plotted. Thus, I am assuming it is likely a simple problem
with my shapefiles. Again, help is much appreciated.

Kind regards,
Leif

On Tue, Aug 27, 2013 at 2:02 PM, Dave Allured - NOAA Affiliate <
dave.allured@noaa.gov> wrote:

> Leif,
>
> Take a closer look at example 11. It is true that the example data
> set has 1-D coordinates. However, the example then proceeds to
> convert the 1-D coordinates into 2-D coordinates for calling the mask
> function. You could just as easily plug in your lat2d and lon2d
> coordinates directly into the mask function call, in place of the
> conform_dims expressions. This may be exactly what you want.
>
> --Dave
> (All replies to user list, please.)
>
> On Tue, Aug 27, 2013 at 11:30 AM, Leif Truelsen <truelsen.leif@gmail.com>
> wrote:
> > Thank you for bringing my attention to example 11. Unfortunately, I
> don't
> > think this duplicates my problem. My issue is that my gridded data
> (e.g.,
> > u-winds in this example) are on a rotated grid (rlat (y), rlon (x)) that
> are
> > linked to lat2d (x,y) lon2d (x,y) variables. The example dataset is in a
> 1D
> > grid. I need to mask the rotated grid using shapefiles (not all
> > rectangular) that are in a 1D lat/lon coordinate system. I think that
> the
> > answer to my problem involves using the getind_latlon2d function, but I
> have
> > yet to figure this out.
> >
> > Kind regards,
> > Leif
> >
> >
> > On Mon, Aug 26, 2013 at 10:37 PM, <mgehne@ucar.edu> wrote:
> >>
> >> Hi Leif,
> >>
> >> I just had a similar problem recently. Example 11 deals with masking
> from
> >> a shapefile
> >> with 2d lat/lon coordinates.
> >>
> >> http://ncl.ucar.edu/Applications/Scripts/shapefiles_11.ncl
> >>
> >> I hope this helps,
> >> Maria
> >>
> >> > Hi all,
> >> >
> >> > I am looking to extract an area weighted average of gridded data
> using a
> >> > shape file. I am following the basic procedure of the
> shapefiles_9.ncl
> >> > example (
> http://www.ncl.ucar.edu/Applications/Scripts/shapefiles_9.ncl).
> >> > Basically, it reads the 1D lat/lon ranges from the shapefile and uses
> >> > these ranges to mask the original 1D gridded data.
> >> >
> >> > Like the example, I have a shapefile in a geographic projection with
> >> > single
> >> > dimension x and y values (in degrees). My problem is that my gridded
> >> > data
> >> > is in a rotated lat/lon grid (time,y,x). The longitude and latitude
> >> > variables both have two dimensions (y, x). I can't seem to wrap my
> head
> >> > around how to mask these data using a shapefile in a standard 1D grid.
> >> > Any
> >> > help would be gratefully received.
> >> >
> >> > Best,
> >> > Leif
> >> > _______________________________________________
> >> > ncl-talk mailing list
> >> > List instructions, subscriber options, unsubscribe:
> >> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >> >
> >>
> >>
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Aug 27 18:50:54 2013

This archive was generated by hypermail 2.1.8 : Fri Aug 30 2013 - 14:04:57 MDT