Re: 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: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 02 2014 - 11:33:19 MDT

The error is telling you to set:

  res@gsnAddCyclic = False

and *not*

  res@gsn_add_cyclic = False

"gsn_add_cyclic" is the function that gets called by gsn_csm_contour_map to add the cyclic point. "gsnAddCyclic" is the name of the resource that you set.

Please read the error message closely, as it was telling you the name of the resource to set.

--Mary

On Jun 2, 2014, at 6:05 AM, Vanúcia Schumacher <vanucia-schumacher@hotmail.com> wrote:

> 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 value
> warning: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 value
> warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear
> warning: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 181
> media= 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 = 1000
> wkstype@wkHeight = 1000
> wks = gsn_open_wks(wkstype,"ice_2deg")
>
> gsn_define_colormap(wks,"WhiteBlue")
>
> res = True
> res@cnLevelSelectionMode ="ManualLevels"
> res@cnMinLevelValF =0
> res@cnMaxLevelValF = 2
> res@cnLevelSpacingF = 1
>
> res@cnLinesOn = False
> res@cnFillOn = True
>
>
> plot = gsn_csm_contour_map_ce(wks,media,res)
>
> end
>
> print(f)
>
> Variable: f
> Type: file
> filename: sit1
> path: 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 Schumacher
> Mestranda em Meteorologia - UFV
> Meteorologista -UFPel
> Departamento de Meteorologia Agrícola - DEA
> Cel: (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

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

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