<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>To examine the contents of the GRIB file:</div><div><br></div><div>%> <b><a href="https://www.ncl.ucar.edu/Document/Tools/ncl_filedump.shtml">ncl_filedump</a> </b>CW_Tskin.grib | less<br></div><div><br></div><div>This provides an '<b>ncdump -h</b>' style look of the grib file [attachment: <b>CW_Tskin.dump</b> ].It also provides value added variables: grid point latitude and longitude and map information.<br></div><div><div><br></div>Using the information contained within the grib file;</div><div><br></div><div>%> ncl <b>CW_CARLOS.ncl</b></div><div><b><br></b></div><div>produced <b>CARLOS_CW_Tskin.grib.png</b></div><div><b><br></b></div><div>Cell mode was used because it was faster. [ I do not know why! ]<br></div><div><br></div><div>Good Luck<br></div><div><b></b></div><div><b><br></b></div><div><b><br></b></div><div><b><br></b></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 15, 2020 at 7:41 PM Rick Brownrigg via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</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>Hi Carlos,</div><div><br></div><div>The map is *probably* OK, I don't know for certain. Looking at planar maps near the poles is weird, and I've seen what you describe with E/W longitudes labeling all sides. But look at greenland on a globe and it kind of makes sense. I think if you set the resource "mpGridAndLimbOn=True", the lines of longitude will make a bit more sense<strong>.</strong></div><div><strong><br></strong></div><div>Rick</div><div><br></div><div><strong></strong></div><div><strong></strong></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 15, 2020 at 12:53 PM Carlos Peralta via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</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">Hello,<div><br></div><div>I am following example 3 here:</div><div><br></div><div><a href="https://www.ncl.ucar.edu/Applications/Scripts/lcnative_3.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/lcnative_3.ncl</a></div><div><br></div><div>to plot a grb file where I am not sure of what the appropriate</div><div>parallels are.</div><div><br></div><div>I get the figure below, which seems correct, but not sure</div><div>why I see the axes displayed with "W" and "E" in both the vertical</div><div>and horizontal. </div><div><br></div><div>thanks for any help.</div><div><br></div><div><br></div><div>My code is below</div><div><br></div><div>;------------------------------------------------<br>; lcnative_3.ncl<br>;------------------------------------------------<br>;<br>; These files are loaded by default in NCL V6.2.0 and newer<br>; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br><br>begin<br><br>;------------------------------------------------<br>; open file and read in data<br>;------------------------------------------------<br> gfile= "./CW_Tskin.grib"<br> f = addfile (gfile, "r")<br> printVarSummary(f)<br> ;fili = "ruc2.bgrb.20020418.i12.f00.grb"<br> ;f = addfile (fili, "r")<br><br> ;vpt = f->VPTMP_252_HYBL<br> vpt = f->TMP_GDS3_HTGL(g3_x_0|:,g3_y_1|:)<br> ;lat2d = f->gridlat_252<br> ;lon2d = f->gridlon_252<br> lat2d=f->g3_lat_0<br> lon2d=f->g3_lon_1<br><div><br></div><div><br></div><div>;------------------------------------------------<br>; create plot<br>;------------------------------------------------<br> wks = gsn_open_wks("png","lcnative") ; send graphics to PNG file<br><br> res = True ; plot mods desired<br> res@tiMainString = "Native Lambert Conformal"<br> res@gsnAddCyclic = False<br>;------------------------------------------------<br>; lambert conformal projections are limited using<br>; the corners method rather than the latlon method<br>; seen for cylindrical equidistant projections<br>;------------------------------------------------<br> res@mpLimitMode = "Corners" ; choose range of map<br> res@mpLeftCornerLatF = lat2d@corners(0)<br> res@mpLeftCornerLonF = lon2d@corners(0)<br> res@mpRightCornerLatF = lat2d@corners(2)<br> res@mpRightCornerLonF = lon2d@corners(2)<br></div><div>;------------------------------------------------<br>; there are many instances when you may not know the<br>; appropriate parallels. Here is a method to find out...<br>; 1) as a first guess, start with the parellels in the<br>; center of the grid.<br>; 2) look at the lines plotted on the map (see below).<br>; you know the projection is correct when the red<br>; and blue lines form a right angle between themselves<br>; and the boundary.<br>; 3) iterate as necessary to get the closest solution.<br>;------------------------------------------------<br> res@mpProjection = "LambertConformal"<br><br> res@mpLambertParallel1F = (max(lat2d)+min(lat2d))*0.5<br> res@mpLambertParallel2F = (max(lat2d)+min(lat2d))*0.5<br> res@mpLambertMeridianF = (max(lon2d)+min(lon2d))*0.5<br><br>;------------------------------------------------<br> res@pmTickMarkDisplayMode = "Always"<br> res@mpFillOn = False ; turn off map fill<br> res@mpOutlineDrawOrder = "PostDraw" ; draw continental outline last<br> res@mpOutlineBoundarySets = "GeophysicalAndUSStates" ; state boundaries<br><br></div><div>;------------------------------------------------<br>; usually, when data is placed onto a map, it is TRANSFORMED to the specified<br>; projection. Since this model is already on a native lambert conformal grid,<br>; we want to turn OFF the transformation.<br>;------------------------------------------------<br><br> res@tfDoNDCOverlay = True<br>; res@tfDoNDCOverlay = "NDCViewport" ; NCL V6.5.0 or later<br><br><br>;------------------------------------------------<br>; set additional resources and create plot<br>;------------------------------------------------<br> res@cnFillOn = True ; color plot desired<br> res@cnLinesOn = False ; turn off contour lines<br> res@cnFillPalette = "gui_default" ; set color map<br> res@gsnFrame = False ; don't advance frame yet<br><br> ;plot = gsn_csm_contour_map(wks,vpt(9,:,:),res) ; draw plot<br> plot = gsn_csm_contour_map(wks,vpt(:,:),res) ; draw plot<br><br>;------------------------------------------------<br>; add lines that help determine correct projection<br>;------------------------------------------------<br> dims = dimsizes(vpt) ; get dimension of grid<br></div><div> ;nlat = dims(1)<br> ;nlon = dims(2)<br> nlat = dims(0)<br> nlon = dims(1)<br><br> gres = True ; polyline mods desired<br> gres@gsLineThicknessF = 3.0 ; line thickness<br> gres@gsLineColor = "Red" ; line color<br> gsn_polyline (wks, plot, lon2d(nlat/2,:), lat2d(nlat/2,:), gres)<br><br> gres@gsLineColor = "Blue"<br> gsn_polyline (wks, plot, lon2d(:,nlon/2), lat2d(:,nlon/2), gres)<br><br> gres@gsLineColor = "Black"<br> gsn_polyline (wks, plot, lon2d(:,0) , lat2d(:,0), gres)<br> gsn_polyline (wks, plot, lon2d(:,nlon-1), lat2d(:,nlon-1), gres)<br> gsn_polyline (wks, plot, lon2d(0,:) , lat2d(0,:), gres)<br> gsn_polyline (wks, plot, lon2d(nlat-1,:), lat2d(nlat-1,:), gres)<br><br> frame(wks)<br><br>end<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><div><img src="cid:ii_kf4bawyk0" alt="image.png" width="440" height="487"><br></div></div><div><br></div><div><br></div><div><br></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>