[Thread Prev][Thread Next][Index]

Re: [ferret_users] Writing output to txt file

Dear Ansley,

Thanks it worked.

Nitin Patil

On Thu, Aug 7, 2014 at 10:45 PM, Ansley Manke <ansley.b.manke@xxxxxxxx> wrote:
STAT is a command that displays its result to standard output. It's not a function, so "LIST STAT varname" is not valid syntax.

You can get the information from STAT into variables by using the set of symbols that are automatically defined when you issue the STAT command.
yes? stat sst
             LONGITUDE: 20E to 20E(380)
             LATITUDE: 90S to 90N
             Z:  N/A
             TIME: 01-JAN 00:45 to 31-DEC 06:34
             E:  N/A
             F:  N/A
             DATA SET: /home/users/tmap/ferret/linux/fer_dsets/data/coads_climatology.cdf
 Total # of data points: 194400 (180*90*1*12*1*1)
 # flagged as bad  data: 89622
 Minimum value: -2.6
 Maximum value: 33.15
 Mean    value: 18.095 (unweighted average)
 Standard deviation: 9.4023

yes? sh sym stat*
STAT_MIN = "-2.6"
STAT_MAX = "33.15"
STAT_MEAN = "18.095"
STAT_STD = "9.4023"
STAT_NGOOD = "104778"
STAT_NBAD = "89622"
so you could write
 let varmean = ($stat_mean)
 let varstd = ($stat_var)
and then list those to your file.  It would be best to add /TITLE= and /UNITS=  to the LET commands so the information is documented.

There are also functions and transformations that return the same information; the @AVE, @VAR, @NGD, @NBD, @MIN and @MAX transformations could be used to set up variables containing that information, or this function to return both the min and max.

yes? show func minmax

On 8/6/2014 11:06 PM, Nitin Patil wrote:
Dear All,

My script is as follows:

let gp1=Optical_Depth_Land_And_Ocean_Mean[d=1,x=73:81@ave,y=30:33@ave,k=1:122]
let gp2=Optical_Depth_Land_And_Ocean_Mean[d=1,x=73:85@ave,y=25:29@ave,k=1:122]
let mean=(gp1+gp2)/2
stat mean
list/file=GP2002.txt stat mean !!! NOT WORKING

I want to write the stat mean output in a txt file, any idea.

Nitin Patil

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

Privacy Policy | Disclaimer | Accessibility Statement