<div dir="ltr"><div class="gmail_default" style="font-size:small">Dave,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I think the issue here is simply that &quot;new_temp&quot; is dimensioned time x lat x lon, and since you want a time x lon plot, you need to subscript the &quot;lat&quot; dimension somehow.  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">i.e.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px">  plot = gsn_csm_contour(wks,new_temp(:,0,:), res)</span><div class="" style="font-family:arial,sans-serif;font-size:12.8000001907349px"></div></div><div class="gmail_default" style="font-size:small"><span style="font-family:arial,sans-serif;font-size:12.8000001907349px"><br></span></div><div class="gmail_default"><font face="arial, sans-serif">I&#39;m just selecting the first latitude dimension, but you need to set this to whatever you want.</font></div><div class="gmail_default"><font face="arial, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, sans-serif">--Mary</font></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">&lt;<a href="mailto:dave.k.adams@gmail.com" target="_blank">dave.k.adams@gmail.com</a>&gt;</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><div><div>Hi Mary et al.<br></div>I think I am misunderstanding how<span class=""><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(&quot;/home/dadams/Mini_Campaign_NAME/2013_GOES_data/<a href="http://test.nc" target="_blank">test.nc</a>&quot;,&quot;r&quot;)<br>   new_temp    = f-&gt;new_temp          ; float new_temp(time, yc, xc) <br>;   printVarSummary(new_temp)<br>;*********************************<br>;<br>;*********************************<span class=""><br>   new_lat  = f-&gt;new_lat<br>   new_lon  = f-&gt;new_lon<br></span>   time = f-&gt;time<span class=""><br>   new_time = conform(new_lon(:,0,:),time,0)<br><br></span>;*********************************<br>; create plot<br>;*********************************<br>   pltName = &quot;goes&quot;<br>   pltType = &quot;pdf&quot;                             ; &quot;ps&quot;, &quot;eps&quot;, &quot;pdf&quot;, &quot;png&quot;<br>   pltDir  = &quot;./&quot;<br><br>   wks = gsn_open_wks(pltType, pltDir+pltName)<br>   gsn_define_colormap(wks,&quot;BlAqGrYeOrReVi200&quot;); choose a color map<br><br>   res                     = True<br>   res@cnFillOn            = True            ; turn on color<br>   res@cnFillMode          = &quot;RasterFill&quot;    ; cell mode<br>   res@cnLinesOn           = False           ; Turn off contour lines<span class=""><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 = &quot;Always&quot;      ; use NCL default<br>   res@lbLabelAutoStride   = True            ; let NCL decide spacing<br>   res@cnLevelSelectionMode = &quot;ManualLevels&quot;  ;&quot;ExplicitLevels&quot;<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 class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 13, 2014 at 11:29 PM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;</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 class="gmail_default" style="font-size:small">Dave,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" 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 class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" 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 class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">new_time = conform(new_lon(:,0,:),time,0)</div><div class="gmail_default" style="font-size:small">res@sfYArray = new_time</div><div class="gmail_default" style="font-size:small">res@sfXArray = new_lon</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" 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">&lt;<a href="mailto:dave.k.adams@gmail.com" target="_blank">dave.k.adams@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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  = &quot;<a href="http://test.nc" target="_blank">test.nc</a>&quot;                 ; filename<br>  f     = addfile (fili , &quot;r&quot;)             ; add file<br> new_temp   = f-&gt;new_temp                                ; get chi<br> new_lat  = f-&gt;new_lat<br> new_lon  = f-&gt;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 (&quot;pdf&quot;, &quot;hov&quot;)<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        = &quot;Reverse Time&quot;      ; 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 = &quot;K&quot; ;<br>        new_temp:coordinates = &quot;lon lat&quot; ;<br>        new_temp:type = &quot;GVAR&quot; ;<br>        new_temp:long_name = &quot;Temperature&quot; ;<br>    float new_lat(time, yc, xc) ;<br>        new_lat:units = &quot;degrees_north&quot; ;<br>        new_lat:long_name = &quot;lat&quot; ;<br>    float new_lon(time, yc, xc) ;<br>        new_lon:units = &quot;degrees_east&quot; ;<br>        new_lon:long_name = &quot;lon&quot; ;<br>    int time(time) ;<br>        time:units = &quot;seconds since 2013-185 00:15&quot; ;<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>