Re: regional mean precipitation

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon May 05 2014 - 10:05:53 MDT

Please do not respond directly to me...* only to ncl-talk*

The error message is telling you the issue.
The X (time) an Y (data) are different sizes.

Did you look at the output from each printVarSummary(...)
Did you input the appropriate 'time' for each variable?

The only way you can get the error
    plot(n) = gsn_csm_xy(wks, X, Y, res1)
    time is 'X'
    precAvg is 'Y'

Before each gsn_csm_xy
    print("plot(0): xsize="+dimsizes(time)+" ysize="+dimsizes(precAvg))
    plot(0) = gsn_csm_xy(wks, time, precAvg, res1)

    print("plot(1): xsize="+dimsizes(????)+" ysize="+dimsizes(????))
    plot(1) = gsn_csm_xy(wks, ????, ?????, res1)

etc

where ??? ate the variables you are using.

On 5/1/14, 4:51 PM, azizul haque wrote:
> Hi Dennis Shea,
> Thank you very much for your mail. I got it and see a nice time series. However it shows following fatal error
> gsn_csm_xy: Fatal: X and Y must have the same dimensions sizes, or one must be one-dimensional and both have the same rightmost dimension.
>
>
> Appreciated for your suggestion.
>
> Regards
> Azizul
> On Thursday, 1 May 2014, 10:59, Dennis Shea <shea@ucar.edu> wrote:
>
> The error in the graphics not in the computation of the mean.
>
> Did you look at the output from the following?
>
> printVarSummary(precAvg)
> printVarSummary(pr0Avg)
> printVarSummary(pr1Avg)
> printVarSummary(pr2Avg)
>
> Please carefully read:
> http://www.ncl.ucar.edu/Document/Functions/Contributed/wgt_areaave_Wrap.shtml
>
> ====
>
> [1] These are *time series* ==> precAvg(time)
>
> *not* spatial grids that can be *contoured* ==> (lat,lon)
>
> [2] You should be using (say)
>
> plot(0) = gsn_csm_xy(wks, time, precAvg, res1)
>
> [3] I would suggest not using unweighted areal means
>
> pr0Avg = wgt_areaave_Wrap(pr0(:,{lat1:lat2},{lon1:lon2}),1.0,1.0, 0)
>
> but (say) cosine(latitude) weighting
>
> clat0 = cos(0.01745329*pr0&lat)
> pr0Avg = wgt_areaave_Wrap(pr0(:,{lat1:lat2},{lon1:lon2}),1.0,1.0, 0)
>
>
> On 4/25/14, 12:31 PM, azizul haque wrote:
>>
>> Hi
>> Shea,
>> I am
>> trying to compute regional mean precipitation using
>> precAvg = wgt_areaave_Wrap(prec(:,{lat1:lat2},{lon1:lon2}),1.0,1.0,
>> 0)
>> pr0Avg = wgt_areaave_Wrap(pr0(:,{lat1:lat2},{lon1:lon2}),1.0,1.0, 0)
>> pr1Avg = wgt_areaave_Wrap(pr1(:,{lat1:lat2},{lon1:lon2}),1.0,1.0, 0)
>> pr2Avg = wgt_areaave_Wrap(pr2(:,{lat1:lat2},{lon1:lon2}),1.0,1.0, 0)
>> four model data. I found following fatal
>> error message.
>>
>>
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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
>> (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.
>>
>>
>>
>> Please
>> find the attached script for your help.
>>
>> Regards
>> Azizul
>>
>>
>>
>> _______________________________________________
>> 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 May 5 10:06:02 2014

This archive was generated by hypermail 2.1.8 : Fri May 09 2014 - 15:23:17 MDT