REs: error scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length.

From: Vanúcia Schumacher <vanucia-schumacher_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 02 2014 - 06:05:56 MDT

Hi Mary,
I did what you suggested, and the following error appeared:
(0) gsn_add_cyclic: Warning: The range of your longitude coordinate array is at least 360.(0) You may want to set gsnAddCyclic to False to avoid a warning(0) message from the spline function.warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF valuewarning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear

I included the line: res@gsn_add_cyclic , but returned error:
        gsn_add_cyclic: Warning: The range of your longitude coordinate array is at least 360.(0) You may want to set gsnAddCyclic to False to avoid a warning(0) message from the spline function.warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF valuewarning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linearwarning:gsn_add_cyclic is not a valid resource in ice_2deg_contour at this time

Subject: Re: error scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length.
From: haley@ucar.edu
Date: Sun, 1 Jun 2014 22:14:32 -0600
CC: ncl-talk@ucar.edu
To: vanucia-schumacher@hotmail.com

Dear Vanúcia,
You read in the first timestep of SIT_NEW which gave you a 91 x 181 (latitude by longitude) array, and then you called dim_avg_n_Wrap with an index of 0, which causes it to take the average of all latitude values for every longitude value , hence giving you a one-dimensional array of length 181.
When you try to create a contour plot of a 1D array of data, you also have to provide 1D X/Y arrays that are the same length, that define the X and Y locations of each point. This is where the error is coming from.
If you are trying to calculate the average temperature for each lat/lon point across all time values, then this is what you want:
ice =f->SIT_NEW ; 120 x 91 x 181media= dim_avg_n_Wrap(ice,0) ; 91 x 181
Note that this reads all of SIT_NEW’s values, and then averages across the time dimension. This will give you something you can plot over a map.
Good luck,
—Mary
On Jun 1, 2014, at 5:00 PM, Vanúcia Schumacher <vanucia-schumacher@hotmail.com> wrote:Hi users,
I needed to interpolate the resolution of my data, and now I'm getting this error:
(0) Error: scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length.warning:create: Bad HLU id passed to create, ignoring it
My code:
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"
begin
f=addfile("sit1.nc","r")
;print(f)
ice =f->SIT_NEW(0,:,:)
media= dim_avg_n_Wrap(ice,0)
wkstype= "png"wkstype@wkWidth = 1000wkstype@wkHeight = 1000wks = gsn_open_wks(wkstype,"ice_2deg")
gsn_define_colormap(wks,"WhiteBlue")
res = Trueres@cnLevelSelectionMode ="ManualLevels"res@cnMinLevelValF =0 res@cnMaxLevelValF = 2res@cnLevelSpacingF = 1
res@cnLinesOn = False res@cnFillOn = True
   plot = gsn_csm_contour_map_ce(wks,media,res)
end
print(f)
Variable: fType: filefilename: sit1path: sit1.nc file global attributes: history : FERRET V6.9 30-May-14 Conventions : CF-1.0 dimensions: X2DEG = 181 Y2DEG = 91 TIME = 120 // unlimited bnds = 2 variables: double X2DEG ( X2DEG ) units : degrees_east point_spacing : even axis : X standard_name : longitude
      double Y2DEG ( Y2DEG ) units : degrees_north point_spacing : even axis : Y standard_name : latitude
      double TIME ( TIME ) bounds : TIME_bnds units : days since 1850-01-01 00:00:00 calendar : 365_day axis : T long_name : time standard_name : time
      double TIME_bnds ( TIME, bnds )
      double SIT_NEW ( TIME, Y2DEG, X2DEG ) missing_value : -9.999999999999999e+33 _FillValue : -9.999999999999999e+33 long_name : SIT[GX=X2DEG,GY=Y2DEG] history : From sit_OImon_CanCM4_decadal1980_r1i1p1_198101-199012

---Vanúcia SchumacherMestranda em Meteorologia - UFVMeteorologista -UFPel
Departamento de Meteorologia Agrícola - DEACel: (31) 9978 2522 DEA: (31) 3899 1890_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
                                               

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 2 06:06:06 2014

This archive was generated by hypermail 2.1.8 : Tue Jun 03 2014 - 11:40:09 MDT