[Met_help] [rt.rap.ucar.edu #84547] History for Poly mask no longer working with Grid-stat

John Halley Gotway via RT met_help at ucar.edu
Mon Mar 26 12:07:53 MDT 2018


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

Hello,

I am trying to use an old poly mask file I made ~3 years ago which did work
back then, at least with MET5.2.  I'm now using MET6.0 and while I don't
get an error when I try to use it, the fields are empty because no matched
pairs are found within that region.  The mask I am trying to use is from
20-80 degrees latitude for all longitudes, giving me most of the Northern
Hemisphere.  This is the file that used to work:
"20_80N
20 -180
80 -180
80  180
20  180"

I believe I have tried every possible variation of this without success.
Although this file got 60 matched pairs, selecting data from only the 1
degree between 179 and 180 lon, which is not what I want.
"20_80N
20 -180
80 -180
80 179
20 179"

I recently created a new poly file which does work to mask all but the
North Pacific:
"NPac
15  120
70  120
70 -110
15 -110"

I'm stumped as to why the Northern hemisphere mask does not work.  Any help
would be appreciated.

Thanks,
Shannon
-- 
Shannon Rees
UCAR Visiting Scientist
Geophysical Fluid Dynamics Lab
Princeton University Forrestal Campus
201 Forrestal Rd Princeton, NJ
609-452-5384


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

Subject: Poly mask no longer working with Grid-stat
From: John Halley Gotway
Time: Mon Mar 26 09:32:38 2018

Shannon,

I see that you're having trouble with lat/lon polyline files, and I
suspect
that you're applying these to a global grid.  While you and I can
easily
read that list of lat/lon values and decided which points should be
in/outside of the mask it's a bit difficult for the computer since
-180 and
180 degrees longitude are the exact same place on the earth.  Defining
large lat/lon polylines to global grids can be problematic.

For this reason, we added new, and hopefully more straightforward,
functionality to the gen_vx_mask tool.  You can define masking regions
by
applying a threshold to the latitude and longitude values directly.

Here's how you'd define a mask from 20 to 80 degrees north latitude
(I'll
assume you have an input file named gfs.grib):
   gen_vx_mask gfs.grib gfs.grib NH_mask.nc -type lat -thresh
'ge20&&le80'
-name NH_mask

I named the output file NH_mask.nc and I named the masking variable
"NH_mask" as well (-name NH_mask).  In the Grid-Stat config file,
replace
the .poly file with this NetCDF file.

Next, let's say you want latitude from 20 to 80 north AND longitude
from 0
to -180.  Run gen_vx_mask a second time... but passing the output from
the
last call as input to the next one:
   gen_vx_mask NH_mask.nc NH_mask.nc NW_hemisphere.nc -type lon
-thresh
'le0&&ge-180' -name NW_hemisphere -intersection

I named the output file as the northwest hemisphere (NW_hemisphere.nc)
and
defined this as a longitude mask (-type lon) and thresholded between 0
and
-180 (-thresh 'le0&&ge-180').  Lastly, I took the intersection
(-intersection) with the input lat mask and the lon mask I defined in
this
step.

Make sense?

Thanks,
John


On Mon, Mar 26, 2018 at 9:01 AM, Shannon Rees - NOAA Affiliate via RT
<
met_help at ucar.edu> wrote:

>
> Mon Mar 26 09:01:41 2018: Request 84547 was acted upon.
> Transaction: Ticket created by shannon.rees at noaa.gov
>        Queue: met_help
>      Subject: Poly mask no longer working with Grid-stat
>        Owner: Nobody
>   Requestors: shannon.rees at noaa.gov
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=84547 >
>
>
> Hello,
>
> I am trying to use an old poly mask file I made ~3 years ago which
did work
> back then, at least with MET5.2.  I'm now using MET6.0 and while I
don't
> get an error when I try to use it, the fields are empty because no
matched
> pairs are found within that region.  The mask I am trying to use is
from
> 20-80 degrees latitude for all longitudes, giving me most of the
Northern
> Hemisphere.  This is the file that used to work:
> "20_80N
> 20 -180
> 80 -180
> 80  180
> 20  180"
>
> I believe I have tried every possible variation of this without
success.
> Although this file got 60 matched pairs, selecting data from only
the 1
> degree between 179 and 180 lon, which is not what I want.
> "20_80N
> 20 -180
> 80 -180
> 80 179
> 20 179"
>
> I recently created a new poly file which does work to mask all but
the
> North Pacific:
> "NPac
> 15  120
> 70  120
> 70 -110
> 15 -110"
>
> I'm stumped as to why the Northern hemisphere mask does not work.
Any help
> would be appreciated.
>
> Thanks,
> Shannon
> --
> Shannon Rees
> UCAR Visiting Scientist
> Geophysical Fluid Dynamics Lab
> Princeton University Forrestal Campus
> 201 Forrestal Rd Princeton, NJ
> 609-452-5384
>
>

------------------------------------------------
Subject: Poly mask no longer working with Grid-stat
From: Shannon Rees - NOAA Affiliate
Time: Mon Mar 26 10:59:58 2018

Hi John,

OK that makes sense.  I ran into this error when I tried your first
suggestion:

> gen_vx_mask
/archive/s4m/NGGPS/NCEP_fore/Lan/netcdf/2017101200/20171012_00Z_T1534_slp_360x180.nc
NH_mask.nc -type lat -thresh 'ge20&&le80'

ERROR  :

ERROR  : string_to_masktype() -> unsupported masking type "lat"

ERROR  :

Is "lat" not available to use in version 6.0?

Thanks,
Shannon

On Mon, Mar 26, 2018 at 11:32 AM, John Halley Gotway via RT <
met_help at ucar.edu> wrote:

> Shannon,
>
> I see that you're having trouble with lat/lon polyline files, and I
suspect
> that you're applying these to a global grid.  While you and I can
easily
> read that list of lat/lon values and decided which points should be
> in/outside of the mask it's a bit difficult for the computer since
-180 and
> 180 degrees longitude are the exact same place on the earth.
Defining
> large lat/lon polylines to global grids can be problematic.
>
> For this reason, we added new, and hopefully more straightforward,
> functionality to the gen_vx_mask tool.  You can define masking
regions by
> applying a threshold to the latitude and longitude values directly.
>
> Here's how you'd define a mask from 20 to 80 degrees north latitude
(I'll
> assume you have an input file named gfs.grib):
>    gen_vx_mask gfs.grib gfs.grib NH_mask.nc -type lat -thresh
'ge20&&le80'
> -name NH_mask
>
> I named the output file NH_mask.nc and I named the masking variable
> "NH_mask" as well (-name NH_mask).  In the Grid-Stat config file,
replace
> the .poly file with this NetCDF file.
>
> Next, let's say you want latitude from 20 to 80 north AND longitude
from 0
> to -180.  Run gen_vx_mask a second time... but passing the output
from the
> last call as input to the next one:
>    gen_vx_mask NH_mask.nc NH_mask.nc NW_hemisphere.nc -type lon
-thresh
> 'le0&&ge-180' -name NW_hemisphere -intersection
>
> I named the output file as the northwest hemisphere
(NW_hemisphere.nc) and
> defined this as a longitude mask (-type lon) and thresholded between
0 and
> -180 (-thresh 'le0&&ge-180').  Lastly, I took the intersection
> (-intersection) with the input lat mask and the lon mask I defined
in this
> step.
>
> Make sense?
>
> Thanks,
> John
>
>
> On Mon, Mar 26, 2018 at 9:01 AM, Shannon Rees - NOAA Affiliate via
RT <
> met_help at ucar.edu> wrote:
>
> >
> > Mon Mar 26 09:01:41 2018: Request 84547 was acted upon.
> > Transaction: Ticket created by shannon.rees at noaa.gov
> >        Queue: met_help
> >      Subject: Poly mask no longer working with Grid-stat
> >        Owner: Nobody
> >   Requestors: shannon.rees at noaa.gov
> >       Status: new
> >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=84547 >
> >
> >
> > Hello,
> >
> > I am trying to use an old poly mask file I made ~3 years ago which
did
> work
> > back then, at least with MET5.2.  I'm now using MET6.0 and while I
don't
> > get an error when I try to use it, the fields are empty because no
> matched
> > pairs are found within that region.  The mask I am trying to use
is from
> > 20-80 degrees latitude for all longitudes, giving me most of the
Northern
> > Hemisphere.  This is the file that used to work:
> > "20_80N
> > 20 -180
> > 80 -180
> > 80  180
> > 20  180"
> >
> > I believe I have tried every possible variation of this without
success.
> > Although this file got 60 matched pairs, selecting data from only
the 1
> > degree between 179 and 180 lon, which is not what I want.
> > "20_80N
> > 20 -180
> > 80 -180
> > 80 179
> > 20 179"
> >
> > I recently created a new poly file which does work to mask all but
the
> > North Pacific:
> > "NPac
> > 15  120
> > 70  120
> > 70 -110
> > 15 -110"
> >
> > I'm stumped as to why the Northern hemisphere mask does not work.
Any
> help
> > would be appreciated.
> >
> > Thanks,
> > Shannon
> > --
> > Shannon Rees
> > UCAR Visiting Scientist
> > Geophysical Fluid Dynamics Lab
> > Princeton University Forrestal Campus
> > 201 Forrestal Rd Princeton, NJ
> > 609-452-5384
> >
> >
>
>


--
Shannon Rees
UCAR Visiting Scientist
Geophysical Fluid Dynamics Lab
Princeton University Forrestal Campus
201 Forrestal Rd Princeton, NJ
609-452-5384

------------------------------------------------
Subject: Poly mask no longer working with Grid-stat
From: John Halley Gotway
Time: Mon Mar 26 11:14:12 2018

Shannon,

Ah yes, my apologies, it was added in met-6.1.  If you run gen_vx_mask
with
no arguments, you'll see the usage statement for it... and that'll
list the
supported options.

Does you have access to version 6.1 or later?

Thanks,
John

On Mon, Mar 26, 2018 at 10:59 AM, Shannon Rees - NOAA Affiliate via RT
<
met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=84547 >
>
> Hi John,
>
> OK that makes sense.  I ran into this error when I tried your first
> suggestion:
>
> > gen_vx_mask
> /archive/s4m/NGGPS/NCEP_fore/Lan/netcdf/2017101200/20171012_00Z_
> T1534_slp_360x180.nc
> NH_mask.nc -type lat -thresh 'ge20&&le80'
>
> ERROR  :
>
> ERROR  : string_to_masktype() -> unsupported masking type "lat"
>
> ERROR  :
>
> Is "lat" not available to use in version 6.0?
>
> Thanks,
> Shannon
>
> On Mon, Mar 26, 2018 at 11:32 AM, John Halley Gotway via RT <
> met_help at ucar.edu> wrote:
>
> > Shannon,
> >
> > I see that you're having trouble with lat/lon polyline files, and
I
> suspect
> > that you're applying these to a global grid.  While you and I can
easily
> > read that list of lat/lon values and decided which points should
be
> > in/outside of the mask it's a bit difficult for the computer since
-180
> and
> > 180 degrees longitude are the exact same place on the earth.
Defining
> > large lat/lon polylines to global grids can be problematic.
> >
> > For this reason, we added new, and hopefully more straightforward,
> > functionality to the gen_vx_mask tool.  You can define masking
regions by
> > applying a threshold to the latitude and longitude values
directly.
> >
> > Here's how you'd define a mask from 20 to 80 degrees north
latitude (I'll
> > assume you have an input file named gfs.grib):
> >    gen_vx_mask gfs.grib gfs.grib NH_mask.nc -type lat -thresh
> 'ge20&&le80'
> > -name NH_mask
> >
> > I named the output file NH_mask.nc and I named the masking
variable
> > "NH_mask" as well (-name NH_mask).  In the Grid-Stat config file,
replace
> > the .poly file with this NetCDF file.
> >
> > Next, let's say you want latitude from 20 to 80 north AND
longitude from
> 0
> > to -180.  Run gen_vx_mask a second time... but passing the output
from
> the
> > last call as input to the next one:
> >    gen_vx_mask NH_mask.nc NH_mask.nc NW_hemisphere.nc -type lon
-thresh
> > 'le0&&ge-180' -name NW_hemisphere -intersection
> >
> > I named the output file as the northwest hemisphere
(NW_hemisphere.nc)
> and
> > defined this as a longitude mask (-type lon) and thresholded
between 0
> and
> > -180 (-thresh 'le0&&ge-180').  Lastly, I took the intersection
> > (-intersection) with the input lat mask and the lon mask I defined
in
> this
> > step.
> >
> > Make sense?
> >
> > Thanks,
> > John
> >
> >
> > On Mon, Mar 26, 2018 at 9:01 AM, Shannon Rees - NOAA Affiliate via
RT <
> > met_help at ucar.edu> wrote:
> >
> > >
> > > Mon Mar 26 09:01:41 2018: Request 84547 was acted upon.
> > > Transaction: Ticket created by shannon.rees at noaa.gov
> > >        Queue: met_help
> > >      Subject: Poly mask no longer working with Grid-stat
> > >        Owner: Nobody
> > >   Requestors: shannon.rees at noaa.gov
> > >       Status: new
> > >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=84547
> >
> > >
> > >
> > > Hello,
> > >
> > > I am trying to use an old poly mask file I made ~3 years ago
which did
> > work
> > > back then, at least with MET5.2.  I'm now using MET6.0 and while
I
> don't
> > > get an error when I try to use it, the fields are empty because
no
> > matched
> > > pairs are found within that region.  The mask I am trying to use
is
> from
> > > 20-80 degrees latitude for all longitudes, giving me most of the
> Northern
> > > Hemisphere.  This is the file that used to work:
> > > "20_80N
> > > 20 -180
> > > 80 -180
> > > 80  180
> > > 20  180"
> > >
> > > I believe I have tried every possible variation of this without
> success.
> > > Although this file got 60 matched pairs, selecting data from
only the 1
> > > degree between 179 and 180 lon, which is not what I want.
> > > "20_80N
> > > 20 -180
> > > 80 -180
> > > 80 179
> > > 20 179"
> > >
> > > I recently created a new poly file which does work to mask all
but the
> > > North Pacific:
> > > "NPac
> > > 15  120
> > > 70  120
> > > 70 -110
> > > 15 -110"
> > >
> > > I'm stumped as to why the Northern hemisphere mask does not
work.  Any
> > help
> > > would be appreciated.
> > >
> > > Thanks,
> > > Shannon
> > > --
> > > Shannon Rees
> > > UCAR Visiting Scientist
> > > Geophysical Fluid Dynamics Lab
> > > Princeton University Forrestal Campus
> > > 201 Forrestal Rd Princeton, NJ
> > > 609-452-5384
> > >
> > >
> >
> >
>
>
> --
> Shannon Rees
> UCAR Visiting Scientist
> Geophysical Fluid Dynamics Lab
> Princeton University Forrestal Campus
> 201 Forrestal Rd Princeton, NJ
> 609-452-5384
>
>

------------------------------------------------
Subject: Poly mask no longer working with Grid-stat
From: Shannon Rees - NOAA Affiliate
Time: Mon Mar 26 12:04:32 2018

John,

I just installed MET v7.0 and your suggestion worked.  You can close
the
ticket.

Thanks!
Shannon

On Mon, Mar 26, 2018 at 1:14 PM, John Halley Gotway via RT <
met_help at ucar.edu> wrote:

> Shannon,
>
> Ah yes, my apologies, it was added in met-6.1.  If you run
gen_vx_mask with
> no arguments, you'll see the usage statement for it... and that'll
list the
> supported options.
>
> Does you have access to version 6.1 or later?
>
> Thanks,
> John
>
> On Mon, Mar 26, 2018 at 10:59 AM, Shannon Rees - NOAA Affiliate via
RT <
> met_help at ucar.edu> wrote:
>
> >
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=84547 >
> >
> > Hi John,
> >
> > OK that makes sense.  I ran into this error when I tried your
first
> > suggestion:
> >
> > > gen_vx_mask
> > /archive/s4m/NGGPS/NCEP_fore/Lan/netcdf/2017101200/20171012_00Z_
> > T1534_slp_360x180.nc
> > NH_mask.nc -type lat -thresh 'ge20&&le80'
> >
> > ERROR  :
> >
> > ERROR  : string_to_masktype() -> unsupported masking type "lat"
> >
> > ERROR  :
> >
> > Is "lat" not available to use in version 6.0?
> >
> > Thanks,
> > Shannon
> >
> > On Mon, Mar 26, 2018 at 11:32 AM, John Halley Gotway via RT <
> > met_help at ucar.edu> wrote:
> >
> > > Shannon,
> > >
> > > I see that you're having trouble with lat/lon polyline files,
and I
> > suspect
> > > that you're applying these to a global grid.  While you and I
can
> easily
> > > read that list of lat/lon values and decided which points should
be
> > > in/outside of the mask it's a bit difficult for the computer
since -180
> > and
> > > 180 degrees longitude are the exact same place on the earth.
Defining
> > > large lat/lon polylines to global grids can be problematic.
> > >
> > > For this reason, we added new, and hopefully more
straightforward,
> > > functionality to the gen_vx_mask tool.  You can define masking
regions
> by
> > > applying a threshold to the latitude and longitude values
directly.
> > >
> > > Here's how you'd define a mask from 20 to 80 degrees north
latitude
> (I'll
> > > assume you have an input file named gfs.grib):
> > >    gen_vx_mask gfs.grib gfs.grib NH_mask.nc -type lat -thresh
> > 'ge20&&le80'
> > > -name NH_mask
> > >
> > > I named the output file NH_mask.nc and I named the masking
variable
> > > "NH_mask" as well (-name NH_mask).  In the Grid-Stat config
file,
> replace
> > > the .poly file with this NetCDF file.
> > >
> > > Next, let's say you want latitude from 20 to 80 north AND
longitude
> from
> > 0
> > > to -180.  Run gen_vx_mask a second time... but passing the
output from
> > the
> > > last call as input to the next one:
> > >    gen_vx_mask NH_mask.nc NH_mask.nc NW_hemisphere.nc -type lon
-thresh
> > > 'le0&&ge-180' -name NW_hemisphere -intersection
> > >
> > > I named the output file as the northwest hemisphere
(NW_hemisphere.nc)
> > and
> > > defined this as a longitude mask (-type lon) and thresholded
between 0
> > and
> > > -180 (-thresh 'le0&&ge-180').  Lastly, I took the intersection
> > > (-intersection) with the input lat mask and the lon mask I
defined in
> > this
> > > step.
> > >
> > > Make sense?
> > >
> > > Thanks,
> > > John
> > >
> > >
> > > On Mon, Mar 26, 2018 at 9:01 AM, Shannon Rees - NOAA Affiliate
via RT <
> > > met_help at ucar.edu> wrote:
> > >
> > > >
> > > > Mon Mar 26 09:01:41 2018: Request 84547 was acted upon.
> > > > Transaction: Ticket created by shannon.rees at noaa.gov
> > > >        Queue: met_help
> > > >      Subject: Poly mask no longer working with Grid-stat
> > > >        Owner: Nobody
> > > >   Requestors: shannon.rees at noaa.gov
> > > >       Status: new
> > > >  Ticket <URL: https://rt.rap.ucar.edu/rt/Tic
> ket/Display.html?id=84547
> > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > > I am trying to use an old poly mask file I made ~3 years ago
which
> did
> > > work
> > > > back then, at least with MET5.2.  I'm now using MET6.0 and
while I
> > don't
> > > > get an error when I try to use it, the fields are empty
because no
> > > matched
> > > > pairs are found within that region.  The mask I am trying to
use is
> > from
> > > > 20-80 degrees latitude for all longitudes, giving me most of
the
> > Northern
> > > > Hemisphere.  This is the file that used to work:
> > > > "20_80N
> > > > 20 -180
> > > > 80 -180
> > > > 80  180
> > > > 20  180"
> > > >
> > > > I believe I have tried every possible variation of this
without
> > success.
> > > > Although this file got 60 matched pairs, selecting data from
only
> the 1
> > > > degree between 179 and 180 lon, which is not what I want.
> > > > "20_80N
> > > > 20 -180
> > > > 80 -180
> > > > 80 179
> > > > 20 179"
> > > >
> > > > I recently created a new poly file which does work to mask all
but
> the
> > > > North Pacific:
> > > > "NPac
> > > > 15  120
> > > > 70  120
> > > > 70 -110
> > > > 15 -110"
> > > >
> > > > I'm stumped as to why the Northern hemisphere mask does not
work.
> Any
> > > help
> > > > would be appreciated.
> > > >
> > > > Thanks,
> > > > Shannon
> > > > --
> > > > Shannon Rees
> > > > UCAR Visiting Scientist
> > > > Geophysical Fluid Dynamics Lab
> > > > Princeton University Forrestal Campus
> > > > 201 Forrestal Rd Princeton, NJ
> > > > 609-452-5384 <(609)%20452-5384>
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Shannon Rees
> > UCAR Visiting Scientist
> > Geophysical Fluid Dynamics Lab
> > Princeton University Forrestal Campus
> > 201 Forrestal Rd Princeton, NJ
> > 609-452-5384 <(609)%20452-5384>
> >
> >
>
>


--
Shannon Rees
UCAR Visiting Scientist
Geophysical Fluid Dynamics Lab
Princeton University Forrestal Campus
201 Forrestal Rd Princeton, NJ
609-452-5384 <(609)%20452-5384>

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


More information about the Met_help mailing list