[Met_help] [rt.rap.ucar.edu #99861] History for Met Tool v10.0: ERROR reading shapefile with gen_vx_mask tool

John Halley Gotway via RT met_help at ucar.edu
Wed May 12 11:59:29 MDT 2021


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

Hello,

I am getting an error when trying to mask a grib2 file with this shapefile. This shapefile is able to be read by NCL, geopandas, and other online shapefile viewers. What could possibly be the issue?

[root at 1cd93cacb09b gen_vx_mask]# gen_vx_mask postwrf_d03_20210410_0000_f00000.gr2 svc_trty.shp -shapeno 0 pge_territory_mask
DEBUG 1: Input Grid:            postwrf_d03_20210410_0000_f00000.gr2
DEBUG 1: Mask File:             svc_trty.shp
DEBUG 2: Parsed Input Grid:     Lambert Conformal (396 x 480)
ERROR  :
ERROR  : MaskPoly::load() -> read error on line number 4 of mask poly file "svc_trty.shp"
ERROR  :


Thanks,

A.J. Eiserloh - Data Scientist
PG&E - Meteorology Systems and Analytics
Applied Technology Services
3400 Crow Canyon Rd., San Ramon, CA 94583-1393
925-307-4492





[root at 1cd93cacb09b gen_vx_mask]# gen_vx_mask postwrf_d03_20210410_0000_f00000.gr2 svc_trty.shp -shapeno 0 pge_territory_mask
DEBUG 1: Input Grid:            postwrf_d03_20210410_0000_f00000.gr2
DEBUG 1: Mask File:             svc_trty.shp
DEBUG 2: Parsed Input Grid:     Lambert Conformal (396 x 480)
ERROR  :
ERROR  : MaskPoly::load() -> read error on line number 4 of mask poly file "svc_trty.shp"
ERROR  :


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

Subject: Met Tool v10.0:  ERROR reading shapefile with gen_vx_mask tool
From: John Halley Gotway
Time: Wed May 12 10:09:54 2021

Hello,

I see you have a question about shapefile masking in the gen_vx_mask
tool.
I'm not sure what version of gen_vx_mask you're running.

When I test using version 9.1.3, the latest bugfix version for the 9.1
release, and using the very newly released 10.0.0, it does run without
error. Since you didn't send the actual WRF file, I just tested using
data
on the NAM grid. However, a shape consisting of 47,973 points will
take a
LONG time to run... still running as I'm sending this message.

met-9.1.3/bin/gen_vx_mask nam_2012040900_F012.grib2  svc_trty.shp
svn_trty_mask.nc -shapeno 0 -type shape
DEBUG 1: Input Grid:
/Volumes/d1/projects/MET/MET_unit_test/MET_test_input/model_data/grib2/nam/nam_2012040900_F012.grib2
DEBUG 1: Mask File: svc_trty.shp
DEBUG 2: Parsed Input Grid: Lambert Conformal (614 x 428)
DEBUG 2: Parsed Shape Mask: svc_trty.shp containing 47973 points

So what version of gen_vx_mask are you running?

Thanks,
John Halley Gotway

On Wed, May 12, 2021 at 7:16 AM George McCabe via RT
<met_help at ucar.edu>
wrote:

>
> Wed May 12 07:16:49 2021: Request 99861 was acted upon.
> Transaction: Given to johnhg (John Halley Gotway) by mccabe
>        Queue: met_help
>      Subject: Met Tool v10.0:  ERROR reading shapefile with
gen_vx_mask
> tool
>        Owner: johnhg
>   Requestors: AJEB at pge.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=99861 >
>
>
> This transaction appears to have no content
>

------------------------------------------------
Subject: Met Tool v10.0:  ERROR reading shapefile with gen_vx_mask tool
From: Eiserloh Jr., A.J.
Time: Wed May 12 10:21:02 2021

Hello,

I am running it the latest docker container version of the latest
version 10.0.0, from dtcenter/met

I attached my wrf data grib2 file. When I try to open the regular
netcdf wrfout file, it gives me the error that it can't even open to
read the file. It only get's past that error if I use the grib2. Not
sure why it does not like this shapefile.

AJ

-----Original Message-----
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Wednesday, May 12, 2021 9:10 AM
To: Eiserloh Jr., A.J. <AJEB at pge.com>
Subject: Re: [rt.rap.ucar.edu #99861] Met Tool v10.0: ERROR reading
shapefile with gen_vx_mask tool

*****CAUTION: This email was sent from an EXTERNAL source. Think
before clicking links or opening attachments.*****

Hello,

I see you have a question about shapefile masking in the gen_vx_mask
tool.
I'm not sure what version of gen_vx_mask you're running.

When I test using version 9.1.3, the latest bugfix version for the 9.1
release, and using the very newly released 10.0.0, it does run without
error. Since you didn't send the actual WRF file, I just tested using
data on the NAM grid. However, a shape consisting of 47,973 points
will take a LONG time to run... still running as I'm sending this
message.

met-9.1.3/bin/gen_vx_mask nam_2012040900_F012.grib2  svc_trty.shp
svn_trty_mask.nc -shapeno 0 -type shape DEBUG 1: Input Grid:
/Volumes/d1/projects/MET/MET_unit_test/MET_test_input/model_data/grib2/nam/nam_2012040900_F012.grib2
DEBUG 1: Mask File: svc_trty.shp
DEBUG 2: Parsed Input Grid: Lambert Conformal (614 x 428) DEBUG 2:
Parsed Shape Mask: svc_trty.shp containing 47973 points

So what version of gen_vx_mask are you running?

Thanks,
John Halley Gotway

On Wed, May 12, 2021 at 7:16 AM George McCabe via RT
<met_help at ucar.edu>
wrote:

>
> Wed May 12 07:16:49 2021: Request 99861 was acted upon.
> Transaction: Given to johnhg (John Halley Gotway) by mccabe
>        Queue: met_help
>      Subject: Met Tool v10.0:  ERROR reading shapefile with
> gen_vx_mask tool
>        Owner: johnhg
>   Requestors: AJEB at pge.com
>       Status: new
>  Ticket <URL:
>
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Frt.r
>
ap.ucar.edu%2Frt%2FTicket%2FDisplay.html%3Fid%3D99861&data=04%7C01
>
%7CAJEB%40pge.com%7Ce065fc422c7a4e4718b708d915606300%7C44ae661aece641a
>
abc967c2c85a08941%7C0%7C0%7C637564325990655422%7CUnknown%7CTWFpbGZsb3d
>
8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
>
1000&sdata=I4UdQtrQnh%2FD%2BUhI84Zf4vq%2FMTLUjF9LpGx5pTzGr7A%3D&am
> p;reserved=0 >
>
>
> This transaction appears to have no content
>


------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #99861] Met Tool v10.0: ERROR reading shapefile with gen_vx_mask tool
From: Eiserloh Jr., A.J.
Time: Wed May 12 10:46:03 2021

I am also testing gen_vx_mask on an older version  complied locally
onto linux:

MET Version:    V8.1
Repository:     https://svn-met-dev.cgd.ucar.edu/tags/met/met-8.1
Revision:       6381
Change Date:    2019-05-03 17:12:28 -0600 (Fri, 03 May 2019)

And, I am getting the same errors. I read in the svc_trty.shp
shapefile with NCL to check it out and noticed that the x and y points
were reversed, so then I loaded the shapefile into geopandas, saved it
with CRS: EPSG=4326 and then it looked like it fixed that part. When I
read it in with the new shapefile, it got past the first shapefile
error  and now gives me this new error (on both versions this is the
same result) :

DEBUG 1: Input File:            postwrf_d03_20210512_0000_f00100.gr2
DEBUG 1: Mask File:             svc_territory.shp
DEBUG 2: Parsed Data Grid:      Lambert Conformal (396 x 480)
DEBUG 2: Parsed Lat/Lon Mask:   (nul) containing 0 points
ERROR  :
ERROR  : NumArray::operator[](int) const -> range check error ...
Nelements = 0, i = 0
ERROR  :

Thanks,
AJ


-----Original Message-----
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Wednesday, May 12, 2021 9:10 AM
To: Eiserloh Jr., A.J. <AJEB at pge.com>
Subject: Re: [rt.rap.ucar.edu #99861] Met Tool v10.0: ERROR reading
shapefile with gen_vx_mask tool

*****CAUTION: This email was sent from an EXTERNAL source. Think
before clicking links or opening attachments.*****

Hello,

I see you have a question about shapefile masking in the gen_vx_mask
tool.
I'm not sure what version of gen_vx_mask you're running.

When I test using version 9.1.3, the latest bugfix version for the 9.1
release, and using the very newly released 10.0.0, it does run without
error. Since you didn't send the actual WRF file, I just tested using
data on the NAM grid. However, a shape consisting of 47,973 points
will take a LONG time to run... still running as I'm sending this
message.

met-9.1.3/bin/gen_vx_mask nam_2012040900_F012.grib2  svc_trty.shp
svn_trty_mask.nc -shapeno 0 -type shape DEBUG 1: Input Grid:
/Volumes/d1/projects/MET/MET_unit_test/MET_test_input/model_data/grib2/nam/nam_2012040900_F012.grib2
DEBUG 1: Mask File: svc_trty.shp
DEBUG 2: Parsed Input Grid: Lambert Conformal (614 x 428) DEBUG 2:
Parsed Shape Mask: svc_trty.shp containing 47973 points

So what version of gen_vx_mask are you running?

Thanks,
John Halley Gotway

On Wed, May 12, 2021 at 7:16 AM George McCabe via RT
<met_help at ucar.edu>
wrote:

>
> Wed May 12 07:16:49 2021: Request 99861 was acted upon.
> Transaction: Given to johnhg (John Halley Gotway) by mccabe
>        Queue: met_help
>      Subject: Met Tool v10.0:  ERROR reading shapefile with
> gen_vx_mask tool
>        Owner: johnhg
>   Requestors: AJEB at pge.com
>       Status: new
>  Ticket <URL:
>
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Frt.r
>
ap.ucar.edu%2Frt%2FTicket%2FDisplay.html%3Fid%3D99861&data=04%7C01
>
%7CAJEB%40pge.com%7Ce065fc422c7a4e4718b708d915606300%7C44ae661aece641a
>
abc967c2c85a08941%7C0%7C0%7C637564325990655422%7CUnknown%7CTWFpbGZsb3d
>
8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
>
1000&sdata=I4UdQtrQnh%2FD%2BUhI84Zf4vq%2FMTLUjF9LpGx5pTzGr7A%3D&am
> p;reserved=0 >
>
>
> This transaction appears to have no content
>



------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #99861] Met Tool v10.0: ERROR reading shapefile with gen_vx_mask tool
From: Eiserloh Jr., A.J.
Time: Wed May 12 10:58:02 2021

A good update:

After testing it some more, I tested with the exact way and option you
used for your command and now it is working properly (on both
versions). I reread the documentation and realized default type was
"poly", and I did not realize that I need '-type shape' option. I
thought it would know that automatically based on the file type and
the '.shp' suffix.

Thanks,
AJ

-----Original Message-----
From: Eiserloh Jr., A.J.
Sent: Wednesday, May 12, 2021 9:21 AM
To: met_help at ucar.edu
Subject: RE: [rt.rap.ucar.edu #99861] Met Tool v10.0: ERROR reading
shapefile with gen_vx_mask tool

Hello,

I am running it the latest docker container version of the latest
version 10.0.0, from dtcenter/met

I attached my wrf data grib2 file. When I try to open the regular
netcdf wrfout file, it gives me the error that it can't even open to
read the file. It only get's past that error if I use the grib2. Not
sure why it does not like this shapefile.

AJ

-----Original Message-----
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Wednesday, May 12, 2021 9:10 AM
To: Eiserloh Jr., A.J. <AJEB at pge.com>
Subject: Re: [rt.rap.ucar.edu #99861] Met Tool v10.0: ERROR reading
shapefile with gen_vx_mask tool

*****CAUTION: This email was sent from an EXTERNAL source. Think
before clicking links or opening attachments.*****

Hello,

I see you have a question about shapefile masking in the gen_vx_mask
tool.
I'm not sure what version of gen_vx_mask you're running.

When I test using version 9.1.3, the latest bugfix version for the 9.1
release, and using the very newly released 10.0.0, it does run without
error. Since you didn't send the actual WRF file, I just tested using
data on the NAM grid. However, a shape consisting of 47,973 points
will take a LONG time to run... still running as I'm sending this
message.

met-9.1.3/bin/gen_vx_mask nam_2012040900_F012.grib2  svc_trty.shp
svn_trty_mask.nc -shapeno 0 -type shape DEBUG 1: Input Grid:
/Volumes/d1/projects/MET/MET_unit_test/MET_test_input/model_data/grib2/nam/nam_2012040900_F012.grib2
DEBUG 1: Mask File: svc_trty.shp
DEBUG 2: Parsed Input Grid: Lambert Conformal (614 x 428) DEBUG 2:
Parsed Shape Mask: svc_trty.shp containing 47973 points

So what version of gen_vx_mask are you running?

Thanks,
John Halley Gotway

On Wed, May 12, 2021 at 7:16 AM George McCabe via RT
<met_help at ucar.edu>
wrote:

>
> Wed May 12 07:16:49 2021: Request 99861 was acted upon.
> Transaction: Given to johnhg (John Halley Gotway) by mccabe
>        Queue: met_help
>      Subject: Met Tool v10.0:  ERROR reading shapefile with
> gen_vx_mask tool
>        Owner: johnhg
>   Requestors: AJEB at pge.com
>       Status: new
>  Ticket <URL:
>
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Frt.r
>
ap.ucar.edu%2Frt%2FTicket%2FDisplay.html%3Fid%3D99861&data=04%7C01
>
%7CAJEB%40pge.com%7Ce065fc422c7a4e4718b708d915606300%7C44ae661aece641a
>
abc967c2c85a08941%7C0%7C0%7C637564325990655422%7CUnknown%7CTWFpbGZsb3d
>
8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
>
1000&sdata=I4UdQtrQnh%2FD%2BUhI84Zf4vq%2FMTLUjF9LpGx5pTzGr7A%3D&am
> p;reserved=0 >
>
>
> This transaction appears to have no content
>



------------------------------------------------
Subject: Met Tool v10.0:  ERROR reading shapefile with gen_vx_mask tool
From: John Halley Gotway
Time: Wed May 12 11:28:03 2021

AJ,

Ah! Wish I'd noticed that right away. My apologies.

Yes, the default type is "-type poly" which dates back to several
years ago
back when "gen_vx_mask" was named "gen_poly_mask".

You're right that we could add logic to have the tool make a guess.
But
there are several scenarios when that guess would be wrong.

Instead, it may be wise to just change "-type" from an optional
argument to
a required one. That would've avoided this issue entirely.

Glad you got it sorted.

Thanks,
John

On Wed, May 12, 2021 at 10:58 AM Eiserloh Jr., A.J. via RT <
met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=99861 >
>
> A good update:
>
> After testing it some more, I tested with the exact way and option
you
> used for your command and now it is working properly (on both
versions). I
> reread the documentation and realized default type was "poly", and I
did
> not realize that I need '-type shape' option. I thought it would
know that
> automatically based on the file type and the '.shp' suffix.
>
> Thanks,
> AJ
>
> -----Original Message-----
> From: Eiserloh Jr., A.J.
> Sent: Wednesday, May 12, 2021 9:21 AM
> To: met_help at ucar.edu
> Subject: RE: [rt.rap.ucar.edu #99861] Met Tool v10.0: ERROR reading
> shapefile with gen_vx_mask tool
>
> Hello,
>
> I am running it the latest docker container version of the latest
version
> 10.0.0, from dtcenter/met
>
> I attached my wrf data grib2 file. When I try to open the regular
netcdf
> wrfout file, it gives me the error that it can't even open to read
the
> file. It only get's past that error if I use the grib2. Not sure why
it
> does not like this shapefile.
>
> AJ
>
> -----Original Message-----
> From: John Halley Gotway via RT <met_help at ucar.edu>
> Sent: Wednesday, May 12, 2021 9:10 AM
> To: Eiserloh Jr., A.J. <AJEB at pge.com>
> Subject: Re: [rt.rap.ucar.edu #99861] Met Tool v10.0: ERROR reading
> shapefile with gen_vx_mask tool
>
> *****CAUTION: This email was sent from an EXTERNAL source. Think
before
> clicking links or opening attachments.*****
>
> Hello,
>
> I see you have a question about shapefile masking in the gen_vx_mask
tool.
> I'm not sure what version of gen_vx_mask you're running.
>
> When I test using version 9.1.3, the latest bugfix version for the
9.1
> release, and using the very newly released 10.0.0, it does run
without
> error. Since you didn't send the actual WRF file, I just tested
using data
> on the NAM grid. However, a shape consisting of 47,973 points will
take a
> LONG time to run... still running as I'm sending this message.
>
> met-9.1.3/bin/gen_vx_mask nam_2012040900_F012.grib2  svc_trty.shp
> svn_trty_mask.nc -shapeno 0 -type shape DEBUG 1: Input Grid:
>
>
/Volumes/d1/projects/MET/MET_unit_test/MET_test_input/model_data/grib2/nam/nam_2012040900_F012.grib2
> DEBUG 1: Mask File: svc_trty.shp
> DEBUG 2: Parsed Input Grid: Lambert Conformal (614 x 428) DEBUG 2:
Parsed
> Shape Mask: svc_trty.shp containing 47973 points
>
> So what version of gen_vx_mask are you running?
>
> Thanks,
> John Halley Gotway
>
> On Wed, May 12, 2021 at 7:16 AM George McCabe via RT
<met_help at ucar.edu>
> wrote:
>
> >
> > Wed May 12 07:16:49 2021: Request 99861 was acted upon.
> > Transaction: Given to johnhg (John Halley Gotway) by mccabe
> >        Queue: met_help
> >      Subject: Met Tool v10.0:  ERROR reading shapefile with
> > gen_vx_mask tool
> >        Owner: johnhg
> >   Requestors: AJEB at pge.com
> >       Status: new
> >  Ticket <URL:
> >
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Frt.r
> >
ap.ucar.edu%2Frt%2FTicket%2FDisplay.html%3Fid%3D99861&data=04%7C01
> >
%7CAJEB%40pge.com%7Ce065fc422c7a4e4718b708d915606300%7C44ae661aece641a
> >
abc967c2c85a08941%7C0%7C0%7C637564325990655422%7CUnknown%7CTWFpbGZsb3d
> >
8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C
> >
1000&sdata=I4UdQtrQnh%2FD%2BUhI84Zf4vq%2FMTLUjF9LpGx5pTzGr7A%3D&am
> > p;reserved=0 >
> >
> >
> > This transaction appears to have no content
> >
>
>
>
>

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


More information about the Met_help mailing list