<div dir="ltr"><div dir="ltr">Thanks a lot, Dave. Appreciate your valuable suggestions.I'll check those in the model Fortran code. <div><br></div><div>Regards,</div><div>Mansur<br><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 4, 2019 at 3:32 PM Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov">dave.allured@noaa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Mansur,<div><br></div><div>Thanks for explaining the reason for recalculating the lat/lon coordinates. I misunderstood your scenario.</div><div><br></div><div>I notice that your lat/lon calculations assume that the coordinates in each data frame are equally spaced and independent between latitudes and longitudes. In other words, you are assuming 1-dimensional coordinates. You might want to check how the model really locates the output grid points, and ensure your calculations match. Some models place their output points on a map projection such that lats and lons vary independently for every grid point. This is so-called 2-dimensional grid points.</div><div><br></div><div>Your corner points might be a clue. Corner points for 1-D coordinates are often given as four numbers, min/max lat and lon. Corner points for 2-D coordinates are usually given as four coordinate pairs, i.e. eight numbers.</div><div><br></div><div>In a similar situation (Daymet), I found it most reliable to obtain master coordinate grids from the original data supplier, and use the provided X and Y indices to obtain subset coordinate grids for each data tile. The entire business of recalculation was pleasantly avoided. This might be valid in your case, if your data frames are known to be proper subsets of a master grid.</div><div><br></div><div>--Dave</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 3, 2019 at 1:01 PM Mansur Ali Jisan <<a href="mailto:jisan.mansur@gmail.com" target="_blank">jisan.mansur@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Thank you for the replies and suggestions. I think the problem is with the output data frame. It's an output from parametric wind model with moving nest which gives only the lat-long for four corner points of the grid as a separate text file. I suspect there's something wrong with the calculation of those corner points. Thank you again!</div><div dir="ltr"><br><div>Regards,</div><div>Mansur</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 2, 2019 at 5:04 PM Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov" target="_blank">dave.allured@noaa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Mansur,<br><br>1. I strongly advise against generating your own lat and lon coordinates when valid coordinates are provided with the input data. Regeneration can easily lead to blatant or subtle map registration errors, if there are any mistakes.<br><br>2. Your script uses the cylindrical equidistant projection by default. This will produce distortion everywhere except near the equator. To minimize distortion elsewhere, please use a locally conformal map projection. For minimal distortion in a small circular region of the globe, I recommend Azimuthal Equidistant with the tangent point at the center of the region. Lambert Conformal Conic is a good compromise projection, commonly used, for larger mid-latitude regions that are wider east to west, such as continental USA. There are other good choices for small and medium regions.<br><br><a href="https://www.ncl.ucar.edu/Document/Graphics/map_projections.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Graphics/map_projections.shtml</a><br><br>--Dave<br><br><br>On Wed, Jan 2, 2019 at 11:23 AM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:<br>><br>> Hi,<br>><br>> Given the aspect ratio of the underlying data (range of -74.25...-70.17 in lon, 36...46.9 in lat), it seems like the plot produced via gsn_csm_contour_map is about what one would expect ? I see you manually assigned those geographic coordinates to the grid. Are those correct? Do you have other reasons to believe the storm shape should be more circular, rather than elongated?<br>><br>> Not sure what to suggest here...<br>><br>> Rick<br>><br>><br>> On Wed, Jan 2, 2019 at 10:46 AM Mansur Ali Jisan <<a href="mailto:jisan.mansur@gmail.com" target="_blank">jisan.mansur@gmail.com</a>> wrote:<br>>><br>>> Dear NCL Community,<br>>><br>>> I need help with contour map plot for a Hurricane wind field. At first, I used gsn_csm_contour function for making the plot and the shape of the storm looked correct. But when I tried to make a contour map plot using gsn_csm_contour_map, the shape got distorted. I tried to solve this by setting the res@mpShapeMode = "FreeAspect". While it improved the contour plot but the map got stretched. Similarly, I set up the map projection to cylindrical equidistant but still got the same result. I have added the code and PrintVarSummary. Any suggestions will be very helpful. <br>>><br>>> Wishing you a Happy New Year!<br>>><br>>> --------------------------------------------------------------------------------------------------------<br>>><br>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>>> begin<br>>> ntim = 318<br>>> nlat = 1202<br>>> mlon = 1202<br>>><br>>> f1 = addfile("<a href="http://bound_param_diag_var_rough.nc" target="_blank">bound_param_diag_var_rough.nc</a>","r")<br>>> u = f1->um_bot ; 97 x 1202 x 1202<br>>> v = f1->vm_bot<br>>> ws = sqrt(u^2+v^2)<br>>> <br>>> lat = fspan(36.07092, 46.86241,nlat)<br>>> lon = fspan(-74.25677, -70.17657,mlon)<br>>><br>>> lat!0= "lat" ; name dimension<br>>> lat@units = "degrees_north" ; associate units attribute<br>>> lat&lat = lat ; coordinate variable<br>>><br>>> lon!0= "lon"<br>>> lon@units = "degrees_east"<br>>> lon&lon = lon<br>>><br>>> u!0 = "time"<br>>> u!1 = "lat"<br>>> u!2 = "lon"<br>>> u&lat = lat<br>>> u&lon = lon<br>>> v!0 = "time"<br>>> v!1 = "lat"<br>>> v!2 = "lon"<br>>><br>>> v&lat = lat<br>>> v&lon = lon<br>>><br>>> ws!0 = "time"<br>>> ws!1 = "lat"<br>>> ws!2 = "lon"<br>>><br>>> ws&lat = lat<br>>> ws&lon = lon<br>>><br>>> printVarSummary(lat)<br>>> print("-----")<br>>> printVarSummary(lon)<br>>> print("-----")<br>>> printVarSummary(u)<br>>> print("-----")<br>>><br>>> ws = mask(ws,ws.lt.4,False)<br>>> u = mask(u,u.lt.4,False)<br>>> v = mask(v,v.lt.4,False)<br>>><br>>> wks = gsn_open_wks("png","gsn_csm_contour_map")<br>>> res = True<br>>> res@gsnDraw = False<br>>> res@gsnFrame = False<br>>> res@gsnAddCyclic = False<br>>> res@gsnMaximize = True<br>>> res@cnFillOn = True<br>>> res@cnLinesOn = False<br>>> res@cnFillMode = "AreaFill" <br>>> res@cnFillPalette = "matlab_jet" <br>>><br>>> ; res@mpShapeMode = "FreeAspect"<br>>> ; res@vpWidthF = 0.6<br>>> ; res@vpHeightF = 0.5<br>>><br>>> res@tmXBOn = True<br>>> res@tmYLOn = True<br>>> res@tiMainString = "gsn_csm_contour_map"<br>>> res@tmXBMode = "Explicit"<br>>> res@tmXBValues = (/-66, -67, -68, -69, -70, -71, -72, -73, -74, -75, -76, -77/)<br>>> res@tmXBLabels = (/"66W","67W","68W","69W","70W","71W","72W","73W","74W","75W","76W","77W"/)<br>>><br>>> res@tmYLMode = "Explicit"<br>>> res@tmYLValues = (/34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47/)<br>>> res@tmYLLabels = (/"34N","35N","36N","37N","38N","39N","40N","41N","42N","43N","44N","45N","46N","47N"/)<br>>><br>>> res@cnLevelSelectionMode = "ManualLevels"<br>>> res@cnMinLevelValF = 10<br>>> res@cnMaxLevelValF = 80<br>>> res@cnLevelSpacingF = 2.5<br>>><br>>> res@mpFillOn = False<br>>> res@mpGeophysicalLineThicknessF = 2.5<br>>> res@mpOutlineBoundarySets = "geophysicalandusstates"<br>>> res@mpDataBaseVersion = "MediumRes"<br>>> res@mpDataSetName = "Earth..4"<br>>> res@mpGeophysicalLineColor = "Black"<br>>><br>>> res@mpLimitMode = "LatLon"<br>>> res@mpMinLatF = 36.0<br>>> res@mpMaxLatF = 46.0<br>>> res@mpMinLonF = -76.0<br>>> res@mpMaxLonF = -70.0<br>>><br>>> plot = gsn_csm_contour_map(wks,ws(22,:,:),res)<br>>><br>>> draw(plot)<br>>><br>>> frame(wks)<br>>><br>>> end<br>>><br>>> Variable: lat<br>>> Type: float<br>>> Total Size: 4808 bytes<br>>> 1202 values<br>>> Number of Dimensions: 1<br>>> Dimensions and sizes: [lat | 1202]<br>>> Coordinates:<br>>> lat: [36.07092..46.86241]<br>>> Number Of Attributes: 1<br>>> units : degrees_north<br>>> (0) -----<br>>><br>>> Variable: lon<br>>> Type: float<br>>> Total Size: 4808 bytes<br>>> 1202 values<br>>> Number of Dimensions: 1<br>>> Dimensions and sizes: [lon | 1202]<br>>> Coordinates:<br>>> lon: [-74.25677..-70.17657]<br>>> Number Of Attributes: 1<br>>> units : degrees_east<br>>> (0) -----<br>>><br>>> Variable: u<br>>> Type: float<br>>> Total Size: 1837790688 bytes<br>>> 459447672 values<br>>> Number of Dimensions: 3<br>>> Dimensions and sizes: [time | 318] x [lat | 1202] x [lon | 1202]<br>>> Coordinates:<br>>> lat: [36.07091903686523..46.86241149902344]<br>>> lon: [-74.25676727294922..-70.17656707763672]<br>>> Number Of Attributes: 1<br>>> units :<br>>> (0) -----<br>>><br>>> --<br>>> Mansur Ali Jisan<br>>> Ph.D. Student<br>>> URI Graduate School of Oceanography, RI 02882</div>
</blockquote></div><div><br></div>-- <br><div dir="ltr" class="gmail-m_-7414566847594157537gmail-m_6046198006357690465gmail_signature"><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 dir="ltr"><div><b style="font-family:Cambria;font-size:12pt"><span style="font-size:9pt;font-family:Arial">Mansur Ali Jisan</span></b></div><div><span style="font-family:Cambria;font-size:12pt"><span style="font-size:9pt;font-family:Arial">Ph.D. Student</span></span></div><div><span style="font-family:Cambria;font-size:12pt"><span style="font-size:9pt;font-family:Arial">URI Graduate School of Oceanography, RI 02882</span></span></div><div><div><div><a rel="nofollow" href="mailto:hasancee@iut-dhaka.edu" target="_blank"></a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><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 dir="ltr"><div><b style="font-family:Cambria;font-size:12pt"><span style="font-size:9pt;font-family:Arial">Mansur Ali Jisan</span></b></div><div><span style="font-family:Cambria;font-size:12pt"><span style="font-size:9pt;font-family:Arial">Ph.D. Student</span></span></div><div><span style="font-family:Cambria;font-size:12pt"><span style="font-size:9pt;font-family:Arial">URI Graduate School of Oceanography, RI 02882</span></span></div><div><br></div><div><div><div><a rel="nofollow" href="mailto:hasancee@iut-dhaka.edu" target="_blank"></a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>