[ncl-talk] Hovmoller 2d lat and 2d lon rectangular grid
David Adams
dave.k.adams at gmail.com
Mon Aug 17 10:51:43 MDT 2015
Hi NCLers,
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.
The error, ncl code and ncdump of the file follow:
thanks,
Dave
---------------------- error
------------------------------------------------------
warning:IrTransInitialize: error creating spline approximation for
trYCoordPoints; defaulting to linear
fatal:ContourPlotDraw: CPCICA - ONE OF THE CORNER POINTS OF THE CELL ARRAY
IS INCORRECT
fatal:ContourPlotDraw: draw error
fatal:ContourPlotDraw: draw error
fatal:PlotManagerDraw: error in plot draw
fatal:_NhlPlotManagerDraw: Draw error
------------------------ NCL Code Snippet
-----------------------------------------------
diri = "./"
fili = systemfunc("ls goes1*.nc")
print(fili)
nfili= dimsizes(fili)
print("nfili="+nfili)
f = addfiles(diri+fili,"r")
d = f[:]->data ; float data(time, yc, xc) ; data:type =
"IR" ;
d at _FillValue = 330
lat = f[:]->lat
lon = f[:]->lon
time= f[:]->time
nl = 600
dhov = d(:,nl,:) ; (time,longitude) ; <== plot
; Fix the variable so it has recognizable missing data
;*********************************
lat2d = f[:]->lat
lon2d = f[:]->lon
d at lat2d = lat2d ; (yc, xc)
d at lon2d = lon2d
crTime = f[:]->crTime ; assorted info
crDate = f[:]->crDate
lineRes = f[:]->lineRes
elemRes = f[:]->elemRes
;*********************************
; create plot
;*********************************
fNameBase = str_get_field(fili,1,".") + str_get_field(fili,2,".")
;pltName = fNameBase
pltName = "goes_4"
pltType = "pdf" ; "ps", "eps", "pdf",
"png","x11"
pltDir = "./"
wks = gsn_open_wks(pltType, pltDir+pltName)
gsn_define_colormap(wks,"BlAqGrYeOrReVi200"); specify a color map
res = True
res at cnFillOn = True ; turn on color
res at cnFillMode = "RasterFill" ; cell mode
res at cnLinesOn = False ; Turn off contour line
; Create longitude labels on the x-axis
res at gsnSpreadColors = True ; use full colormap
res at gsnAddCyclic = False ; data not cyclic
res at gsnMaximize = True ; ps, pdf, pdf
res at pmTickMarkDisplayMode = "Always" ; use NCL default
res at lbLabelAutoStride = True ; let NCL decide spacing
res at cnLevelSelectionMode = "ManualLevels" ;"ExplicitLevels"
res at cnMinLevelValF = 180.0 ; set the
minimum contour level
res at cnMaxLevelValF = 310. ; set the
maximum contour level
res at cnLevelSpacingF = 5.0 ; set the
contour interval
res at cnRasterSmoothingOn = True
res at lbLabelStride = 5.0 ; every other label bar label
plot = gsn_csm_contour(wks,dhov(:,:), res)
---------------------------------------------------------------------------------------------------------
netcdf goes13_4_2013_210_2002_1byte_rect {
dimensions:
xc = 2720 ;
yc = 1301 ;
time = 1 ;
auditCount = 2 ;
auditSize = 80 ;
variables:
int version ;
version:long_name = "McIDAS area file version" ;
int sensorID ;
sensorID:long_name = "McIDAS sensor number" ;
int imageDate ;
imageDate:long_name = "image year and day of year (in ccyyddd
format)" ;
int imageTime ;
imageTime:long_name = "image time in UTC (hours/minutes/seconds, in
HHMMSS format)" ;
int startLine ;
startLine:long_name = "starting image line (in satellite
coordinates)" ;
int startElem ;
startElem:long_name = "starting image element (in satellite
coordinates)" ;
int time(time) ;
time:long_name = "seconds since 1970-1-1 0:0:0" ;
time:units = "seconds since 1970-1-1 0:0:0" ;
int dataWidth ;
dataWidth:long_name = "number of 8-bit bytes per source data point"
;
int lineRes ;
lineRes:long_name = "resolution of each pixel in line direction" ;
lineRes:units = "km" ;
int elemRes ;
elemRes:long_name = "resolution of each pixel in element direction"
;
elemRes:units = "km" ;
int prefixSize ;
prefixSize:long_name = "line prefix size in 8-bit bytes" ;
int crDate ;
crDate:long_name = "image creation year and day of year in ccyyddd
format" ;
int crTime ;
crTime:long_name = "image creation time in UTC in hhmmss format" ;
int bands ;
bands:long_name = "satellite channel number" ;
char auditTrail(auditCount, auditSize) ;
auditTrail:long_name = "audit trail" ;
float data(time, yc, xc) ;
data:long_name = "Temperature" ;
data:type = "VISR" ;
data:coordinates = "lon lat" ;
data:units = "K" ;
float lat(yc, xc) ;
lat:long_name = "lat" ;
lat:units = "degrees_north" ;
float lon(yc, xc) ;
lon:long_name = "lon" ;
lon:units = "degrees_east" ;
// global attributes:
:Conventions = "CF-1.4" ;
:Source = "McIDAS Area File" ;
:Satellite\ Sensor = "G-13 IMG " ;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150817/7a576d79/attachment.html
More information about the ncl-talk
mailing list