<div dir="ltr"><div><div>I did it differently. To display as vectors do something like this:<br><br>d sum(maskout(u10,mag(u10,v10)-max(mag(u10,v10),t=&#39;tmin&#39;,t=&#39;tmax&#39;)),t=&#39;tmin&#39;,t=&#39;tmax&#39;);sum(maskout(v10,mag(u10,v10)-max(mag(u10,v10),t=&#39;tmin&#39;,t=&#39;tmax&#39;)),t=&#39;tmin&#39;,t=&#39;tmax&#39;)<br>

<br></div>The winds at times when the magnitude isn&#39;t equal to the maximum magnitude (all but one hopefully) are masked out in the sum, leaving you with only the wind components at the time of maximum. If you want the vectors displayed as unit vectors, divide each component by the magnitude.<br>

<br></div>Cheers,<br><br>Ted<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 23, 2013 at 1:35 PM, Jeff Duda <span dir="ltr">&lt;<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>&gt;</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><div><div><div><div><div><div><div>Matt,<br></div>Finding the maximum wind speed over a time interval is simple.  Finding the direction at the time of max wind speed (which I assume is what you are looking for) is not quite so simple.<br>

<br>Max speed:<br></div>With your dimension environment set to varying in X and Y (but not T), &#39;d max(mag(u,v,),t=t1,t=t2)&#39;, where t1 and t2 are time index values corresponding to the start and end of the 12Z - 21Z time range in your control file<br>

<br></div>Direction:<br></div>You need to create a dummy field of values.  This is as easy as creating a new array (but give it the name of the final array you want), so something like &#39;d maxdirection = tmp2m&#39;.  Any existing field in your data set is fine - you just need to create it.  You&#39;ll then use the set defval command to overwrite the values of that new field with the values of the wind direction.  To find the direction, you&#39;ll have to use a script and use the maxloc command to get the value of the time index at which the maximum wind speed occurs at a given point.  Then set the dimension environment time index to that value and compute the wind direction at the point using the formula<br>

<br></div>meteorological direction = 270 - mathematical direction<br></div><br></div>where you&#39;ll use the atan2(u,v) to compute the mathematical direction (as an example, if the wind is due westerly with v = 0, the atan2 function will return the value of 0, so 270 - 0 = 270, which is from the west like you want).  Then you write that value to the field using the set defval command.  After you&#39;ve finished defining at every point, &#39;d maxdirection&#39;.<br>

<br></div>NOTE: using set defval to essentially create a new field defined pointwise can be a computationally expensive exercise, especially if the field is complicated (not unlike what you&#39;re doing) and if the grid is large.  So hopefully you don&#39;t need to do this frequently or in a short amount of time.  There may be a better way to do this, but this is the only way I know how.<br>

<br>Jeff Duda<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Sep 23, 2013 at 1:23 PM, Matt Bunkers - WFO UNR <span dir="ltr">&lt;<a href="mailto:matthew.bunkers@noaa.gov" target="_blank">matthew.bunkers@noaa.gov</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<div><br>I have a gridded dataset and would like to find the maximum wind speed and the corresponding direction over a period of time.  For example, given u- and v-components for 12z, 15z, 18z, and 21z, what is the maximum wind speed/direction for each grid point over this time range?</div>



<div><br></div><div>Thanks,</div><div><br></div><div>-- Matt</div></div>
<br></div></div>_______________________________________________<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/listinfo/gradsusr</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br>

</font></span></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>