prg_profile_avg_and_max_get()
Abstract
Gets the average and maximum values for a profile.
Syntax
prg_profile_avg_and_max_get (profile_handle, avg_ptr, max_ptr)
| Argument | Type | Description |
|---|---|---|
profile_handle |
PrgT_Profile_Handle |
Profile of interest. |
avg_ptr |
double * |
Area to be filled with the abscissa-weighted average profile value. |
max_ptr |
double * |
Area to be filled with the maximum profile value. |
Return Type
PrgT_Compcode
PrgC_Compcode_Success if the average and maximum are obtained; PrgC_Compcode_Failure otherwise (*avg_ptr and *max_ptr will be 0.0).
Header
prg_profile_funcs.h
Details
This function computes the average and maximum values for a profile. If the profile is empty or an error occurs, *avg_ptr and *max_ptr will be 0.0.
The average is weighted by the length of the bucket. If the final value is defined and non-zero, the length of the final bucket is not known; in this case, the final value is weighted for a single unit (of time, or whatever the abscissa value is defined to be).
If the profile contains undefined values, the undefined regions are ignored. Thus:
- For the average, undefined values are not added into the value or the abscissa sums.
- For the maximum, undefined values are skipped.