void drms_segment_autoscale ( DRMS_Segment_t seg,
DRMS_Array_t arr,
double *  autobzero,
double *  autobscale 
)

Sets the scaling parameters in the seg->record keyword (see drms_segment_setscaling), to values based on the extrema of the data array. The scaling parameters are set so that the unscaled data would occupy the full range of the segment fixed-point type; for example the maximum value of the array would be represented by 127 and the minimum by -128 in the segment data file if the type were DRMS_TYPE_CHAR. The scaling parameters will only be changed, however, if the original data would not otherwise fit unscaled into the range of the segment data type. Setting the scaling parameters for segments of floating-point type is probably a bad idea, but is done anyway, without regard to range. For other types, the scaling parameters are simply set to 1 and 0.

Parameters:
seg The segment whose scaling is to be retrieved.
array The DRMS array whose data is to be autoscaled.
autobzero bzero value to offset data by, returned by reference.
autobscale bscale value to scale data by, returned by reference

Definition at line 2391 of file drms_segment.c.


Generated on Mon Mar 26 07:00:50 2018 for JSOC_Documentation by  doxygen 1.5.7.1