<div dir="ltr"><div><div><div><div>Hi Mary et al.<br></div>sorry for the delay. I have got the Hovmoller code to work for the GOES IR Brightness temperature data. However, what surprises me <br></div>is that it works with the original curvilinear data, which it wasn´t supposed to. That is, this GOES data is not on a rectangular grid.<br><br></div>Here is the code<br><br>iri = "./"<br> fili = systemfunc("ls goes13_4_2013_190*<a href="http://subset.nc">subset.nc</a>")<br>; print(fili)<br> nfili= dimsizes(fili)<br>; print("nfili="+nfili)<br><br> do i=0,nfili-1<br> f = addfile(fili(i),"r")<br> T = f->new_temp ; float data(time, yc, xc) ; data:type = "VISR" ;<br> la = f->new_lat<br> lo = f->new_lon<br> nT = dimsizes(T)<br> if (i .eq. 0)<br> d=new((/nfili, nT(0), nT(1)/), float)<br> lat=d<br> lon=d<br> d@_FillValue = 0 ; not on file<br> d!0="Time"<br> end if<br> d(i,:,:) = T<br> lat(i,:,:) = la<br> lon(i,:,:) = lo<br> delete([/T, la, lo/])<br> end do<br><br>; printVarSummary(d)<br>; print("d: min="+min(d)+" max="+max(d))<br><br> nl = 180<br> dhov = d(:,nl,:) ; (time,longitude) ; <== plot<br> print(dhov)<br> d@lat2d = lat(:,nl,:) ; (yc, xc)<br> d@lon2d = lon(:,nl,:)<br><br>;*********************************<br>; create plot<br>;*********************************<br> fNameBase = str_get_field(fili,1,".") + str_get_field(fili,2,".")<br><br> pltName = "goes_13"<br> pltType = "pdf" ; "ps", "eps", "pdf", "png","x11"<br> pltDir = "./"<br><br> wks = gsn_open_wks(pltType, pltDir+pltName)<br> gsn_define_colormap(wks,"BlAqGrYeOrReVi200"); specify 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><br> res@sfXArray = lon(0,nl,:)<br><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@cnLevelSelectionMode = "ManualLevels" ;"ExplicitLevels"<br> res@cnMinLevelValF = 180.0 ; set the minimum contour level<br> res@cnMaxLevelValF = 310. ; 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,dhov, res)<br><br></div>-------------------------PrintSummary-------------------------------------<br><div>Variable: dhov<br>Type: float<br>Total Size: 48504 bytes<br> 12126 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [Time | 86] x [xc | 141]<br>Coordinates: <br>Number Of Attributes: 6<br> _FillValue : 1<br> time : 1376178300<br> units : K<br> coordinates : lon lat<br> type : GVAR<br> long_name : Temperature<br><br></div><div>thanks,<br></div><div>Dave<br></div><div><br><br><br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 11:44 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: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">You are plotting "dhov", which according to your comments is time x longitude. The error is:</div><span class=""><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">warning:IrTransInitialize: error creating spline approximation for trYCoordPoints; defaulting to linear</span><br></div><div class="gmail_default" style="font-size:small"><br></div></span><div class="gmail_default"><span style="font-size:12.8000001907349px">which is referencing the Y coordinate array, and hence the time array, in your case. </span></div><div class="gmail_default"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default"><span style="font-size:12.8000001907349px">Usually if there's a spline error, it's because the coordinate points are too irregular. That is, they might be closely spaced in one section of your data, and then widely spaced in others. This is very true of time arrays, if your time array is not constructed properly.</span></div><div class="gmail_default"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default"><span style="font-size:12.8000001907349px">This is a case where you need to look at your data, and in particular, the "time" array that's attached to dhov. </span><span style="font-size:12.8000001907349px">What does the following report:</span></div><div class="gmail_default"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default"><span style="font-size:12.8000001907349px">printVarSummary(dhov)</span></div><div class="gmail_default"><span style="font-size:12.8000001907349px">print(dhov&time)</span></div><div class="gmail_default"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default"><span style="font-size:12.8000001907349px">--Mary</span></div><div class="gmail_default"><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Aug 17, 2015 at 10:51 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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div>Hi NCLers, <br><br></div>I have managed to get GOES IR data from curvilinear to rectangular grids. Lat and Lon are still 2d, however. But the code I have for the Hovmoller diagrams gives this error. I am sure I am just not reading the data correctly.<br><br></div>The error, ncl code and ncdump of the file follow:<br><div><br></div><div>thanks,<br></div><div>Dave<br></div><div><br></div><div>---------------------- error ------------------------------------------------------<br></div><div>warning:IrTransInitialize: error creating spline approximation for trYCoordPoints; defaulting to linear<br>fatal:ContourPlotDraw: CPCICA - ONE OF THE CORNER POINTS OF THE CELL ARRAY IS INCORRECT<br>fatal:ContourPlotDraw: draw error<br>fatal:ContourPlotDraw: draw error<br>fatal:PlotManagerDraw: error in plot draw<br>fatal:_NhlPlotManagerDraw: Draw error<br><br></div><div>------------------------ NCL Code Snippet -----------------------------------------------<br>diri = "./"<br> fili = systemfunc("ls goes1*.nc")<br><br> print(fili)<br> nfili= dimsizes(fili)<br> print("nfili="+nfili)<br><br> f = addfiles(diri+fili,"r")<br> d = f[:]->data ; float data(time, yc, xc) ; data:type = "IR" ;<br> d@_FillValue = 330<br> lat = f[:]->lat<br> lon = f[:]->lon<br> time= f[:]->time<br><br> nl = 600<br> dhov = d(:,nl,:) ; (time,longitude) ; <== plot<br>; Fix the variable so it has recognizable missing data<br>;*********************************<br><br> lat2d = f[:]->lat<br> lon2d = f[:]->lon<br> d@lat2d = lat2d ; (yc, xc)<br> d@lon2d = lon2d<br><br> crTime = f[:]->crTime ; assorted info<br> crDate = f[:]->crDate<br> lineRes = f[:]->lineRes<br> elemRes = f[:]->elemRes<br><br>;*********************************<br>; create plot<br>;*********************************<br> fNameBase = str_get_field(fili,1,".") + str_get_field(fili,2,".")<br><br> ;pltName = fNameBase<br> pltName = "goes_4"<br> pltType = "pdf" ; "ps", "eps", "pdf", "png","x11"<br> pltDir = "./"<br><br> wks = gsn_open_wks(pltType, pltDir+pltName)<br> gsn_define_colormap(wks,"BlAqGrYeOrReVi200"); specify 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 line<br>; Create longitude labels on the x-axis<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@cnLevelSelectionMode = "ManualLevels" ;"ExplicitLevels"<br> res@cnMinLevelValF = 180.0 ; set the minimum contour level<br> res@cnMaxLevelValF = 310. ; 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,dhov(:,:), res)<br>---------------------------------------------------------------------------------------------------------<br><br>netcdf goes13_4_2013_210_2002_1byte_rect {<br>dimensions:<br> xc = 2720 ;<br> yc = 1301 ;<br> time = 1 ;<br> auditCount = 2 ;<br> auditSize = 80 ;<br>variables:<br> int version ;<br> version:long_name = "McIDAS area file version" ;<br> int sensorID ;<br> sensorID:long_name = "McIDAS sensor number" ;<br> int imageDate ;<br> imageDate:long_name = "image year and day of year (in ccyyddd format)" ;<br> int imageTime ;<br> imageTime:long_name = "image time in UTC (hours/minutes/seconds, in HHMMSS format)" ;<br> int startLine ;<br> startLine:long_name = "starting image line (in satellite coordinates)" ;<br> int startElem ;<br> startElem:long_name = "starting image element (in satellite coordinates)" ;<br> int time(time) ;<br> time:long_name = "seconds since 1970-1-1 0:0:0" ;<br> time:units = "seconds since 1970-1-1 0:0:0" ;<br> int dataWidth ;<br> dataWidth:long_name = "number of 8-bit bytes per source data point" ;<br> int lineRes ;<br> lineRes:long_name = "resolution of each pixel in line direction" ;<br> lineRes:units = "km" ;<br> int elemRes ;<br> elemRes:long_name = "resolution of each pixel in element direction" ;<br> elemRes:units = "km" ;<br> int prefixSize ;<br> prefixSize:long_name = "line prefix size in 8-bit bytes" ;<br> int crDate ;<br> crDate:long_name = "image creation year and day of year in ccyyddd format" ;<br> int crTime ;<br> crTime:long_name = "image creation time in UTC in hhmmss format" ;<br> int bands ;<br> bands:long_name = "satellite channel number" ;<br> char auditTrail(auditCount, auditSize) ;<br> auditTrail:long_name = "audit trail" ;<br> float data(time, yc, xc) ;<br> data:long_name = "Temperature" ;<br> data:type = "VISR" ;<br> data:coordinates = "lon lat" ;<br> data:units = "K" ;<br> float lat(yc, xc) ;<br> lat:long_name = "lat" ;<br> lat:units = "degrees_north" ;<br> float lon(yc, xc) ;<br> lon:long_name = "lon" ;<br> lon:units = "degrees_east" ;<br><br>// global attributes:<br> :Conventions = "CF-1.4" ;<br> :Source = "McIDAS Area File" ;<br> :Satellite\ Sensor = "G-13 IMG " ;<br><br><br><br><br><br><br><br><br><div><div><div><br><br><br></div></div></div></div></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>