Thanks Matthias and James! That did the trick. I sure do appreciate all the help on this.<br><br>btw: I ended up having to use 270 to convert to the proper angle:<br><br>d skip(cos((270-DIRPWsfc) * 3.14159/180),3,3); skip(sin((270-DIRPWsfc) * 3.14159/180),3,3)<br>
<br>Thanks again, <br><br>-Nathan<br>
<br><br><div class="gmail_quote">On Wed, Nov 4, 2009 at 10:18 AM, Matthias Fripp <span dir="ltr">&lt;<a href="mailto:matthias.fripp@eci.ox.ac.uk">matthias.fripp@eci.ox.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
That&#39;s right -- I just checked this page ( <a href="http://polar.ncep.noaa.gov/waves/products.html" target="_blank">http://polar.ncep.noaa.gov/waves/products.html</a><br>
�), which reports that the datasets use the &quot;oceanographical<br>
convention&quot;, and this page ( <a href="http://www.aims.gov.au/pages/facilities/oceanographic-buoys/ob-1.html" target="_blank">http://www.aims.gov.au/pages/facilities/oceanographic-buoys/ob-1.html</a><br>
�), which says that the oceanographic convention is to show &quot;the<br>
direction the current is flowing towards, measured in degrees<br>
clockwise from North&quot;.<br>
<br>
If you replace DIRPWsfc with (90 - DIRPWsfc), you can convert between<br>
the two conventions. So that would give you<br>
<br>
set gxout vector<br>
display cos((90-DIRPWsfc) * 3.14159/180); sin((90-DIRPWsfc) *<br>
3.14159/180)<br>
<br>
Sorry about that -- I&#39;m so used to the physicists&#39; approach to angles<br>
that I forgot about the real world!<br><font color="#888888">
<br>
Matthias</font><div><div></div><div class="h5"><br>
<br>
On Nov 4, 2009, at 6:10 PM, James T. Potemra wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Nathan:<br>
<br>
Matthias suggestion is correct, but I think you need to be careful<br>
with<br>
the direction. �His calculation<br>
presumes that the direction is measured counterclockwise from the east<br>
(so a direction of zero would<br>
be a wave headed due east, direction 90 would be headed north, and so<br>
on). �The direction from the<br>
model is probably compass heading (0 is north). �So, you might have to<br>
add an extra step to convert<br>
the direction angle.<br>
<br>
Jim<br>
<br>
Nathan Cool wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Matthias. I sure do appreciate the help. That produced some<br>
interesting results, but it didn&#39;t seem accurate (arrows pointing in<br>
some rather bizarre directions). Perhaps though this is a data<br>
problem, and I need to grab different GRIB files? Currently, I&#39;m<br>
using<br>
GRIBs from the NCEP server:<br>
<a href="ftp://polar.ncep.noaa.gov/pub/waves/latest_run/" target="_blank">ftp://polar.ncep.noaa.gov/pub/waves/latest_run/</a><br>
<br>
-Nathan<br>
<br>
<br>
On Wed, Nov 4, 2009 at 7:53 AM, Matthias Fripp<br>
&lt;<a href="mailto:matthias.fripp@eci.ox.ac.uk" target="_blank">matthias.fripp@eci.ox.ac.uk</a> &lt;mailto:<a href="mailto:matthias.fripp@eci.ox.ac.uk" target="_blank">matthias.fripp@eci.ox.ac.uk</a>&gt;&gt;<br>
wrote:<br>
<br>
 � How about this:<br>
<br>
 � set gxout vector<br>
 � display cos(DIRPWsfc * 3.14159/180); sin(DIRPWsfc * 3.14159/180)<br>
<br>
 � This converts the wave direction from degrees to radians, and then<br>
 � calculates its u and v components.<br>
<br>
 � Matthias<br>
<br>
 � On Nov 4, 2009, at 2:38 PM, Nathan Cool wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 � Thanks, but I&#39;m not trying to display &quot;wind&quot; vector arrows;<br>
 � instead, I&#39;m trying to display the primary wave direction.<br>
<br>
 � The vars in the Grib are:<br>
 � ------------------------<br>
 � DIRPWsfc �0 107,1,1 �** surface Primary wave direction [deg]<br>
 � DIRSWsfc �0 109,1,1 �** surface Secondary wave direction [deg]<br>
 � HTSGWsfc �0 100,1,1 �** surface Sig height of wind waves and<br>
 � swell [m]<br>
 � PERPWsfc �0 108,1,1 �** surface Primary wave mean period [s]<br>
 � PERSWsfc �0 110,1,1 �** surface Secondary wave mean period [s]<br>
 � UGRDsfc �0 33,1,1 �** surface u wind [m/s]<br>
 � VGRDsfc �0 34,1,1 �** surface v wind [m/s]<br>
 � WDIRsfc �0 31,1,1 �** surface Wind direction [deg]<br>
 � WINDsfc �0 32,1,1 �** surface Wind speed [m/s]<br>
 � WVDIRsfc �0 101,1,1 �** surface Direction of wind waves [deg]<br>
 � WVPERsfc �0 103,1,1 �** surface Mean period of wind waves [s]<br>
<br>
 � ...and I can see that others have been able to show the primary<br>
 � wave direction (DIRPWsfc) using vector arrows, as is the case on<br>
 � the FNMOC models like this one:<br>
 � <a href="https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif" target="_blank">https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif</a><br>
