[Met_help] [rt.rap.ucar.edu #83374] History for conversion of shapefile to ascii for MET use

John Halley Gotway via RT met_help at ucar.edu
Wed Jul 10 16:59:45 MDT 2019


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

To whom it may concern,

In early September I was asking the help desk about how to convert RFC
shape files to an ascii type format to be used in MET for masking purposes.
John Gotway had responded in detail and suggested if I posted some data
that he might be able to use the developer utilities to convert them to
ascii. So I posted a tar file with the component shape files for the West
Gulf Coast RFC on the ucar anonymous ftp site to see if it might still be
possible to get some help with the polyline issue. The surname for the ftp
data was diehl and the directory was diehl_data, with file rfc.tar.

I appreciate any assistance, Brad Diehl


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

Subject: conversion of shapefile to ascii for MET use
From: Howard Soh
Time: Wed Dec 20 13:38:01 2017

The tar file was downloaded to dakota at
/d3/personal/hsoh/data/shapefile directory.

Cheers,
Howard

On Wed Dec 20 13:09:45 2017, brad.diehl at noaa.gov wrote:
> To whom it may concern,
>
> In early September I was asking the help desk about how to convert
RFC
> shape files to an ascii type format to be used in MET for masking
purposes.
> John Gotway had responded in detail and suggested if I posted some
data
> that he might be able to use the developer utilities to convert them
to
> ascii. So I posted a tar file with the component shape files for the
West
> Gulf Coast RFC on the ucar anonymous ftp site to see if it might
still be
> possible to get some help with the polyline issue. The surname for
the ftp
> data was diehl and the directory was diehl_data, with file rfc.tar.
>
> I appreciate any assistance, Brad Diehl



------------------------------------------------
Subject: conversion of shapefile to ascii for MET use
From: Howard Soh
Time: Wed Dec 20 13:46:19 2017

Unfortunately, most of our met_help staff is out this week and next,
so our response time will be delayed. John is currently out, too. I
downloaded the tar file to our local storage. John will take care of
this later.

Cheers,
Howard

On Wed Dec 20 13:09:45 2017, brad.diehl at noaa.gov wrote:
> To whom it may concern,
>
> In early September I was asking the help desk about how to convert
RFC
> shape files to an ascii type format to be used in MET for masking
purposes.
> John Gotway had responded in detail and suggested if I posted some
data
> that he might be able to use the developer utilities to convert them
to
> ascii. So I posted a tar file with the component shape files for the
West
> Gulf Coast RFC on the ucar anonymous ftp site to see if it might
still be
> possible to get some help with the polyline issue. The surname for
the ftp
> data was diehl and the directory was diehl_data, with file rfc.tar.
>
> I appreciate any assistance, Brad Diehl



------------------------------------------------
Subject: conversion of shapefile to ascii for MET use
From: John Halley Gotway
Time: Wed Dec 20 21:13:37 2017

Hi Brad,

Sorry for dropping the ball on this one.

I grabbed your shapefiles and ran them through some development
utilities
in MET.  The WGRFC poly actually consists of 11 separate pieces.

So I created 11 separate .poly files (WGRFC_##.poly where ## is 01 to
11).
In order to test them, I used to the gen_vx_mask utility to compute
the
union of the 11 subregions.  And I had to pick a grid on which to run
this... so I picked the HRRR domain which is very high resolution over
CONUS (1799x1059 = 1,905,141 grid points).

The total number of HRRR grid points included in the union is 117,701
of
which 117,608 fall inside polyline number 11.  So the vast majority of
the
WGRFC region is contained in polyline number 11.  That polyline
consists of
24,226 lat/lon points... which makes gen_vx_mask run very slowly...
about
29 minutes on my machine.

Here's how I looped through the polylines to compute the union...

#########################

# Run gen_vx_mask to get a NetCDF file for HRRR with all 0's

/usr/local/met-6.1/bin/gen_vx_mask \

  hrrr.t00z.wrfsfcf00.grib2 hrrr.t00z.wrfsfcf00.grib2 hrrr_cur.nc \

  -type data -mask_field 'name="TMP"; level="Z2";' -thresh gt10000 -v
4

# Loop through the 11 polylines

foreach poly ( `ls *.poly` )


  # Run gen_vx_mask to do polyline masking, taking the union with
previous
masks,

  # and naming the output variable WGRFC

  /usr/local/met-6.1/bin/gen_vx_mask hrrr_cur.nc $poly hrrr_mask.nc
-name
WGRFC -union -v 4


  # Copy the gen_vx_mask output to hrrr_cur.nc for the next loop
iteration

  cp hrrr_mask.nc hrrr_cur.nc


end


#########################


Once that finished, I ran the plot_data_plane utility to display the
masking region:

#########################

  met-6.1/bin/plot_data_plane hrrr_mask.nc hrrr_mask.ps 'name="WGRFC";
level="(*,*)";'
  convert -rotate 90 -background white -flatten hrrr_mask.ps
hrrr_mask.png

#########################

The resulting image is attached.  Additionally, I copied the *.poly,
*.png,
and *.nc files to our anonymous ftp site:
   ftp.rap.ucar.edu/incoming/irap/met_help/diehl_data/from_john.tar.gz

Hopefully this will help get you going.

Some good news, we plan to add support for reading shapefiles directly
in
the next version of MET in 2018.  Probably just enhance gen_vx_mask to
read
them rather than the statistics tools themselves.  That should make
this
whole process much easier!

Thanks,
John

On Wed, Dec 20, 2017 at 1:46 PM, Howard Soh via RT <met_help at ucar.edu>
wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=83374 >
>
> Unfortunately, most of our met_help staff is out this week and next,
so
> our response time will be delayed. John is currently out, too. I
downloaded
> the tar file to our local storage. John will take care of this
later.
>
> Cheers,
> Howard
>
> On Wed Dec 20 13:09:45 2017, brad.diehl at noaa.gov wrote:
> > To whom it may concern,
> >
> > In early September I was asking the help desk about how to convert
RFC
> > shape files to an ascii type format to be used in MET for masking
> purposes.
> > John Gotway had responded in detail and suggested if I posted some
data
> > that he might be able to use the developer utilities to convert
them to
> > ascii. So I posted a tar file with the component shape files for
the West
> > Gulf Coast RFC on the ucar anonymous ftp site to see if it might
still be
> > possible to get some help with the polyline issue. The surname for
the
> ftp
> > data was diehl and the directory was diehl_data, with file
rfc.tar.
> >
> > I appreciate any assistance, Brad Diehl
>
>
>
>

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


More information about the Met_help mailing list