<div dir="ltr"><div><div><div><div><div>THX for the files. <br><br></div>re: "I assumed the 2d lat/lon gridding is the same for both."<br><br></div>I am not sure what you mean by this.<br><br></div>As we often note on ncl-talk, the most important rule in data processing is 'look at the data'<br><br></div>I looked via ncl_filedump (ncdump -h) so they are not the same.<br><br>Then via ncl interactively<br><br>ncl 0> fVIS = addfile("<a href="http://goes12_1_2011_094_1815.BRIT.VIS.nc">goes12_1_2011_094_1815.BRIT.VIS.nc</a>","r")<br>ncl 1> fIR = addfile("<a href="http://goes13_4_2013_208_2215.temp.IR.nc">goes13_4_2013_208_2215.temp.IR.nc</a>","r") <br>ncl 2> lat2d_VIS = fVIS->lat<br>ncl 3> lat2d_IR = fIR->lat <br><br>ncl 5> printVarSummary(lat2d_VIS)<br><br>Variable: lat2d_VIS<br>Type: float<br>Total Size: 256080 bytes<br> 64020 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [yc | 165] x [xc | 388]<br>Coordinates: <br>Number Of Attributes: 2<br> long_name : lat<br> units : degrees_north<br><br>ncl 6> printVarSummary(lat2d_IR) <br><br>Variable: lat2d_IR<br>Type: float<br>Total Size: 1925120 bytes<br> 481280 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [yc | 640] x [xc | 752]<br>Coordinates: <br>Number Of Attributes: 2<br> long_name : lat<br> units : degrees_north<br>====<br></div>So they have different dimension sizes.<br>====<br><br>ncl 7> print("lat2d_VIS: min="+min(lat2d_VIS)+" max="+max(lat2d_VIS))<br><br>(0) lat2d_VIS: min=-3.49818 max=-2.00916 <=== VERY NARROW (~ 1.5 degrees)<br> lon2d_VIS: min=-60.995 max=-58.9998 <=== "" (~2 degree range)<br><br>ncl 8> print("lat2d_IR: min="+min(lat2d_IR)+" max="+max(lat2d_IR)) <br><br>(0) lat2d_IR: min=9.05268 max=2.14329e+09 <========================<br><div> lon2d_IR: min=-153.341 max=2.14329e+09 <==========================<br><br>--------<br><br></div><div>Further, the varuiable 'data' on the IR file has<br><br> float data(time, yc, xc) ;<br> data:long_name = "Temperature" ;<br> data:type = "GVAR" ;<br> data:coordinates = "lon lat" ;<br> data:units = "K" ;<br><br>There is no _FillValue or missing_value attribute.<br><br>But looking at the values you get<br><br>data =<br> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <br> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <br> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <br> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <br> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <br> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <br> 0, 284.9, 284.9, 285, 285, 285, 284.9, 285, 284.9, 284.5, 284.1, 284.4, <br> 284.9, 285, 285, 285, 284.4, 283.9, 283.9, 283.6, 283.7, 283.6, 283.7, <br> 283.9, 283.9, 284.1, 284.1, 284.1, 284.1, 284.1, 284.1, 284.1, 284.2, <br> 284.1, 284.1, 284.1, 284.2, 284.4, 284.4, 284.8, 285.4, 290.1, 296.2, <br> 297, 296.3, 297.9, 301.7, 303, 304.2, 305.9, 306.2, 307, 308.4, 307.2, <br></div><div>[snip]<br><br></div><div>Clearly, the data variable should have: data@_FillValue = 0.0<br><br></div><div>Also, on the IR file the lat and lon variables should indicate an _FillValue.<br> <br></div><div> lat2d_IR@_FillValue = max(lat2d_IR) ; 2.14329e+09</div><div> lon2d_IR ......<br></div><div><br>=============================<br><br></div><div>In order to address these values the user must add extra information.<br></div><div>In particular, the IR file contents need manual intervention.<br><br></div><div>Using the data on the file without being aware of its' issues<br></div><div>is a recipe for programming problems and confusion.<br><br></div><div>D<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 16, 2014 at 10:24 AM, David Adams <span dir="ltr"><<a href="mailto:dave.k.adams@gmail.com" target="_blank">dave.k.adams@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Dennis,<br>here are two examples. One GOES IR over Mexico and<br></div>one GOES visible over the central Amazon (Manaus). I assumed the 2d lat/lon gridding is the same for both.<br><div><div><br>GOES IR<br><a href="http://goes13_4_2013_208_2215.temp.nc" target="_blank">goes13_4_2013_208_2215.temp.nc</a><br><br>GOES VIS<br><a href="http://goes12_1_2011_094_1815.BRIT.nc" target="_blank">goes12_1_2011_094_1815.BRIT.nc</a><br><br><div class="gmail_extra">thanks for the help,<br></div><div class="gmail_extra">Dave<br></div><div class="gmail_extra"><br><br><br><div class="gmail_quote">On Thu, Oct 16, 2014 at 10:33 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Yes. It looks good to me. <br><br></div>If you send a sample GOES file, an of GOES=>rectilinear gris could be added to the ESMF regridding page. Then, you could use<br><br> <a href="http://www.ncl.ucar.edu/Applications/narr.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/narr.shtml</a><br>Example 5<br><br></div>ftp <a href="http://ftp.cgd.ucar.edu" target="_blank">ftp.cgd.ucar.edu</a><br>anonymous<br>email<br></div>cd incoming<br></div>put ... GOES.. <br></div>quit<br><br></div>Then you could send the name of the file (offline to reduce ncl-talk traffic).<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 16, 2014 at 9:11 AM, David Adams <span dir="ltr"><<a href="mailto:dave.k.adams@gmail.com" target="_blank">dave.k.adams@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div>Thanks Mary, Dennis,<br>I made a really big mistake not getting the regular gridded data from the GOES people at Wisconsin.<br><br></div>Looking at the example<br><a href="http://www.ncl.ucar.edu/Applications/narr.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/narr.shtml</a><br>Example 6<br><br></div>to set the x-labels (with actual longitude values), I have to consider both dimensions (x,y) of the longitude dimension, correct?<br></div>I would have to do something like this in the example 6<br><br><pre> ml = 200
resx@tmXBValues := toint( fspan(0,nlat-1,nLabels) )
do i=0,nLabels-1
x = lon2d(resx@tmXBValues(i),ml)
y = lat2d(resx@tmXBValues(i),ml)
resx@tmXBLabels(i) = sprintf("%5.1f", y)+"~C~"+sprintf("%5.1f", x)
end do</pre>where lon2d would be<br> lon2d= new_lon(0,:,:)<br> lat2d= new_lat(0,:,:)<br><br></div>(I made another mistake with ncecat and ncrcat. somehow adding a time dimension to lat and lon)<br><div><div><div><div><div><br></div><div>thanks in advance,<br>Dave<br></div><div><br><br></div></div></div></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 10:15 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>See the following: example of subscripting 2-dimensional array coordinates<br><a href="http://www.ncl.ucar.edu/Applications/narr.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/narr.shtml</a><br></div>Example 6<br><br></div>---<br></div>To get a 'classic' cross section (ie, a vertical profile ata constant latitude or longitude), you must interpolate the curvilinear grid to to a rectilinear grid.<br><br><a href="http://www.ncl.ucar.edu/Applications/ESMF.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/ESMF.shtml</a><br></div>Example 30<br><br></div>To use the weight file generated by Example 30,<br><br><div><a href="http://www.ncl.ucar.edu/Applications/narr.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/narr.shtml</a><br></div>Example 5<br><br></div>This shows classic cross sections (constant lat ot lon) AND<br></div>an arbitrary slice <br><br></div>Good luck<br><div><div><div><div><div><br></div></div></div></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 9:02 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:small">Dave,</div><div style="font-size:small"><br></div><div style="font-size:small">I think the issue here is simply that "new_temp" is dimensioned time x lat x lon, and since you want a time x lon plot, you need to subscript the "lat" dimension somehow. </div><div style="font-size:small"><br></div><div style="font-size:small">i.e.</div><div style="font-size:small"><br></div><div style="font-size:small"><span style="font-family:arial,sans-serif;font-size:12.8px"> plot = gsn_csm_contour(wks,new_temp(:,0,:), res)</span><div style="font-family:arial,sans-serif;font-size:12.8px"></div></div><div style="font-size:small"><span style="font-family:arial,sans-serif;font-size:12.8px"><br></span></div><div><font face="arial, sans-serif">I'm just selecting the first latitude dimension, but you need to set this to whatever you want.</font></div><span><font color="#888888"><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">--Mary</font></div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 14, 2014 at 11:41 AM, David Adams <span dir="ltr"><<a href="mailto:dave.k.adams@gmail.com" target="_blank">dave.k.adams@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Hi Mary et al.<br></div>I think I am misunderstanding how<span><br><br> res@sfYArray = new_time<br> res@sfXArray = new_lon<br><br></span></div>work. Do I have to redefine the original variable new_temp in terms of these dimensions? And, if so, how?<br><br></div>I am getting this error.<br><br> gsn_csm_contour: Fatal: the input data array must be 1D or 2D<br>fatal:Illegal right-hand side type for assignment<br>fatal:Execute: Error occurred at or near line 74 in file lon_time_plots.ncl<br><br><div>Here is the code.<br>thanks in advance,<br>Dave<br></div><div><br>;*********************************<br>; read variable<br>;*********************************<br> f = addfile("/home/dadams/Mini_Campaign_NAME/2013_GOES_data/<a href="http://test.nc" target="_blank">test.nc</a>","r")<br> new_temp = f->new_temp ; float new_temp(time, yc, xc) <br>; printVarSummary(new_temp)<br>;*********************************<br>;<br>;*********************************<span><br> new_lat = f->new_lat<br> new_lon = f->new_lon<br></span> time = f->time<span><br> new_time = conform(new_lon(:,0,:),time,0)<br><br></span>;*********************************<br>; create plot<br>;*********************************<br> pltName = "goes"<br> pltType = "pdf" ; "ps", "eps", "pdf", "png"<br> pltDir = "./"<br><br> wks = gsn_open_wks(pltType, pltDir+pltName)<br> gsn_define_colormap(wks,"BlAqGrYeOrReVi200"); choose a color map<br><br> res = True<br> res@cnFillOn = True ; turn on color<br> res@cnFillMode = "RasterFill" ; cell mode<br> res@cnLinesOn = False ; Turn off contour lines<span><br><br> res@sfYArray = new_time<br> res@sfXArray = new_lon<br><br></span> res@gsnSpreadColors = True ; use full colormap<br> res@gsnAddCyclic = False ; data not cyclic<br> res@gsnMaximize = True ; ps, pdf, pdf<br> res@pmTickMarkDisplayMode = "Always" ; use NCL default<br> res@lbLabelAutoStride = True ; let NCL decide spacing<br> res@cnLevelSelectionMode = "ManualLevels" ;"ExplicitLevels"<br> res@cnMinLevelValF = 200. ; set the minimum contour level<br> res@cnMaxLevelValF = 300. ; set the maximum contour level<br> res@cnLevelSpacingF = 5.0 ; set the contour interval<br> res@cnRasterSmoothingOn = True<br> res@lbLabelStride = 5.0 ; every other label bar label<br><br> plot = gsn_csm_contour(wks,new_temp, res)<br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 13, 2014 at 11:29 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:small">Dave,</div><div style="font-size:small"><br></div><div style="font-size:small">The gsn_csm_hov script is meant to only be for rectilinear grids, and you are trying to use it on a curvilinear grid (i.e., one represented by 2D lat/lon grids). The documentation is not clear about this unfortunately.</div><div style="font-size:small"><br></div><div style="font-size:small">My suggestion is to just use gsn_csm_contour, and pass in the time and longitude arrays via the sfYArray and sfXArray resources:</div><div style="font-size:small"><br></div><div style="font-size:small">new_time = conform(new_lon(:,0,:),time,0)</div><div style="font-size:small">res@sfYArray = new_time</div><div style="font-size:small">res@sfXArray = new_lon</div><div style="font-size:small"><br></div><div style="font-size:small">--Mary</div><div style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Oct 9, 2014 at 8:28 PM, David Adams <span dir="ltr"><<a href="mailto:dave.k.adams@gmail.com" target="_blank">dave.k.adams@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div><div><div>HI NCLers,<br></div>I am trying to make a hovmoller plot but it does appear that my coordinates are correct.<br><br>warning:ContourPlotInitialize: Y coordinates out of data range: defaulting<br>warning:ContourPlotInitialize: Zero Y coordinate span: defaulting:[errno=1104]<br><br></div>and then a blank plot. The code is from the NCL website with slight modification<br><br>--------------------------------------------------------------------------------<br>begin<br>;=============================================<br>; data processing<br>;===========================================<br> fili = "<a href="http://test.nc" target="_blank">test.nc</a>" ; filename<br> f = addfile (fili , "r") ; add file<br> new_temp = f->new_temp ; get chi<br> new_lat = f->new_lat<br> new_lon = f->new_lon<br>;==============================================<br>; creat plot: Reverse time axis; contour labels horizontal<br>; Dash negative contours; double width of Zero<br>;==============================================<br> wks = gsn_open_wks ("pdf", "hov")<br> res = True ; plot mods desired<br> res@gsnContourZeroLineThicknessF = 2. ; doubles thickness of zero contour<br> res@gsnContourNegLineDashPattern = 1 ; sets negative contours to dash pattern 1<br> res@trYReverse = True ; reverse y axis<br> res@tiMainString = "Reverse Time" ; title<br> res@cnLineLabelAngleF = 0.0 ; [cn] label horizontal<br><br>;new_temp@lat2d = new_lat(0,:,:)<br>;new_temp@lon2d = new_lon(0,:,:)<br><br> plot = gsn_csm_hov(wks, new_temp(:,0,:), res ) ; default hovmueller<br>end<br>--------------------------------------------------------------------------------------------<br></div>Here is an ncdump -h on the data file<br><div><br>netcdf test {<br>dimensions:<br> yc = 221 ;<br> xc = 141 ;<br> time = UNLIMITED ; // (130 currently)<br>variables:<br> float new_temp(time, yc, xc) ;<br> new_temp:time = 1372896900 ;<br> new_temp:units = "K" ;<br> new_temp:coordinates = "lon lat" ;<br> new_temp:type = "GVAR" ;<br> new_temp:long_name = "Temperature" ;<br> float new_lat(time, yc, xc) ;<br> new_lat:units = "degrees_north" ;<br> new_lat:long_name = "lat" ;<br> float new_lon(time, yc, xc) ;<br> new_lon:units = "degrees_east" ;<br> new_lon:long_name = "lon" ;<br> int time(time) ;<br> time:units = "seconds since 2013-185 00:15" ;<br><br><br></div><div>any obvious errors?<br><br></div><div>thanks in advance,<br>Dave<br></div><div><br><br><br><br><br><br><br><br><br></div></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>