<div dir="ltr">Guoqing,<div><br></div><div>This is a known problem.  For all but the simplest projections, it is difficult to regenerate exact coordinates from projection parameters.  To make things worse, some projection parameters are stored imprecisely in Grib1 format, even for simple linear 1-D coordinates.  We ran into this a couple years ago, with ERA-Interim Gaussian grids.</div><div><br></div><div>If you need exact coordinates for complicated projections, then best practice is to not depend at all on regenerated coordinates.  Instead, get reference files with exact original coordinate grids from the data source, and use these original coordinates in your applications.</div><div><br></div><div>Optionally you can double check your reference files against regenerated coordinates, and investigate if maximum offset is more than a few percent of a grid cell.</div><div><br></div><div>--Dave A.</div><div>NOAA/OAR/ESRL/PSD/CIRES</div><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 30, 2018 at 12:32 PM, Guoqing Ge - NOAA Affiliate <span dir="ltr"><<a href="mailto:guoqing.ge@noaa.gov" target="_blank">guoqing.ge@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:small"><div>Dear NCL talk,</div><div><br></div><div>Recently, I found an issue on the generation of grid meshes using a prescribed map projection information. The detail of the problem is as follows:</div><div><br></div><div>When I read HRRR grib files to generate plots, I get lat,lon information form these two NCL-provided variables: </div><div>mylat = t_file-><b>gridlat_0</b><br></div><div style="font-size:12.800000190734863px">mylon = t_file-><b>gridlon_0</b></div><div><br></div><div>The variable summary is as follows:<br></div><div><div><i><br></i></div><div><i>Variable: mylat</i></div><div><i>Type: float</i></div><div><i>Total Size: 7620564 bytes</i></div><div><i>            1905141 values</i></div><div><i>Number of Dimensions: 2</i></div><div><i>Dimensions and sizes:   [ygrid_0 | 1059] x [xgrid_0 | 1799]</i></div><div><i>Coordinates:</i></div><div><i>Number Of Attributes: 11</i></div><div><i>  corners :     ( 21.13812, 21.14055, 47.84219, 47.83862 )</i></div><div><i>  long_name :   latitude</i></div><div><i>  grid_type :   Lambert Conformal (secant, tangent, conical or bipolar)</i></div><div><i>  units :       degrees_north</i></div><div><i>  Latin2 :      38.5</i></div><div><i>  Latin1 :      38.5</i></div><div><i>  Dy :   3</i></div><div><i>  Dx :   3</i></div><div><i>  Lov : 262.5</i></div><div><i>  Lo1 : 237.2805</i></div><div><i>  La1 : 21.13812</i></div></div><div><br></div><div>As show above, the variable contains the prescribed HRRR model map projection information. I believe this information is used by NCL internally to generate lat,lon values. </div><div><br></div><div>The problem is that these re-generated lat,lon values are not consistent with the original HRRR model lat,lon values. </div><div>I printed out lat,lon values for the botten-left corner, center and its surrounding four points, and the upper-right corner as below:</div><div><br></div><div><b style="background-color:rgb(255,255,0)">For original HRRR lat,lon values:</b></div><div><div>(1,1):    21.13812, -122.7195</div><div>c_left:   38.49999,-97.53448</div><div>center:  38.5, -97.5</div><div>c_right: 38.49999,-97.46552</div><div><br></div><div>c_down:  38.47303, -97.5</div><div>center:  38.5, -97.5</div><div>c_up:    38.52699, -97.5</div><div><br></div><div>(nx,ny): 47.84364, -60.90137</div></div><div><br></div><div><b style="background-color:rgb(255,255,0)">For NCL re-genrated lat,lon values based on prescribed HRRR map projection info:</b></div><div><div>(1,1) :  21.13812, -122.7195</div><div><br></div><div>c_left:  38.49724, -97.54045</div><div>center:  38.49725, -97.50597</div><div>c_right: 38.49724, -97.4715</div><div><br></div><div>c_down:  38.47027, -97.50597</div><div>center:  38.49725, -97.50597</div><div>c_up:    38.52422, -97.50598</div><div><br></div><div>(nx,ny): 47.84219, -60.91719</div></div><div><br></div><div>You can see that for the original HRRR lat,lon mesh, the center is exactly (38.5, -97.5) as defined by the map projection info, while the NCL re-gererated lat,lon mesh is <b>not</b> so. Except the bottom-left point, all other lat,lon values from NCL shift from the original HRRR values.</div><div><br></div><div>This NCL behavior caused a slight shift in my physical variable plots (based on GRIB files) as compared to original ones. Could you advise me how NCL generate these lat,lon values? Can you help me examine and fix this issue? </div><div><br></div><div>Let me know if you need more information.</div><div><br></div><div>Thanks,</div><div><br></div><div>Guoqing</div><div><br></div></div><div><div class="m_-6943511393099958739gmail-m_-6885462480858223985gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">--</div><div>Guoqing Ge, PhD</div><div>CIRES Research Scientist<br></div><div>at NOAA/ESRL/GSD (Rm 2B502)<span><br></span></div><div dir="ltr"><span style="color:rgb(0,0,0)">325 Broadway, Boulder, CO 80305</span></div><div dir="ltr"><font color="#000000">(303)497-4163<br></font><div><span style="color:rgb(0,0,0)">&</span></div><div><span style="color:rgb(0,0,0)">Thursdays at</span></div><div><font color="#000000">Developmental</font><span style="color:rgb(0,0,0)"> Testbed Center (FL3-1039)</span></div><div>3450 Mitchell Ln, Boulder, CO 80301<span style="color:rgb(0,0,0)"><br></span></div><div>(303)497-8445</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div></div></div></div></div>