Re: check_for_y_lat_coord Error (Ibo Ze)

From: Sabeerali(sebi) <sabeerl_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 28 2010 - 21:22:32 MDT

Hi lbo Ze,

You can solve this easily.
Just copy the coordinate values from x1 to c..

c=escorc(x2,x1)
copy_VarCoords(x1,c)

Regards,
Sabeerali

>
>
>
> Message: 2
> Date: Wed, 28 Apr 2010 12:12:11 -0700 (PDT)
> From: Ibo Ze <ibo85@ymail.com>
> Subject: check_for_y_lat_coord Error
> To: Ncl Talk <ncl-talk@ucar.edu>
> Message-ID: <104045.34587.qm@web114507.mail.gq1.yahoo.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
>
> I want to calculate cross-correlation at 0 lag. Getting following error:
>
> (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'
>
> Script below addressed this issue as described in mini graphics manual but
> error still persists. Kindly help to rectify this.
> Thanks.
>
> Header of file1 is as follow:
>
> netcdf 6104_pksec_06 {
> dimensions:
> time = 44 ;
> lat = 120 ;
> lon = 260 ;
>
> variables:
> float a(time, lat, lon) ;
> a:_FillValue = -999.f ;
> double lat(lat) ;
> lat:long_name = "Latitude" ;
> lat:units = "degrees_north" ;
> double lon(lon) ;
> lon:long_name = "Longitude" ;
> lon:units = "degrees_east" ;
> float time(time) ;
> time:units = "months since 1961-01-01" ;
>
> Header of file 2 is as follow:
>
> netcdf 6104_pk_june_avg {
> dimensions:
> time = 44 ;
>
> variables:
> float a(time) ;
> a:_FillValue = -999.f ;
> double lat ;
> lat:long_name = "Latitude" ;
> lat:units = "degrees_north" ;
> double lon ;
> lon:long_name = "Longitude" ;
> lon:units = "degrees_east" ;
> float time(time) ;
> time:units = "months since 1961-01-01" ;
>
>
> and the script for calculation is as follows:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>
> ;**********************************************
> ; Reading Data and correlation function
> ;**********************************************
> f1 = addfile("6104_pksec_06.nc","r")
> f2 = addfile("6104_pk_june_avg.nc","r")
> x1 = f1->a(lat|:,lon|:,time|:)
> x2 = f2->a
> x1!0="lat"
> x1!1="lon"
> x1&lat@units="degrees_north"
> x1&lon@units="degrees_east"
> c = escorc(x2,x1)
> printVarSummary(c)
>
> ;**********************************************
> ; Invoke resources and set limits
> ;*********************************************
> wks = gsn_open_wks ("x11","pksec_pk_06") ; open ps file
>
> gsn_define_colormap(wks,"radar")
> res = True
> res@gsnDraw = False
> res@cnFillOn = True
> res@cnLinesOn = False
>
> ;*******************************************************
> ; create map resources with focus on domain
> ;*******************************************************
>
> res@mpOutlineBoundarySets = "AllBoundaries"
> res@mpDataBaseVersion = "MediumRes"
> res@mpDataSetName = "Earth..3"
> res@mpOutlineOn = True
> res@mpFillOn = False
> res@mpMaxLatF = 35
> res@mpMinLatF = 5
> res@mpMaxLonF = 125
> res@mpMinLonF = 60
>
> res@cnLevelSelectionMode = "ManualLevels" ; manually set cn levels
> res@cnMinLevelValF = -1. ; min level
> res@cnMaxLevelValF = 1. ; max level
> res@cnLevelSpacingF = .22 ; contour level
> spacing
> res@tiMainFontHeightF = 0.03
> res@gsnAddCyclic = False
> plot = gsn_csm_contour_map_ce(wks,c,res)
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100428/d463a249/attachment.html
>
> ------------------------------
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 28 21:22:41 2010

This archive was generated by hypermail 2.1.8 : Thu Apr 29 2010 - 08:05:27 MDT