<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), 'd max(mag(u,v,),t=t1,t=t2)', 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 'd maxdirection = tmp2m'. Any existing field in your data set is fine - you just need to create it. You'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'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'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've finished defining at every point, 'd maxdirection'.<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're doing) and if the grid is large. So hopefully you don'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">On Mon, Sep 23, 2013 at 1:23 PM, Matt Bunkers - WFO UNR <span dir="ltr"><<a href="mailto:matthew.bunkers@noaa.gov" target="_blank">matthew.bunkers@noaa.gov</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">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>_______________________________________________<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><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>
</div>