# « Displaying Ensemble... | Main | NetCDF4 use of dimen... »

A vgf file is created using the interactive product generation tools within NMAP2. A closed line is drawn enclosing the region of interest, and a text label is grouped with the line assigning a value of 1 to the contour. Once the region of interest is defined, a grid file can be created using the GRPHGD standalone program (It can also be created using the graph-to-grid option in NMAP2).

#### Create grid from VGF file with GRPHGD

``````GEMPAK-GRPHGD>
GUESS    =
PROJ     = MER
GRDAREA  =
KXKY     = 10;10
MAXGRD   = 200
CPYFIL   = #A218
ANLYSS   =
GDATTIM  = 070719/0000f000
GLEVEL   = 0
GVCORD   = none
KEYCOL   =
KEYLINE  =
OLKDAY   =
GGLIMS   =
HISTGRD  = NO
BOUNDS   =
TYPE     = C
GAMMA    = 0.3
SEARCH   = 20
NPASS    = 2
QCNTL    =
GUESFUN  =
CATMAP   =
DISCRETE =
DLINES   = yes;no|-0.5
EDGEOPTS =
GEMPAK-GRPHGD>r
``````

#### Check with GDINFO

``````GEMPAK-GDINFO>
LSTALL   = YES
OUTPUT   = T
GDATTIM  = all
GLEVEL   = 0
GVCORD   = none
GEMPAK-GDINFO>r

PROJECTION:          LCC
ANGLES:                25.0   -95.0    25.0
GRID SIZE:          614 428
LL CORNER:              12.19   -133.46
UR CORNER:              57.33    -49.42

Number of grids in file:     1

NUM       TIME1              TIME2           LEVL1 LEVL2  VCORD PARM
GEMPAK-GDINFO>
``````

The parameter CMASK is created where values greater than 1 are enclosed by the contour. DLINES defines the epsilon of (here -0.5 is used since the contour was drawn counterclockwise) to add to vlaues on either side of the single contour to be define greater / less than the contour value of 1.0.

The grid point values of SGT(cmask,1) (greater than 1.0) as shown here: #### Plot with GDPLOT2

The resultant grid can ge used with the MASK() function and logical operators to define mask or clipping regions of interest. As an example, the 24 hour precipitation in the top panel is masked by the region of interest in the lower panel so that only data within the region of interest will be considered.

``````GDFILE  = nam12 + 2007071900_cmask.grd
GDATTIM  = f030
GLEVEL   = 0
GVCORD   = none
PANEL    = t     ! b
SKIP     = 0
SCALE    = 0
TYPE     = f
CONTUR   = 3/3
CINT     = 0
LINE     = 2/1/2
FINT     = .01;.1;.25;.5;.75;1;1.25;1.5;1.75;2;2.5;3;4;5;6;7;8;9
FLINE    = 0;21-30;14-20;5
HILO     =
HLSYM    =
CLRBAR   = 1
WIND     = BM1
REFVEC   =
TITLE    = 1
TEXT     = 0.7/2/SW
CLEAR    = YES
GAREA    = us
IJSKIP   =
PROJ     = STR/90;-100;0
`````` #### Using GDCSV to find local maximas

The HIGH() function can be used to obtain local maximas from the grid region of interest. The GWFS() gaussian weighted smoothing function can be used to reduce higher frequency features in the grid and focus on broader areas of interest. By using the GDCSV program, the locations of HIGH() output are output to a file for use in determining local mesoscale model domain centers. By masking the region, the model domains are ensured to be within the desired region.

``````GEMPAK-GDCSV>l
GDATTIM  = f030
GLEVEL   = 0
GAREA    = grid
PROJ     = def
GVCORD   = none
SCALE    = 0
OUTPUT   = f/p24i_highs.dat
GEMPAK-GDCSV>r
``````

OUTPUT is to the text file `p24i_highs.dat`. You can use the `sort` command to return the top two local maxima:

``````sort -t, -k 5bnr p24i_highs.dat | head -2

508,     244,        42.3889,       -72.2385,        2.53370
338,     236,        42.9560,       -96.3721,        0.58850
``````

These two values are now scriptable (use `|head -1` for the first and `| head -2 | tail -1` for the second) both for plotting regional areas of interest and for WRF domains. A WRF lesson is outside the reach of this document, but as an example of what is run at Unidata, here is are the primary and secondary regions

#### Plotting again with GDPLOT2 and GPANOT

The locations of the 2 greatest local maximas (42.3889,-72.2385 and 42.9560,-96.3721) are shown along with the precipitation forecast field. The primary and secondary domains can be drawn using GPANOT to overlay the boxes.

First plot masked precipitation, same as above, but change `PANEL = 0` and `CLEAR = n`

``````GDFILE   = nam12 + 2007071900_cmask.grd
GDATTIM  = f030
GLEVEL   = 0
GVCORD   = none
PANEL    = 0
SKIP     = 0
SCALE    = 0
TYPE     = f
CONTUR   = 3/3
CINT     = 0
LINE     = 2/1/2
FINT     = .01;.1;.25;.5;.75;1;1.25;1.5;1.75;2;2.5;3;4;5;6;7;8;9
FLINE    = 0;21-30;14-20;5
HILO     =
HLSYM    =
CLRBAR   = 1
WIND     = BM1
REFVEC   =
TITLE    = 1
TEXT     = 0.7/2/SW
CLEAR    = YES
GAREA    = us
IJSKIP   =
PROJ     = STR/90;-100;0
CLEAR    = n
r
`````` Comments are closed for this entry.
##### Unidata Developer's Blog
A weblog about software development by Unidata developers*
##### Unidata Developer's Blog
A weblog about software development by Unidata developers*

Welcome

FAQs

News@Unidata blog

##### Take a poll!

What if we had an ongoing user poll in here?

##### Browse by Topic
Sun Mon Tue Wed Thu Fri Sat « December 2019 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Today
{"ft_lang_label":"__label__en","ft_lang_prob":0.74814165,"math_prob":0.9734729,"size":4427,"snap":"2019-51-2020-05","text_gpt3_token_len":1605,"char_repetition_ratio":0.09721908,"word_repetition_ratio":0.16818774,"special_character_ratio":0.35351253,"punctuation_ratio":0.16012397,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.957568,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,3,null,3,null,3,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-06T00:22:57Z\",\"WARC-Record-ID\":\"<urn:uuid:c1e8e551-2e58-4ab8-bba4-2a56d0065725>\",\"Content-Length\":\"55485\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d0b194e5-9697-4b2f-9afd-f776cff1a5b1>\",\"WARC-Concurrent-To\":\"<urn:uuid:3e054219-8c7b-426b-8bb2-8de05992a5e7>\",\"WARC-IP-Address\":\"128.117.149.20\",\"WARC-Target-URI\":\"https://www.unidata.ucar.edu/blogs/developer/en/entry/creating_and_using_a_region\",\"WARC-Payload-Digest\":\"sha1:3BB7QNJLNGYBGTJKAHDKXL7AQ35N6UTJ\",\"WARC-Block-Digest\":\"sha1:4YGBA4SWQHE6BV46FH3COGOAAXDICJAO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540482954.0_warc_CC-MAIN-20191206000309-20191206024309-00552.warc.gz\"}"}