<br>
 � Do you know how this can be done?<br>
<br>
 � Thanks,<br>
<br>
 � -Nathan<br>
<br>
<br>
 � On Tue, Nov 3, 2009 at 9:58 PM, sushant puranik<br>
 � &lt;<a href="mailto:sushantpuranik@gmail.com" target="_blank">sushantpuranik@gmail.com</a> &lt;mailto:<a href="mailto:sushantpuranik@gmail.com" target="_blank">sushantpuranik@gmail.com</a>&gt;&gt;<br>
wrote:<br>
<br>
 � � � Hi<br>
 � � � I am able to generate wind direction. try his<br>
 � � � &#39;set arrscl 1 30&#39;<br>
 � � � &#39;set cthick 5&#39;<br>
 � � � &#39;set arrowhead 0.10&#39;<br>
 � � � &#39;set clevs 3 5 10 15 20 25&#39;<br>
 � � � &#39;set ccols 0 4 1 2 3 5 12&#39;<br>
 � � � &#39;set gxout vector&#39;<br>
 � � � &#39;d<br>
 � � � skip(UGRDsfc,2,2);skip(VGRDsfc,<br>
2,2);skip(sqrt(UGRDsfc*UGRDsfc+VGRDsfc*VGRDsfc),2,2)&#39;<br>
 � � � &#39;run <a href="http://cbar.gs" target="_blank">cbar.gs</a> &lt;<a href="http://cbar.gs" target="_blank">http://cbar.gs</a>&gt;&#39;<br>
 � � � &#39;printim wind(m/s)&#39;<br>
<br>
 � � � with the help of such script i am able to generate output<br>
 � � � which is attached with this mail.<br>
<br>
 � � � all the best.<br>
<br>
<br>
 � � � On Tue, Nov 3, 2009 at 9:45 PM, Nathan Cool<br>
 � � � &lt;<a href="mailto:nathan@nathancool.com" target="_blank">nathan@nathancool.com</a> &lt;mailto:<a href="mailto:nathan@nathancool.com" target="_blank">nathan@nathancool.com</a>&gt;&gt; wrote:<br>
<br>
 � � � � � Good morning everyone,<br>
<br>
 � � � � � I&#39;m generating wave analysis models, but I&#39;m having a<br>
 � � � � � tough time showing the mean-wave (or primary) wave<br>
 � � � � � direction arrows.<br>
<br>
 � � � � � The vars in the Grib are:<br>
 � � � � � -------------------------------------------------<br>
 � � � � � DIRPWsfc �0 107,1,1 �** surface Primary wave direction<br>
[deg]<br>
 � � � � � DIRSWsfc �0 109,1,1 �** surface Secondary wave direction<br>
 � � � � � [deg]<br>
 � � � � � HTSGWsfc �0 100,1,1 �** surface Sig height of wind waves<br>
 � � � � � and swell [m]<br>
 � � � � � PERPWsfc �0 108,1,1 �** surface Primary wave mean<br>
period [s]<br>
 � � � � � PERSWsfc �0 110,1,1 �** surface Secondary wave mean<br>
 � � � � � period [s]<br>
 � � � � � UGRDsfc �0 33,1,1 �** surface u wind [m/s]<br>
 � � � � � VGRDsfc �0 34,1,1 �** surface v wind [m/s]<br>
 � � � � � WDIRsfc �0 31,1,1 �** surface Wind direction [deg]<br>
 � � � � � WINDsfc �0 32,1,1 �** surface Wind speed [m/s]<br>
 � � � � � WVDIRsfc �0 101,1,1 �** surface Direction of wind waves<br>
[deg]<br>
 � � � � � WVPERsfc �0 103,1,1 �** surface Mean period of wind<br>
waves [s]<br>
<br>
 � � � � � For displaying wind vector arrows it&#39;s straightforward as<br>
 � � � � � there are U and V variables (UGRDsfc and VGRDsfc) for the<br>
 � � � � � zonal and meridional components. Displaying primary wave<br>
 � � � � � direction though seems more elusive, yet I see it done on<br>
 � � � � � many models such as the following:<br>
 � � � � � <a href="https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif" target="_blank">https://www.fnmoc.navy.mil/ww3_cgi/dynamic/ww3.w.npac.sig_wav_ht.000.gif</a><br>
<br>
 � � � � � ...which was generated using GrADS by FNMOC.<br>
<br>
 � � � � � Any help you can provide would be greatly appreciated,<br>
 � � � � � and thank you for your time.<br>
<br>
 � � � � � --<br>
 � � � � � Nathan Cool<br>
 � � � � � <a href="mailto:nathan@nathancool.com" target="_blank">nathan@nathancool.com</a> &lt;mailto:<a href="mailto:nathan@nathancool.com" target="_blank">nathan@nathancool.com</a>&gt;<br>
<br>
<br>
<br>
<br>
 � � � --<br>
 � � � Sushant Puranik<br>
 � � � Junior Research Fellow<br>
 � � � Dept. of Atmospheric &amp; Space Sciences,<br>
 � � � University of Pune,<br>
 � � � Pune-07,<br>
 � � � India.<br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote></blockquote>
</div></div></blockquote></div><br>