8.8 Statistics

Statistics are available from the stats procedure. If stats is given no parameters, you must specify the range over which statistics are calculated using the mouse cursor. Otherwise, stats can take two parameters, indicating the begin and end values for the range, in units currently displayed on the plotter. The /chan keyword can be used if you want to give the range in channels regardless of the current plotter units. For example:

	
getrec, 1                  ; Get some data 
stats                      ; Prompt user for the range using the mouse
stats, 1420.0,1420.1       ; Show stats over the specified range 
stats, /full               ; Show stats over the full spectrum
stats, /full, ret=mystats  ; Return statistics to the IDL data structure called mystats
print, mystats.mean        ; Prints the mean value stored in the mystats data structure
print, mystats.rms         ; Prints the rms value stored in the mystats data structure
stats, 0, 99, /chan        ; Show stats for the first 100 channels

Here is an example of the output of the stats command:

GBTIDL -> stats
Click twice to define stats region
    Chans    bchan    echan        Xmin        Xmax        Ymin        Ymax
    13661    10692    24352      1.6103      1.6155     -4.0177      14.259

                       Mean      Median         RMS    Variance        Area
                   -0.14350   -0.051825     0.55484     0.30785 -0.00074783