<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Thank you Denis,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I understand better now!</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Juliette</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> Dennis Shea <shea@ucar.edu><br>
<b>Envoyé :</b> lundi 8 janvier 2018 18:46:15<br>
<b>À :</b> Juliette Lapeyre<br>
<b>Cc :</b> ncl-talk@ucar.edu<br>
<b>Objet :</b> Re: [ncl-talk] unrotate grib2 data projected into polar stereographic projection</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>The:<br>
<br>
formula_u : Uearth = sin(rot)*Vgrid + cos(rot)*Ugrid<br>
formula_v : Vearth = cos(rot)*Vgrid - sin(rot)*Ugrid<br>
<br>
</div>
Are for 'directional' quantities (eg: vectors): the {U/V}grid are the wind components on the rotated grid. *IF* you had vector quantities these equations must be used to transform to winds relative to the earth's poles.<br>
<br>
===<br>
</div>
Your file(s) contain scalar quantities. Hence, no rotation need be performed.<br>
<br>
</div>
Use gridlat_0 and gridlon_0 for plotting<br>
<br>
</div>
f = addfile("CMC_RDPA_APCP...grib2", "r")<br>
; APCP_P8_L1_GST0_acc6h attributes include<br>
: type_of_statistical_processing : Accumulation<br>
; statistical_process_duration : 6 hours (ending at forecast time)<br>
</div>
p6 = f->APCP_P8_L1_GST0_acc6h ; ( ygrid_0, xgrid_0 )<br>
</div>
<div> printVarSummary(p6)<br>
</div>
<div> print(MinMax(p6, 0)<br>
<br>
</div>
; plot<br>
</div>
</div>
<br>
</div>
p6@lat2d = f->gridlat_0 ; for plotting only<br>
</div>
p6@lon2d = f->gridlon_0<br>
<br>
====<br>
</div>
Also, just for fun try<br>
<br>
</div>
%> ncl_filedump CMC_RDPA_APCP...grib2 -itime | less<br>
<br>
</div>
The -itime will add a time (record) dimension<br>
<br>
APCP_P8_L1_GST0_acc6h ( initial_time0_hours, ygrid_0, xgrid_0 )<br>
<br>
</div>
It will also add time information.<br>
<br>
</div>
Good luck<br>
<div>
<div>
<div>
<div>
<div><br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">On Mon, Jan 8, 2018 at 9:01 AM, Juliette Lapeyre via ncl-talk
<span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_7975602380310136680divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hi,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I am using grib2 data from the RDPA CaPA project (<a href="https://weather.gc.ca/grib/grib2_RDPA_ps10km_e.html" class="x_m_7975602380310136680OWAAutoLink" id="x_m_7975602380310136680LPlnk568400" target="_blank">https://weather.gc.ca/grib/<wbr>grib2_RDPA_ps10km_e.html</a>) and
I would like to change the polar stereographic projection to NAD 83/UTM zone 14.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I can that there are three variables that I should use (gridrot_0, gridlat_0, gridlon_0) but I don't understand how to apply the formulas indicated in gridrot_0 (see below). What are exactly Vearth, Vgrid, Uearth and
Ugrid ? I guess "rot" is the value of grid_rot for each coordinate ?</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thanks,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Juliette</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div> gridrot_0 </div>
<div> Size: 493x399</div>
<div> Dimensions: xgrid_0,ygrid_0</div>
<div> Datatype: single</div>
<div> Attributes:</div>
<div> note2 = 'apply formulas to derive u and v components relative to earth'</div>
<div> note1 = 'u and v components of vector quantities are resolved relative to grid'</div>
<div> formula_v = 'Vearth = cos(rot)*Vgrid - sin(rot)*Ugrid'</div>
<div> formula_u = 'Uearth = sin(rot)*Vgrid + cos(rot)*Ugrid'</div>
<div> units = 'radians'</div>
<div> GridType = 'Polar Sterographic Projection (North or South)'</div>
<div> long_name = 'vector rotation angle'</div>
<div> gridlat_0 </div>
<div> Size: 493x399</div>
<div> Dimensions: xgrid_0,ygrid_0</div>
<div> Datatype: single</div>
<div> Attributes:</div>
<div> La1 = 32.5</div>
<div> Lo1 = 225</div>
<div> Lov = 249</div>
<div> Dx = 15</div>
<div> Dy = 15</div>
<div> units = 'degrees_north'</div>
<div> grid_type = 'Polar Sterographic Projection (North or South)'</div>
<div> long_name = 'latitude'</div>
<div> corners = [3.25e+01 2.45e+01 4.63e+01 6.52e+01]</div>
<div> gridlon_0 </div>
<div> Size: 493x399</div>
<div> Dimensions: xgrid_0,ygrid_0</div>
<div> Datatype: single</div>
<div> Attributes:</div>
<div> La1 = 32.5</div>
<div> Lo1 = 225</div>
<div> Lov = 249</div>
<div> Dx = 15</div>
<div> Dy = 15</div>
<div> units = 'degrees_east'</div>
<div> grid_type = 'Polar Sterographic Projection (North or South)'</div>
<div> long_name = 'longitude'</div>
<div> corners = [-1.35e+02 -7.24e+01 -2.10e+01 1.59e+02]</div>
<br>
<br>
<p></p>
<br>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>