[Met_help] [rt.rap.ucar.edu #98537] History for gen_vx_mask not working as I expected it
John Halley Gotway via RT
met_help at ucar.edu
Fri Feb 5 11:24:37 MST 2021
----------------------------------------------------------------
Initial Request
----------------------------------------------------------------
Hello folks!
I placed two files at ftp://ftp.rap.ucar.edu/incoming/irap/met_help/serra that I use with the following command:
gen_vx_mask -type poly -intersection land_mask.nc Eurasian_boreal.poly Eurasian_boreal.nc
I am not getting the output I am expecting on Eurasian_boreal.nc file; the image of above command is attached.
I use maps.google.com to get the lat,lon pairs in the poly file. I start on France and go across to the east towards Russia, Japan, then counter clockwise.
I have done the opposite in a clockwise sense. I still don't get the land mask of of Eurasia boreal I am after. Your help is greatly appreciated.
Efren A. Serra (Contractor)
Physicist
DeVine Consulting, Inc.
Naval Research Laboratory
Marine Meteorology Division
7 Grace Hopper Ave., STOP 2
Monterey, CA 93943
Code 7542
Mobile: 408-425-5027
----------------------------------------------------------------
Complete Ticket History
----------------------------------------------------------------
Subject: gen_vx_mask not working as I expected it
From: Minna Win
Time: Thu Feb 04 12:19:23 2021
Hi Efren,
I took a look at your Eurasian_boreal.poly file, and it looks like the
last
point:
71.588614 181.105359
should be -179.1, in keeping with the -180 to 180 range for longitude.
I
took a look at some of the poly files that are in MET and they follow
this
convention.
Regards,
Minna
---------------
Minna Win
National Center for Atmospheric Research
Developmental Testbed Center
Phone: 303-497-8423
Fax: 303-497-8401
---------------
Pronouns: she/her
On Thu, Feb 4, 2021 at 11:04 AM efren.serra.ctr at nrlmry.navy.mil via RT
<
met_help at ucar.edu> wrote:
>
> Thu Feb 04 11:03:35 2021: Request 98537 was acted upon.
> Transaction: Ticket created by efren.serra.ctr at nrlmry.navy.mil
> Queue: met_help
> Subject: gen_vx_mask not working as I expected it
> Owner: Nobody
> Requestors: efren.serra.ctr at nrlmry.navy.mil
> Status: new
> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=98537 >
>
>
> Hello folks!
>
> I placed two files at
ftp://ftp.rap.ucar.edu/incoming/irap/met_help/serra
> that I use with the following command:
> gen_vx_mask -type poly -intersection land_mask.nc
Eurasian_boreal.poly
> Eurasian_boreal.nc
>
> I am not getting the output I am expecting on Eurasian_boreal.nc
file; the
> image of above command is attached.
>
> I use maps.google.com to get the lat,lon pairs in the poly file. I
start
> on France and go across to the east towards Russia, Japan, then
counter
> clockwise.
> I have done the opposite in a clockwise sense. I still don't get the
land
> mask of of Eurasia boreal I am after. Your help is greatly
appreciated.
>
> Efren A. Serra (Contractor)
> Physicist
>
> DeVine Consulting, Inc.
> Naval Research Laboratory
> Marine Meteorology Division
> 7 Grace Hopper Ave., STOP 2
> Monterey, CA 93943
> Code 7542
> Mobile: 408-425-5027
>
>
>
------------------------------------------------
Subject: gen_vx_mask not working as I expected it
From: Minna Win
Time: Thu Feb 04 13:39:42 2021
Hi Efren,
That doesn't seem to work. It still looks like Canada and the eastern
part
of Eurasia. I wonder if this has something to do with crossing the
international date line. I'll check with John Halley Gotway and see
if he
has any suggestions.
Thanks,
Minna
---------------
Minna Win
National Center for Atmospheric Research
Developmental Testbed Center
Phone: 303-497-8423
Fax: 303-497-8401
---------------
Pronouns: she/her
On Thu, Feb 4, 2021 at 12:18 PM Minna Win-Gildenmeister
<minnawin at ucar.edu>
wrote:
> Hi Efren,
>
> I took a look at your Eurasian_boreal.poly file, and it looks like
the
> last point:
> 71.588614 181.105359
>
> should be -179.1, in keeping with the -180 to 180 range for
longitude. I
> took a look at some of the poly files that are in MET and they
follow this
> convention.
>
> Regards,
> Minna
> ---------------
> Minna Win
> National Center for Atmospheric Research
> Developmental Testbed Center
> Phone: 303-497-8423
> Fax: 303-497-8401
> ---------------
> Pronouns: she/her
>
>
> On Thu, Feb 4, 2021 at 11:04 AM efren.serra.ctr at nrlmry.navy.mil via
RT <
> met_help at ucar.edu> wrote:
>
>>
>> Thu Feb 04 11:03:35 2021: Request 98537 was acted upon.
>> Transaction: Ticket created by efren.serra.ctr at nrlmry.navy.mil
>> Queue: met_help
>> Subject: gen_vx_mask not working as I expected it
>> Owner: Nobody
>> Requestors: efren.serra.ctr at nrlmry.navy.mil
>> Status: new
>> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=98537 >
>>
>>
>> Hello folks!
>>
>> I placed two files at
ftp://ftp.rap.ucar.edu/incoming/irap/met_help/serra
>> that I use with the following command:
>> gen_vx_mask -type poly -intersection land_mask.nc
Eurasian_boreal.poly
>> Eurasian_boreal.nc
>>
>> I am not getting the output I am expecting on Eurasian_boreal.nc
file;
>> the image of above command is attached.
>>
>> I use maps.google.com to get the lat,lon pairs in the poly file. I
start
>> on France and go across to the east towards Russia, Japan, then
counter
>> clockwise.
>> I have done the opposite in a clockwise sense. I still don't get
the land
>> mask of of Eurasia boreal I am after. Your help is greatly
appreciated.
>>
>> Efren A. Serra (Contractor)
>> Physicist
>>
>> DeVine Consulting, Inc.
>> Naval Research Laboratory
>> Marine Meteorology Division
>> 7 Grace Hopper Ave., STOP 2
>> Monterey, CA 93943
>> Code 7542
>> Mobile: 408-425-5027
>>
>>
>>
------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #98537] gen_vx_mask not working as I expected it
From: efren.serra.ctr at nrlmry.navy.mil
Time: Thu Feb 04 15:00:27 2021
I think it has something to do with the crossing from positive
longitudes to negative longitudes, yes. Thanks.
-----Original Message-----
From: Minna Win via RT <met_help at ucar.edu>
Sent: Thursday, February 4, 2021 12:40 PM
To: Serra, Mr. Efren, Contractor, Code 7531
<efren.serra.ctr at nrlmry.navy.mil>
Cc: juli.rubin at nrl.navy.mil
Subject: Re: [rt.rap.ucar.edu #98537] gen_vx_mask not working as I
expected it
Hi Efren,
That doesn't seem to work. It still looks like Canada and the eastern
part of Eurasia. I wonder if this has something to do with crossing
the international date line. I'll check with John Halley Gotway and
see if he has any suggestions.
Thanks,
Minna
---------------
Minna Win
National Center for Atmospheric Research Developmental Testbed Center
Phone: 303-497-8423
Fax: 303-497-8401
---------------
Pronouns: she/her
On Thu, Feb 4, 2021 at 12:18 PM Minna Win-Gildenmeister
<minnawin at ucar.edu>
wrote:
> Hi Efren,
>
> I took a look at your Eurasian_boreal.poly file, and it looks like
the
> last point:
> 71.588614 181.105359
>
> should be -179.1, in keeping with the -180 to 180 range for
longitude.
> I took a look at some of the poly files that are in MET and they
> follow this convention.
>
> Regards,
> Minna
> ---------------
> Minna Win
> National Center for Atmospheric Research Developmental Testbed
Center
> Phone: 303-497-8423
> Fax: 303-497-8401
> ---------------
> Pronouns: she/her
>
>
> On Thu, Feb 4, 2021 at 11:04 AM efren.serra.ctr at nrlmry.navy.mil via
RT <
> met_help at ucar.edu> wrote:
>
>>
>> Thu Feb 04 11:03:35 2021: Request 98537 was acted upon.
>> Transaction: Ticket created by efren.serra.ctr at nrlmry.navy.mil
>> Queue: met_help
>> Subject: gen_vx_mask not working as I expected it
>> Owner: Nobody
>> Requestors: efren.serra.ctr at nrlmry.navy.mil
>> Status: new
>> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=98537 >
>>
>>
>> Hello folks!
>>
>> I placed two files at
ftp://ftp.rap.ucar.edu/incoming/irap/met_help/serra
>> that I use with the following command:
>> gen_vx_mask -type poly -intersection land_mask.nc
Eurasian_boreal.poly
>> Eurasian_boreal.nc
>>
>> I am not getting the output I am expecting on Eurasian_boreal.nc
file;
>> the image of above command is attached.
>>
>> I use maps.google.com to get the lat,lon pairs in the poly file. I
start
>> on France and go across to the east towards Russia, Japan, then
counter
>> clockwise.
>> I have done the opposite in a clockwise sense. I still don't get
the land
>> mask of of Eurasia boreal I am after. Your help is greatly
appreciated.
>>
>> Efren A. Serra (Contractor)
>> Physicist
>>
>> DeVine Consulting, Inc.
>> Naval Research Laboratory
>> Marine Meteorology Division
>> 7 Grace Hopper Ave., STOP 2
>> Monterey, CA 93943
>> Code 7542
>> Mobile: 408-425-5027
>>
>>
>>
------------------------------------------------
Subject: gen_vx_mask not working as I expected it
From: efren.serra.ctr at nrlmry.navy.mil
Time: Thu Feb 04 15:04:00 2021
Here's a better situation; I may have to attached or form the union of
this mask and the portion of it past the international date line e.g.,
-179.1 up to -168. and between latitudes 49N and 85N. That may work,
but I'd like to hear John's input. Thanks!
-----Original Message-----
From: Minna Win via RT <met_help at ucar.edu>
Sent: Thursday, February 4, 2021 12:40 PM
To: Serra, Mr. Efren, Contractor, Code 7531
<efren.serra.ctr at nrlmry.navy.mil>
Cc: juli.rubin at nrl.navy.mil
Subject: Re: [rt.rap.ucar.edu #98537] gen_vx_mask not working as I
expected it
Hi Efren,
That doesn't seem to work. It still looks like Canada and the eastern
part of Eurasia. I wonder if this has something to do with crossing
the international date line. I'll check with John Halley Gotway and
see if he has any suggestions.
Thanks,
Minna
---------------
Minna Win
National Center for Atmospheric Research Developmental Testbed Center
Phone: 303-497-8423
Fax: 303-497-8401
---------------
Pronouns: she/her
On Thu, Feb 4, 2021 at 12:18 PM Minna Win-Gildenmeister
<minnawin at ucar.edu>
wrote:
> Hi Efren,
>
> I took a look at your Eurasian_boreal.poly file, and it looks like
the
> last point:
> 71.588614 181.105359
>
> should be -179.1, in keeping with the -180 to 180 range for
longitude.
> I took a look at some of the poly files that are in MET and they
> follow this convention.
>
> Regards,
> Minna
> ---------------
> Minna Win
> National Center for Atmospheric Research Developmental Testbed
Center
> Phone: 303-497-8423
> Fax: 303-497-8401
> ---------------
> Pronouns: she/her
>
>
> On Thu, Feb 4, 2021 at 11:04 AM efren.serra.ctr at nrlmry.navy.mil via
RT <
> met_help at ucar.edu> wrote:
>
>>
>> Thu Feb 04 11:03:35 2021: Request 98537 was acted upon.
>> Transaction: Ticket created by efren.serra.ctr at nrlmry.navy.mil
>> Queue: met_help
>> Subject: gen_vx_mask not working as I expected it
>> Owner: Nobody
>> Requestors: efren.serra.ctr at nrlmry.navy.mil
>> Status: new
>> Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=98537 >
>>
>>
>> Hello folks!
>>
>> I placed two files at
ftp://ftp.rap.ucar.edu/incoming/irap/met_help/serra
>> that I use with the following command:
>> gen_vx_mask -type poly -intersection land_mask.nc
Eurasian_boreal.poly
>> Eurasian_boreal.nc
>>
>> I am not getting the output I am expecting on Eurasian_boreal.nc
file;
>> the image of above command is attached.
>>
>> I use maps.google.com to get the lat,lon pairs in the poly file. I
start
>> on France and go across to the east towards Russia, Japan, then
counter
>> clockwise.
>> I have done the opposite in a clockwise sense. I still don't get
the land
>> mask of of Eurasia boreal I am after. Your help is greatly
appreciated.
>>
>> Efren A. Serra (Contractor)
>> Physicist
>>
>> DeVine Consulting, Inc.
>> Naval Research Laboratory
>> Marine Meteorology Division
>> 7 Grace Hopper Ave., STOP 2
>> Monterey, CA 93943
>> Code 7542
>> Mobile: 408-425-5027
>>
>>
>>
------------------------------------------------
Subject: gen_vx_mask not working as I expected it
From: John Halley Gotway
Time: Thu Feb 04 15:06:40 2021
Hi Efren,
Minna asked me to take a look at this issue. She's right, it's the
last
point in the list, which wreaks havoc:
71.588614 181.105359
Running WITHOUT that last point with the following command produces
much
more sane output:
./gen_vx_mask 'latlon 360 180 -90 -180 1 1' Eurasian_boreal.poly
Eurasian_boreal.nc -type poly -v 3; ./plot_data_plane
Eurasian_boreal.nc
Eurasian_boreal.ps 'name="Eurasian_boreal"; level="(*,*)";'; open
Eurasian_boreal.ps
But that's obviously not what you want. The trouble is caused when
lat/lon
polylines extend further than 180 degrees. Adding that last point
makes the
mask cover more than 180 degrees. Here's the line of code where the
logic
goes south:
https://github.com/dtcenter/MET/blob/0fe2e42609120df236f74ae23c07f3fa4b930247/met/src/basic/vx_util/mask_poly.cc#L396
And here's a related GitHub issue about this short-coming:
https://github.com/dtcenter/MET/issues/866
I wonder if there's any way we could recreate this mask using lat/lon
or
shapefile masking types instead?
I got curious and went hunting around. Here's a couple of GIS datasets
that
mention boreal forests:
WorldWildlife fund:
https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-
the-world
The Nature Conservancy: http://maps.tnc.org/gis_data.html
But that seems overly detailed and broken into too many pieces.
I usually use Natural Earth data for country outlines:
https://www.naturalearthdata.com/downloads/
Here's an example of how you could mask out Russia:
# Download and unzip
https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip
gis_dump_dbf ne_50m_admin_0_countries.dbf > dump_dbf
# Look in dump_dbf and note that Russia is record number 75
./gen_vx_mask 'latlon 720 360 -90 -140 0.5 0.5'
ne_50m_admin_0_countries.shp shp_mask.nc -type shape -shapeno 75 -v 3
./plot_data_plane shp_mask.nc shp_mask.ps 'name="shape_mask";
level="(*,*)";'
And here's the result:
[image: Screen Shot 2021-02-04 at 3.05.28 PM.png]
Or using the union like you said is another option. Or, if you have a
file
that contains landuse type that we could threshold, that'd work too.
Thanks,
John
------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #98537] gen_vx_mask not working as I expected it
From: efren.serra.ctr at nrlmry.navy.mil
Time: Fri Feb 05 11:07:29 2021
Thanks to both of you for looking after this issue and for the
thorough explanations. I believe we can close this ticket.
-----Original Message-----
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Thursday, February 4, 2021 2:07 PM
To: Serra, Mr. Efren, Contractor, Code 7531
<efren.serra.ctr at nrlmry.navy.mil>
Cc: juli.rubin at nrl.navy.mil
Subject: Re: [rt.rap.ucar.edu #98537] gen_vx_mask not working as I
expected it
Hi Efren,
Minna asked me to take a look at this issue. She's right, it's the
last point in the list, which wreaks havoc:
71.588614 181.105359
Running WITHOUT that last point with the following command produces
much more sane output:
./gen_vx_mask 'latlon 360 180 -90 -180 1 1' Eurasian_boreal.poly
Eurasian_boreal.nc -type poly -v 3; ./plot_data_plane
Eurasian_boreal.nc Eurasian_boreal.ps 'name="Eurasian_boreal";
level="(*,*)";'; open Eurasian_boreal.ps
But that's obviously not what you want. The trouble is caused when
lat/lon polylines extend further than 180 degrees. Adding that last
point makes the mask cover more than 180 degrees. Here's the line of
code where the logic goes south:
https://github.com/dtcenter/MET/blob/0fe2e42609120df236f74ae23c07f3fa4b930247/met/src/basic/vx_util/mask_poly.cc#L396
And here's a related GitHub issue about this short-coming:
https://github.com/dtcenter/MET/issues/866
I wonder if there's any way we could recreate this mask using lat/lon
or shapefile masking types instead?
I got curious and went hunting around. Here's a couple of GIS datasets
that mention boreal forests:
WorldWildlife fund:
https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-
the-world
The Nature Conservancy: http://maps.tnc.org/gis_data.html
But that seems overly detailed and broken into too many pieces.
I usually use Natural Earth data for country outlines:
https://www.naturalearthdata.com/downloads/
Here's an example of how you could mask out Russia:
# Download and unzip
https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip
gis_dump_dbf ne_50m_admin_0_countries.dbf > dump_dbf # Look in
dump_dbf and note that Russia is record number 75 ./gen_vx_mask
'latlon 720 360 -90 -140 0.5 0.5'
ne_50m_admin_0_countries.shp shp_mask.nc -type shape -shapeno 75 -v 3
./plot_data_plane shp_mask.nc shp_mask.ps 'name="shape_mask";
level="(*,*)";'
And here's the result:
[image: Screen Shot 2021-02-04 at 3.05.28 PM.png]
Or using the union like you said is another option. Or, if you have a
file that contains landuse type that we could threshold, that'd work
too.
Thanks,
John
------------------------------------------------
Subject: RE: [rt.rap.ucar.edu #98537] gen_vx_mask not working as I expected it
From: efren.serra.ctr at nrlmry.navy.mil
Time: Fri Feb 05 11:09:33 2021
John - Thanks so much for the other links and methods to create the
similar masks to what we are after. I am going to look into your links
below.
-----Original Message-----
From: John Halley Gotway via RT <met_help at ucar.edu>
Sent: Thursday, February 4, 2021 2:07 PM
To: Serra, Mr. Efren, Contractor, Code 7531
<efren.serra.ctr at nrlmry.navy.mil>
Cc: juli.rubin at nrl.navy.mil
Subject: Re: [rt.rap.ucar.edu #98537] gen_vx_mask not working as I
expected it
Hi Efren,
Minna asked me to take a look at this issue. She's right, it's the
last point in the list, which wreaks havoc:
71.588614 181.105359
Running WITHOUT that last point with the following command produces
much more sane output:
./gen_vx_mask 'latlon 360 180 -90 -180 1 1' Eurasian_boreal.poly
Eurasian_boreal.nc -type poly -v 3; ./plot_data_plane
Eurasian_boreal.nc Eurasian_boreal.ps 'name="Eurasian_boreal";
level="(*,*)";'; open Eurasian_boreal.ps
But that's obviously not what you want. The trouble is caused when
lat/lon polylines extend further than 180 degrees. Adding that last
point makes the mask cover more than 180 degrees. Here's the line of
code where the logic goes south:
https://github.com/dtcenter/MET/blob/0fe2e42609120df236f74ae23c07f3fa4b930247/met/src/basic/vx_util/mask_poly.cc#L396
And here's a related GitHub issue about this short-coming:
https://github.com/dtcenter/MET/issues/866
I wonder if there's any way we could recreate this mask using lat/lon
or shapefile masking types instead?
I got curious and went hunting around. Here's a couple of GIS datasets
that mention boreal forests:
WorldWildlife fund:
https://www.worldwildlife.org/publications/terrestrial-ecoregions-of-
the-world
The Nature Conservancy: http://maps.tnc.org/gis_data.html
But that seems overly detailed and broken into too many pieces.
I usually use Natural Earth data for country outlines:
https://www.naturalearthdata.com/downloads/
Here's an example of how you could mask out Russia:
# Download and unzip
https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip
gis_dump_dbf ne_50m_admin_0_countries.dbf > dump_dbf # Look in
dump_dbf and note that Russia is record number 75 ./gen_vx_mask
'latlon 720 360 -90 -140 0.5 0.5'
ne_50m_admin_0_countries.shp shp_mask.nc -type shape -shapeno 75 -v 3
./plot_data_plane shp_mask.nc shp_mask.ps 'name="shape_mask";
level="(*,*)";'
And here's the result:
[image: Screen Shot 2021-02-04 at 3.05.28 PM.png]
Or using the union like you said is another option. Or, if you have a
file that contains landuse type that we could threshold, that'd work
too.
Thanks,
John
------------------------------------------------
More information about the Met_help
mailing list