<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Yes, if PDEF is in play it is trickier, but writing the code to check for undefs at the ends of each row/column is a bit of a nuisance. How about extracting the projected grid lat/lon values from the file outside of GrADS? If it’s netcdf, it’s easy (use ncdump
or put the coordinate variables in the vars list in a descriptor without PDEF). If it’s grib, there’s probably a way to get that info out of the file with wgrib/wgrib2.
<div>—Jennifer<br>
<div><br>
<div><br>
<div>
<div>On Oct 21, 2016, at 2:29 PM, Jeff Duda <<a href="mailto:jeffduda319@gmail.com">jeffduda319@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div dir="ltr">
<div>
<div>All,<br>
</div>
As an FYI, the second method in Jennifer's email, to draw an outline around the model domain, does not work for irregularly shaped or pre-projected domains (e.g., lambert conformal projected grid using 'set mproj latlon'). If you use a control file with an
XDEF and YDEF line, then the grid point 1,1 starts where your XDEF and YDEF lines start, which may not match your domain's actual (1,1) location. Even if it does, then your other corner points will be chopped off the display domain. The only other thing I
can think of would be to cross your display domain and draw a mark when you cross from the UNDEF value to a defined value, indicating you have crossed the domain boundary. You could probably then use some clever and painstaking coding to obtain a list of page
coordinate points and then draw lines between them to outline the domain.<br>
<br>
</div>
Jeff Duda<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Oct 21, 2016 at 8:45 AM, Jennifer M Adams <span dir="ltr">
<<a href="mailto:jadams21@gmu.edu" target="_blank">jadams21@gmu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div>Hi, Mano — </div>
<div>If you want to fill the area of the grid domain with a color of your choice, then you can do this:</div>
<div>‘set rgb 20 100 100 100 100’ ;* a transparent grey</div>
<div>‘set ccolor 20’</div>
<div>‘d const(var,0)’</div>
<div><br>
</div>
<div>If you want to draw an outline, then here is an algorithm to try:</div>
<div>1. Draw a blank plot covering the largest domain to set up the scaling environment</div>
<div>2. Construct a ‘draw line’ command by looping over the grid coordinates at the boundaries (e.g. x=1,y=1:YDEF, y=1,x=1:XDEF, etc.) and using the 'q this2that’ commands (either 'q gr2xy’ or ‘q w2xy’) to get the location in X,Y space of each grid point. </div>
<div><br>
</div>
<div>cmd=‘draw line ‘</div>
<div>loop over edges</div>
<div> cmd=cmd%xpos’ ‘ypos’ '</div>
<div>endloop</div>
<div>cmd</div>
<div><br>
</div>
<div>—Jennifer</div>
<br>
<div>
<div>On Oct 15, 2016, at 10:41 AM, Jeff Duda <<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>> wrote:</div>
<br class="m_5291636530088008100Apple-interchange-newline">
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>There's no simple or easy way to do it. Here are two methods I have used in the past:<br>
<br>
</div>
1) Generate a netcdf grid using whatever library you're familiar with (if any). Make the grid the same size as your model domain. You can make the values inside the grid essentially whatever you want so long as you can bound the outer edge of the domain in
a single contour. I suggest making all values in the domain either 0.0 or 1.0. Then write a control file to display that grid and make sure the value of UNDEF is set to something other than the value on the grid. Then just display the field using gxout contour
and with contour labeling set to off.<br>
<br>
</div>
2) Use gxout fwrite and define any field on that domain using const like 'define field = const(tmp,1,-a)' which essentially does the same thing as in option 1, except it will write the field to a binary file instead of a netcdf file. Then you can just modify
the control file you used for the original data set (assuming you used one), just changing the DSET, DTYPE, and VARS entries to suit your new data. Whatever the name of the field you wrote (in this example, it was defined using the name 'field'), the VARS
entry will become<br>
</div>
VARS 1<br>
</div>
field 0 99 field<br>
</div>
ENDVARS<br>
<br>
</div>
Also make sure to set UNDEF to some value other than the constant value (1 in this example). Then, as in the first suggestion, display the field using gxout contour and with contour labeling off.<br>
<br>
</div>
Once you have the general idea here, you can manipulate the steps to make small alterations to improve the output image.<br>
<br>
</div>
Jeff Duda<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Oct 14, 2016 at 7:59 PM, lpasmanoranjan <span dir="ltr">
<<a href="mailto:lpasmanoranjan@gmail.com" target="_blank">lpasmanoranjan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div class="gmail_quote">
<div dir="ltr">
<div>
<div>Dear GrADS users,<br>
</div>
I would like to ask you a favour.</div>
<div><br>
</div>
<div>I would like to highlight the following three model domains in one figure around my study region (India as center). But I can't able to draw the closed polygons as in the attachment. </div>
<div><br>
</div>
<div>I have three model domains in Lambert conformal conic projection: </div>
<div>MODEL 1: (8S,50E), (8S,90E), (45N,95E), (45N,45E).</div>
<div>MODEL 2: (7S,42E), (7S,92E), (47N,97E), (47N,41E).</div>
<div>MODEL 3: </div>
<div><br>
</div>
<div>Would you please suggest how to do it in grads!!</div>
<div><br>
</div>
<div>Thank you very much for any kind of help or suggestion.</div>
</div>
</div>
</div>
</div>
<span class="m_5291636530088008100HOEnZb"><font color="#888888"></font></span></div>
<span class="m_5291636530088008100HOEnZb"><font color="#888888"><br>
<br>
-- <br>
<div dir="ltr">
<div>Kind Regards,<br>
</div>
Mano<br>
</div>
<br>
</font></span><br>
______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<div class="m_5291636530088008100gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">Jeff Duda<br>
Post-doctoral research associate<br>
University of Oklahoma School of Meteorology<br>
</div>
</div>
</div>
______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
</blockquote>
</div>
<br>
<div>
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;">
<div style="font-size:12px">--</div>
<div style="font-size:12px">Jennifer Miletta Adams<br>
Center for Ocean-Land-Atmosphere Studies (COLA)<br>
George Mason University<br>
<br>
<br>
</div>
</div>
</div>
</div>
<br>
</div>
<br>
______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">Jeff Duda<br>
Post-doctoral research associate<br>
University of Oklahoma School of Meteorology<br>
</div>
</div>
</div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
http://gradsusr.org/mailman/listinfo/gradsusr<br>
</blockquote>
</div>
<br>
<div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="font-size: 12px; orphans: 2; widows: 2;">--</div>
<div style="font-size: 12px; orphans: 2; widows: 2;">Jennifer Miletta Adams<br>
Center for Ocean-Land-Atmosphere Studies (COLA)<br>
George Mason University<br>
<br>
<br>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
</div>
</body>
</html>