<div dir="ltr">The error gives you a good starting point. So the coords of d are yc and xc which have no information associated with them. You've read in lat and lon, you just need to match that up to the plotting variable. It looks like the coords are 2 dimensional (maybe even 3 dimensional? ) <div><div><br></div><div>Take a look at example 3 here: <a href="https://www.ncl.ucar.edu/Applications/raster.shtml">https://www.ncl.ucar.edu/Applications/raster.shtml</a></div><div>Based on that I would do the below. There may be some more resources needed which will be in that example, or the 2 extra lines below may do it for you. </div><div><br></div><div>...</div><div>d@lat2d = new_lat(111,:,:)</div><div>d@lon2d = new_lon(111,:,:)</div><div><span style="font-family:arial,sans-serif;font-size:13px"> plot = gsn_csm_contour_map_ce(wks,d(</span><span style="font-family:arial,sans-serif;font-size:13px">111,:,:), res)</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Good Luck, </span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Alan Brammer</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 7:24 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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi NCLers (sorry if multiply posted, I am having trouble with my registration)<br><br></div><div><div class="h5">I am trying to plot of map of
GOES IR Brightness temperature, but am getting a flat field. When I
print the data they're fine, the values are correct.<br><br></div></div></div><div><div class="h5">The file I am using I created with <br>ncrcat<br></div></div></div><div><div class="h5">to
put all of the 15 minutes GOES netcdf images into a daily file. Maybe I
erred here, maybe something wrong with the time dimension.<br><br></div></div></div><div><div class="h5">Here is ncdump -h of the file I want to plot<br><div>-------------------------------------------------------------------------------<br>ncdump -h <a href="http://test.nc" target="_blank">test.nc</a><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>// global attributes:<br> :history = "Mon Oct 6 18:26:36 2014: ncrcat <a href="http://goes13_4_2013_185_0015_subset.nc" target="_blank">goes13_4_2013_185_0015_subset.nc</a> ............<br><a href="http://goes13_4_2013_185_2345_subset.nc" target="_blank">goes13_4_2013_185_2345_subset.nc</a> <a href="http://test.nc" target="_blank">test.nc</a>\n",<br> "Mon Oct 6 18:24:58 2014: ncatted -O -a units,time,c,c,seconds since 2013-185 00:15 <a href="http://out.nc" target="_blank">out.nc</a>\n",<br> "Mon Oct 6 18:24:58 2014: ncap2 -O -v -s time=array(0,0,$time) <a href="http://out.nc" target="_blank">out.nc</a>\n",<br> "Mon Oct 6 18:24:58 2014: ncrename -O -d record,time <a href="http://out.nc" target="_blank">out.nc</a>" ;<br> :nco_openmp_thread_number = 1 ;<br>}<br>----------------------------------------------------------------------------------------------------------------------<br></div><div><br>Here is the map plotting code<br></div><div>-----------------------------------------------------------------------------------------------------------------------<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br><br>;*********************************<br>; read variable<br>;*********************************<br><br>f = addfile("<a href="http://test.nc" target="_blank">test.nc</a>","r")<br>d = f->new_temp ; float data(time, yc, xc) ;<br> ; data:type = "IR" ;<br> printVarSummary(d)<br>;*********************************<br>; Fix the variable so it has recognizable missing data<br>;*********************************<br> new_lat = f->new_lat<br> new_lon = f->new_lon<br><br>;*********************************<br>; create plot<br>;*********************************<br> pltType = "pdf" ; "ps", "eps", "pdf", "png"<br> pltDir = "./"<br><br> wks = gsn_open_wks(pltType, "test")<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<br> 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@mpMinLatF = 23.0 ; ; region to zoom in on<br> res@mpMaxLatF = 33.00 ; <br> res@mpMinLonF = -115.200 ; <br> res@mpMaxLonF = -102.20 ; <br> res@mpFillOn = False<br> res@mpOutlineBoundarySets = "National" ; turn on country boundaries<br> res@trGridType = "TriangularMesh" ; Necessary b/c lat, lon<br> res@lbLabelStride = 5.0 ; every other label bar label<br><br> plot = gsn_csm_contour_map_ce(wks,d(111,:,:), res)<br>----------------------------------------------------------------------------------------------------<br><br></div><div>Also, I am getting these warnings,<br></div><div><br>0)
check_for_y_lat_coord: Warning: Data either does not contain a valid
latitude coordinate array or doesn't contain one at all.<br>(0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: <br>(0)
'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'<br>(0)
check_for_lon_coord: Warning: Data either does not contain a valid
longitude coordinate array or doesn't contain one at all.<br>(0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values: <br>(0)
'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'<br><br></div><div>Any ideas?<br><br>thanks in advance,<br></div>Dave</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>