Description: General display program command mode procedure for computing a simple average on any number of loaded bands and creating a new data array as a result. The newly created array will be made available to the user in the next available band number.
Navigation information for the resultant output array will be copied from the first input band. Warnings are issued if the units are not the same for all inputs. In the case of the /raw option, warnings will also be issued if the raw data types are not the same for input grids as well as the slope, intercept and scale type conversion values used to convert from raw to geophysical values.
See the general summation function for a more robust averaging capability allowing weights, exponents and constants to be applied while averaging.
Note: The command mode procedure load must be run before band_avg.
Usage: band_avg, band_no=band_no, /raw, /geo, min=min, max=max, ignore=ignore, tol=tol, replace=replace, exclusive=exclusive, inclusive=inclusive, err=err
Examples:
| band_no | An array containing the numbers of the loaded bands to average. Relative to 1. (Required) |
| raw | Average the specified input bands in terms of raw data values. Floating-point operations will be performed on the raw data. The resultant grid will then be stored in the raw data type and the raw to geophysical scaling conversion variables: slope, intercept and scaling type will be copied from the first input array. If values in the resultant grid fall outside the possible range for the raw data type, then they will be assigned to the min or max possible values respectively. (Default) |
| geo | Convert the input bands to geophysical values before computing the average. The resultant output array will be stored in floating point values in terms of geophysical data values. Thus, the raw to geophysical scaling conversion variables: slope, intercept and scaling type will be set to 1.0, 0.0 and 'linear' respectively. |
| min | Only values greater than or equal to this value will be used when computing the mean. These values should be specified in terms of either raw or geophysical data values, depending on whether the user has specified the /raw or /geo keywords. When min is used, the average at every point is computed based on the number of non-excluded values at that point. |
| max | Only values less than or equal to this value will be used when computing the mean. These values should be specified in terms of either raw or geophysical data values, depending on whether the user has specified the /raw or /geo keywords. When max is used, the average at every point is computed based on the number of non-excluded values at that point. |
| ignore | Data values to ignore when computing the average. These values should be specified in terms of either raw or geophysical data values, depending on whether the user has specified the /raw or /geo keywords. When ignore is used, the average at every point is computed based on the number of non-ignore values (+- tol) at that point. |
| tol | A tolerance value to use in applying the ignore value. (Default=0.0) |
| replace | The replace keyword is only applicable when either min/max or ignore exclusion criteria are set. This is the value which will be used in the resultant output array wherever valid calculations have not taken place. (Default for min/max exclusion is min-1 if min is set or max+1 if only max is set; Default for Ignore/Tolerance exclusion is the ignore value) |
| inclusive | This keyword is only applicable when either min/max or ignore exclusion criteria are set. Inclusive means that all input values must be valid in order to perform the average function. |
| exclusive | This keyword is only applicable when either min/max or ignore exclusion criteria are set. Exclusive means that only one valid (i.e. non-excluded) value is required in order to perform the average function. (Default) |
| err | Pass back an error status. 0 = no error. Non-zero = an error occurred. |
| Curator: OceanColor Webmaster
Authorized by: gene carl feldman |
Privacy Policy and Important Notices
Updated: 20 March 2008 |
|