|
User Documentation |
|||||||||
prev file | next file | ||||||||||
SUMMARY: fields | routine DETAILS: routine | ||||||||||
./guide gmoment.pro
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.
gmoment, 1000, 1520, ret=ret
Parameters | |
bmoment |
Start of region in x-axis units. |
emoment |
End of region in x-axis units. |