Produced by IDL 7.1.1
User Documentation

./guide
gmoment.pro

Last modification date:
Wed Sep 28 13:27:09 2016

gmoment

procedure gmoment[, bmoment][, emoment], [/chan], [/full], [/quiet], [ret=variable]

Find the first 3 moments of a region of the data in buffer 0.

The three moments are:

  m[0] = sum(data(i) * delta_x(i))
  m[1] = sum(data(i)*x(i))/m[0]
  m[2] = sqrt(sum(data(i)*(x(i)-m[1])^2)/m[0])
 
where the sums are over the region of interest, the x and delta_x values are the channel centers and spacings in the currently displayed x-axis units. delta_x is calculated independently for each channel and centered at that channel. The results are printed out and returned through the ret keyword. The display of the results can be turned off through the use of the /quiet flag.

The region is given in the currently displayed x-axis units and the sum starts from the channel number nearest bmoment and ends at the channel number nearest emoment. If the /chan keyword is used, then bmoment and emoment are given in channels. If a region is not specified the user is prompted to use the cursor on the plotter to mark the region. /full can be used to force gmoment to use all channels.

Blanked values are ignored.

The structure returned through the ret keyword has these fields.

gmoment was chosen because IDL already has a moment function.

Examples
   gmoment, 1000, 1520, ret=ret
 
Version
$Id$

Parameters
bmoment
in, optional
float
Start of region in x-axis units.
emoment
in, optional
float
End of region in x-axis units.

Keywords
chan
in, optional
boolean
Range specified in channels?
full
in, optional
boolean
Compute moments for full spectrum?
quiet
in, optional
boolean
Suppress the printing of the moments.
ret
out, optional
variable
Structure containing the results.


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:35 2016