[ncl-talk] Troubles with global ERA-INTERIM data when plotting sub-domain.
Dennis Shea
shea at ucar.edu
Wed Jun 3 17:09:19 MDT 2015
If you had done what ncl-talk *always* advises .... *look at your data*
you would have seen some issues.
===============
a = addfile ("w_jja.nc", "r")
W = a->w/100 ; this eliminates all meta data!!!
printVarSummary(W) ; *look* at this!!!
you would not see any meta data. (eg, named dimensions)
==============
Later you do
WM=dim_avg_n(W,0)/100
I don't get it.
==============
If you had done
W = a->w ; this retains all meta data
printVarSummary(W)
W = W/100
printVarSummary(W)
or, better
W = W/100
@@units = "... whatever ..."
printVarSummary(W)
==================
It is your responsibility to carefully examine each step of your actions.
a = addfile ("w_jja.nc", "r")
W = a->w
W = W/100
W at units = "..."
printVarSummary(W)
l
WM=dim_avg_n_Wrap(W,0)
printVarSummary(WM)
===================
There is absolutely no need to reorder your data.
The graphics codes do not care.
You state:
I am using global ERA-INTERIM Reanalysis.
The way you have done the plots
res at gsnAddCyclic = False
should be True (that is the default)
Even though you are specifying a limited area, you are feeding the entire
global array,
hence, under the hood, the plotis global but you are plotting a subset
On Wed, Jun 3, 2015 at 4:47 PM, Rabah Hachelaf <hachelaf at sca.uqam.ca> wrote:
>
>
> Hi all,
>
> Why i still getting this troubles :
>
> Variable: W
> Type: integer
> Total Size: 13881600 bytes
> 3470400 values
> Number of Dimensions: 4
> Dimensions and sizes: [15] x [2] x [241] x [480] (Time,Le
> vels,Latitude,Longitude)
> Coordinates:
> Number Of Attributes: 1
> _FillValue : -32767
> warning:Dimension (2) has not been defined
> (0) lonFlip: warning: last dimension is not named
> (0)
> (0) min=-2.01933 max=1.308
> (0)
> (0) min=-2.44533 max=2.15867
> (0) check_for_y_lat_coord: Warning: Data either does not contain a
> valid latitude coordinate array or doesn't contain one at all.
> (0) A valid latitude coordinate array should have a 'units' attribute
> equal to one of the following values:
> (0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
> 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
> (0) check_for_lon_coord: Warning: Data either does not contain a valid
> longitude coordinate array or doesn't contain one at all.
> (0) A valid longitude coordinate array should have a 'units' attribute
> equal to one of the following values:
> (0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
> warning:ContourPlotDraw: out of range coordinates encountered; standard
> AreaFill rendering method may be unreliable;
> consider setting the resource trGridType to "TriangularMesh" if
> coordinates contain missing values
>
> here is my script :
> I want to plot a temporal average of W variable in one of levels , When i
> turn one
> ; WM&latitude at units="degrees_north"
> ; WM&longitude at units="degrees_east"
> I get this :
> warning:Dimension (2) has not been defined
> (0) lonFlip: warning: last dimension is not named
> fatal:No coordinate variable exists for dimension (latitude) in variable
> (WM)
> fatal:(latitude) is not coordinate variable in variable(WM).
> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 26 in
> file read_w.ncl
>
> I am using global ERA-INTERIM Reanalysis.
>
>
>
> ;***************************************************************************
> ; era_1.ncl
> ;
>
> ;***************************************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
>
>
> a = addfile ("w_jja.nc", "r")
>
> W = a->w/100
>
> printVarSummary(W)
> lat=a->latitude
> lon=a->longitude
> WM=dim_avg_n(W,0)/100
>
> WM=lonFlip(WM)
> WM!1="latitude"
> WM!2="longitude"
>
>
>
> ; WM&latitude at units="degrees_north"
> ; WM&longitude at units="degrees_east"
>
>
>
> printMinMax(WM(0,:,:),True)
> printMinMax(WM(1,:,:),True)
>
> ;*********************************************************************
> wks = gsn_open_wks ("png", "era_djf") ; open workstation
> gsn_define_colormap (wks,"gui_default") ; choose color map
>
> res = True
> res at gsnAddCyclic = False
> res at mpProjection = "Mercator" ; choose projection
> res at mpGridAndLimbOn = True ; turn on lat/lon lines
> res at mpPerimOn = False ; turn off box around plot
> res at mpFillOn = False
> res at cnLinesOn = False
> res at mpOutlineOn = True
> res at cnFillOn = True ; color plot desired
> res at cnLineLabelsOn = False ; turn off contour lines
> res at mpLimitMode = "LatLon"
> res at mpMinLatF = 15 ;5.0
> res at mpMaxLatF = 85 ;35.0
> res at mpMinLonF = -180 ;105
> res at mpMaxLonF = -50 ;140
>
> res at cnLevelSelectionMode = "ManualLevels" ; manual contour levels
> res at cnMinLevelValF = -1 ; min level
> res at cnMaxLevelValF = 0 ; max level
> res at cnLevelSpacingF = 0.1 ; interval
>
> res at cnFillOn = True ; turn on color
>
>
>
> plot = gsn_csm_contour_map(wks,W(2,0,:,:),res) ; Draw
> original grid on map
>
> end
>
>
>
>
>
> --
> ------------------------------
> Cordialement,
> Best regards,
> Rabah Hachelaf
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150603/70cdff19/attachment.html
More information about the ncl-talk
mailing list