[Thread Prev][Thread Next][Index]

Re: [ferret_users] Writing output to txt file



Beyond this, it would be useful to be able to direct certain output to the jnl file as additional documentation.

A cheap workaround is to give the command, then simply copy/paste the resulting text back into Ferret. Ferret will complain on each line (making an ugly screen), but these complaints do not appear in the jnl file. You get quite readable output.

I often search the jnl files for, say, occurrences of "use" so I can tell which files were used to made a certain plot. But if I've brought data in via a script (as usual), that might not tell me what I want to know, or it might require additional searching through perhaps several scripts. I often wish to be able to easily send the output of SHO DAT/BRIEF to the jnl file, for instance, after making a plot. There are lots of other examples. This ability would be a great enhancement.

Billy K

On Aug 7, 2014, at 10:15 , Ansley Manke wrote:

> Hi,
> 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
>  
>              SEA SURFACE TEMPERATURE
>              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.
>> 
>> 
>> --
>> Regards,
>> Nitin Patil
> 




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

Privacy Policy | Disclaimer | Accessibility Statement