[Thread Prev][Thread Next][Index]

Re: [ferret_users] statistics data saving in a file

Hi -
The STATISTICS command just lists the result to the terminal window, as you see. We would need a function to return standard deviation for a variable at each time over a range. That would be pretty easy to write as an external function, but so far as I know nobody has written such a function.

However the STAT sets some SYMBOLS, so that you can capture the output when running a script:
yes? use coads_climatology
yes? stat/x=29W:0W/y=0:38/L=1 sst
             LONGITUDE: 29W to 0E(360)
             LATITUDE: 0 to 38.4N
             Z:  N/A
             TIME: 16-JAN 06:00
             DATA SET: /home/users/tmap/ferret/linux/fer_dsets/data/coads_climatology.cdf
 Total # of data points: 300 (15*20*1*1)
 # flagged as bad  data: 91
 Minimum value: 14.3
 Maximum value: 28.3
 Mean    value: 21.901 (unweighted average)
 Standard deviation: 4.3473

yes? show sym stat*
STAT_MIN = "14.3"
STAT_MAX = "28.3"
STAT_MEAN = "21.901"
STAT_STD = "4.3473"
STAT_NGOOD = "209"
STAT_NBAD = "91"

So, in a script you could keep a list of ($stat_std) and then plot that. This is an example where the REPEAT command will do what we need.
yes? sp rm sst_std.dat
yes? repeat/L=1:12 (stat sst; list/append/nohead/norow/file=sst_std.dat ($stat_std) )

Then read the ascii file sst_std.dat, and plot the result as a time series
yes? file/var=std sst_std.dat
yes? set var/title="Standard Deviation
for SST, x=29W:0W,y=0:38 from Coads Climatology" std
yes? plot std

On 2/1/2012 8:54 AM, Prakya Shree Ram wrote:
Dear Ferret friends,

I am using statistics command for calculating the standard deviation and given below is the answer I am getting:

yes?  statistics/x=29.3W:29.0W/y=38.1:38.4/l=8331 mask
             LONGITUDE: 29.3W to 29W
             LATITUDE: 38.1N to 38.4N
             Z:  N/A
             TIME: 16-JAN-2005 08:14
             DATA SET: ./avhrr_data.cdf
 Total # of data points: 72 (9*8*1*1)
 # flagged as bad  data: 3
 Minimum value: 16.55
 Maximum value: 17.59
 Mean    value: 17.142 (unweighted average)
 Standard deviation: 0.22601

This data seems to be fine. But, I would like to plot the standard deviation in a line graph, say from l=8331:10505. I tried to save the date in a saparate file but getting error. If I can plot the standard deviation for the speciak region data I need not have to save the data.

Thanks and Regards,

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

Privacy Policy | Disclaimer | Accessibility Statement