[Thread Prev][Thread Next][Index]

Re: [ferret_users] different results from Ferret and Matlab



Hi,

Check that the time axis really is regular by checking the grid

SHOW GRID pre

You should get output with a lower case "r" after the number of points
e.g.

yes? show grid lsp     
    GRID GEK1
 name       axis              # pts   start                end
 XT_OCEAN  LONGITUDE          240mr   0E                   1.5W
 YT_OCEAN  LATITUDE           103 r   76.5S                76.5N
 normal    Z
 TIME      TIME              2920 r   01-JAN-1991 03:00    01-JAN-1992
00:00


If it is an "i" then there is something possibly wrong with the time
axis.

Another test would be to break up the calculation into the spatial and
temporal averages.

let pre_xy=pre[x = x1:x2@ave,  y = y1:y2@ave]
let pre_xyt=pre_xy[l=@ave]
list pre_xyt

Also it useful if you let people know the version of Ferret that you are
using. There was an old buggy version from a few years back that
performed area integrals incorrectly. I doubt if this is the case here
but it still helps to eliminate the possibility that it's a known (or
related) bug.

Cheers,
Russ



On Mon, 2013-02-04 at 13:17 +1100, FISSEHA G. BERHANE wrote:
> Dear William thank you a lot for your tips.
> 
> 
> The data I have is daily concatenated precipitation of 1830 days. 
> 
> When I use "list pre[x = x1:x2@ave,  y = y1:y2@ave, l=@sum]/1830"
> gives the same answer with Matlab but when I use "list
> pre[x=x1:x2@ave,y=y1:y2@ave, l=@ave]" , it gives a much smaller value.
> Any one who can help with why this is happening would be highly
> appreciated as it helps me to know which kinds of analyses are handled
> in what why in ferret.
> 
> 
> Thank you,
> Fisseha 
> 
> 
> --- On Sun, 2/3/13, William S. Kessler <william.s.kessler@xxxxxxxx>
> wrote:
>         
>         From: William S. Kessler <william.s.kessler@xxxxxxxx>
>         Subject: Re: [ferret_users] different results from Ferret and
>         Matlab
>         To: "FISSEHA G. BERHANE" <fishcivilmu@xxxxxxxxx>
>         Cc: "Ferret" <ferret_users@xxxxxxxx>
>         Date: Sunday, February 3, 2013, 1:37 AM
>         
>         
>         On Feb 2, 2013, at 9:23 PM, FISSEHA G. BERHANE wrote:
>         
>         > Dear Ferreters,
>         > 
>         > I have daily precipitation data over a given geographic
>         location. I am getting different mean values of the data in
>         Ferret and in Matlab (5.7mm/day and 7.0 mm/day, respectively).
>         Which is correct, may some one help me with what is the cause
>         of the difference?
>         > 
>         > Thank you,
>         > Fisseha 
>         
>         Are the timesteps regular? Ferret will recognize if they are
>         not, and @ave will correctly weight the time ranges.
>         
>         Try plotting the time series with each tool (with the same
>         plot ranges and aspect ratio). Are there differences?
>         
>         With a simple time series like this, you could simply list a
>         small subset of values (say 10). Compute the mean by hand,
>         then (over the same time range) from Ferret and Matlab. Are
>         these 3 identical? If not, can you see the problem looking at
>         a manageable number of points?
>         
>         BK




[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement