[Met_help] [rt.rap.ucar.edu #80172] History for poly lat/lon files

John Halley Gotway via RT met_help at ucar.edu
Mon Apr 17 14:09:04 MDT 2017


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

Good Morning,

    I have made a lat/lon poly files for the Northern Hemisphere the
lat/lons
that I am interested in are 85N to 20N then all 360 degrees in the
longitude.
I do not believe my file is correct it is not giving me the correct values.
I basically just want a rectangle that starts at 85N and ends at 20N with
all of 360 degrees longitude.
What is have is a large file that starts as follows
85  then 0 to 180, then -179 to 0
........
20  0 to 180, then -179 to 0
at the end is
85  -179 to 0 then 180 down to 0

I hope this makes sense.
Many Thanks for your help
 Sherrie  Fredrick


----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: poly lat/lon files
From: John Halley Gotway
Time: Mon Apr 17 10:04:46 2017

Hi Sherrie,

Yes, we've found defining lat/lon polyline files to wrap around the
whole
globe to be problematic.  If you draw a rectangle that covers the
whole
globe, the software needs to know which points are inside versus
outside.

Since the 6.0 release, we've come up with a much simpler way of doing
this.  In version 6.1, we're adding new masking types named "lat" and
"lon".  And then you can define a threshold to specify which points to
include and exclude, like this:
   met-6.1/gen_vx_mask in.grb in.grb out_mask.nc -type lat -thresh
ge20&&le85

However that functionality won't be available until the next release.

For now, in version 6.0, you have 2 choices:

(1) Use the "box" masking type:

   met-6.0/bin/gen_vx_mask G002.grb2 NH_Center_Point.txt
G002_NH_BOX_mask.nc \
      -type box -height 25 -width 150 -name NH

   Where NH_Center_Point.txt is an ascii file defining the center
point of
your masking region:
      NH_Mask
      52.5 -180

   Set the values for height and width on the command line to make the
rectangle bigger/smaller.  The units for height and width are grid
squares.

(2) Use the "data" masking type:

This will take a bit of work.  We need to get a grid 2-dimensional
field of
latitude values.  The tricky part is that MET is "too smart" and
ignores
the "lat" and "lon" variables.  If you'd prefer to go this route, it'd
probably be best to send me a sample file, and I could work up a
method for
getting gen_vx_mask to do what you want.

Hope that helps.

Thanks,
John


On Mon, Apr 17, 2017 at 9:07 AM, Sherrie Fredrick - NOAA Affiliate via
RT <
met_help at ucar.edu> wrote:

>
> Mon Apr 17 09:07:08 2017: Request 80172 was acted upon.
> Transaction: Ticket created by sherrie.fredrick at noaa.gov
>        Queue: met_help
>      Subject: poly lat/lon files
>        Owner: Nobody
>   Requestors: sherrie.fredrick at noaa.gov
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80172 >
>
>
> Good Morning,
>
>     I have made a lat/lon poly files for the Northern Hemisphere the
> lat/lons
> that I am interested in are 85N to 20N then all 360 degrees in the
> longitude.
> I do not believe my file is correct it is not giving me the correct
values.
> I basically just want a rectangle that starts at 85N and ends at 20N
with
> all of 360 degrees longitude.
> What is have is a large file that starts as follows
> 85  then 0 to 180, then -179 to 0
> ........
> 20  0 to 180, then -179 to 0
> at the end is
> 85  -179 to 0 then 180 down to 0
>
> I hope this makes sense.
> Many Thanks for your help
>  Sherrie  Fredrick
>
>

------------------------------------------------
Subject: poly lat/lon files
From: Sherrie Fredrick - NOAA Affiliate
Time: Mon Apr 17 10:51:36 2017

Hi John,

    The box method is probably the best method I think.  I have a
couple of
questions.
1. Does the G002.grb2 NH_Center_Point.tx just contain two values?
Since I
want
    my grid to be from 85N - 20N the center would be 32.5N for lat.  I
would like all 360
    degrees for longitude so would I have 180 for my center longitude.
    So for northern hemisphere I would have
    NH_Mask
     32.5  180.0

    For the Southern hemisphere I would like 20S to 85S so I would
have
    SH_Mask
    -32.5  180.0

     I am not quite sure I under stand what the units of the width and
height of the box.
I have 1 degree grid spacing for lat and lon.
Would my height be 85 - 20 = 65
Would my width be 360?

    Thanks for you help.
     Sherrie

------------------------------------------------
Subject: poly lat/lon files
From: John Halley Gotway
Time: Mon Apr 17 10:59:18 2017

Sherrie,

For the center longitude, MET usually rescales longitudes to the range
of
-180 to 180.  So you may need the central longitude to be 0 instead.

Yes, for a 1 degree global grid, each grid unit covers 1 degree.
You'd
want the width to be 360 and the height to be 65.  But there *might*
be
issues along the edge.  You can safely just set the width to be 365 to
cover all the longitudes.  And double-check the output to make sure
the
latitudes are covered exactly how you expect.

Please just try running it and use "ncview" to display the result...
then
adjust as needed.

Thanks,
John



On Mon, Apr 17, 2017 at 10:51 AM, Sherrie Fredrick - NOAA Affiliate
via RT <
met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80172 >
>
> Hi John,
>
>     The box method is probably the best method I think.  I have a
couple of
> questions.
> 1. Does the G002.grb2 NH_Center_Point.tx just contain two values?
Since I
> want
>     my grid to be from 85N - 20N the center would be 32.5N for lat.
I
> would like all 360
>     degrees for longitude so would I have 180 for my center
longitude.
>     So for northern hemisphere I would have
>     NH_Mask
>      32.5  180.0
>
>     For the Southern hemisphere I would like 20S to 85S so I would
have
>     SH_Mask
>     -32.5  180.0
>
>      I am not quite sure I under stand what the units of the width
and
> height of the box.
> I have 1 degree grid spacing for lat and lon.
> Would my height be 85 - 20 = 65
> Would my width be 360?
>
>     Thanks for you help.
>      Sherrie
>
>

------------------------------------------------
Subject: poly lat/lon files
From: Sherrie Fredrick - NOAA Affiliate
Time: Mon Apr 17 14:05:43 2017

Hi John,

   I hope you are having a nice day.
I was able to produce a .nc file with the gen_vx_mask
 tool.  I then was able to modify the netcdf file that gen_vx_mask
produced with NCL to write out exactly what I wanted.
I ran the grid_stat tool on the modified netcdf file and
got the exact numbers that I get with NCL.  So, thank you very much
for your help.  I think I am on my way now.

   Cheers,
    Sherrie

On Mon, Apr 17, 2017 at 12:59 PM, John Halley Gotway via RT <
met_help at ucar.edu> wrote:

> Sherrie,
>
> For the center longitude, MET usually rescales longitudes to the
range of
> -180 to 180.  So you may need the central longitude to be 0 instead.
>
> Yes, for a 1 degree global grid, each grid unit covers 1 degree.
You'd
> want the width to be 360 and the height to be 65.  But there *might*
be
> issues along the edge.  You can safely just set the width to be 365
to
> cover all the longitudes.  And double-check the output to make sure
the
> latitudes are covered exactly how you expect.
>
> Please just try running it and use "ncview" to display the result...
then
> adjust as needed.
>
> Thanks,
> John
>
>
>
> On Mon, Apr 17, 2017 at 10:51 AM, Sherrie Fredrick - NOAA Affiliate
via RT
> <
> met_help at ucar.edu> wrote:
>
> >
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80172 >
> >
> > Hi John,
> >
> >     The box method is probably the best method I think.  I have a
couple
> of
> > questions.
> > 1. Does the G002.grb2 NH_Center_Point.tx just contain two values?
Since
> I
> > want
> >     my grid to be from 85N - 20N the center would be 32.5N for
lat.  I
> > would like all 360
> >     degrees for longitude so would I have 180 for my center
longitude.
> >     So for northern hemisphere I would have
> >     NH_Mask
> >      32.5  180.0
> >
> >     For the Southern hemisphere I would like 20S to 85S so I would
have
> >     SH_Mask
> >     -32.5  180.0
> >
> >      I am not quite sure I under stand what the units of the width
and
> > height of the box.
> > I have 1 degree grid spacing for lat and lon.
> > Would my height be 85 - 20 = 65
> > Would my width be 360?
> >
> >     Thanks for you help.
> >      Sherrie
> >
> >
>
>

------------------------------------------------
Subject: poly lat/lon files
From: John Halley Gotway
Time: Mon Apr 17 14:06:59 2017

Sherrie,

Great, thanks for letting me know.

John

On Mon, Apr 17, 2017 at 2:05 PM, Sherrie Fredrick - NOAA Affiliate via
RT <
met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80172 >
>
> Hi John,
>
>    I hope you are having a nice day.
> I was able to produce a .nc file with the gen_vx_mask
>  tool.  I then was able to modify the netcdf file that gen_vx_mask
> produced with NCL to write out exactly what I wanted.
> I ran the grid_stat tool on the modified netcdf file and
> got the exact numbers that I get with NCL.  So, thank you very much
> for your help.  I think I am on my way now.
>
>    Cheers,
>     Sherrie
>
> On Mon, Apr 17, 2017 at 12:59 PM, John Halley Gotway via RT <
> met_help at ucar.edu> wrote:
>
> > Sherrie,
> >
> > For the center longitude, MET usually rescales longitudes to the
range of
> > -180 to 180.  So you may need the central longitude to be 0
instead.
> >
> > Yes, for a 1 degree global grid, each grid unit covers 1 degree.
You'd
> > want the width to be 360 and the height to be 65.  But there
*might* be
> > issues along the edge.  You can safely just set the width to be
365 to
> > cover all the longitudes.  And double-check the output to make
sure the
> > latitudes are covered exactly how you expect.
> >
> > Please just try running it and use "ncview" to display the
result... then
> > adjust as needed.
> >
> > Thanks,
> > John
> >
> >
> >
> > On Mon, Apr 17, 2017 at 10:51 AM, Sherrie Fredrick - NOAA
Affiliate via
> RT
> > <
> > met_help at ucar.edu> wrote:
> >
> > >
> > > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=80172 >
> > >
> > > Hi John,
> > >
> > >     The box method is probably the best method I think.  I have
a
> couple
> > of
> > > questions.
> > > 1. Does the G002.grb2 NH_Center_Point.tx just contain two
values?
> Since
> > I
> > > want
> > >     my grid to be from 85N - 20N the center would be 32.5N for
lat.  I
> > > would like all 360
> > >     degrees for longitude so would I have 180 for my center
longitude.
> > >     So for northern hemisphere I would have
> > >     NH_Mask
> > >      32.5  180.0
> > >
> > >     For the Southern hemisphere I would like 20S to 85S so I
would have
> > >     SH_Mask
> > >     -32.5  180.0
> > >
> > >      I am not quite sure I under stand what the units of the
width and
> > > height of the box.
> > > I have 1 degree grid spacing for lat and lon.
> > > Would my height be 85 - 20 = 65
> > > Would my width be 360?
> > >
> > >     Thanks for you help.
> > >      Sherrie
> > >
> > >
> >
> >
>
>

------------------------------------------------


More information about the Met_help mailing list