eispac.util.scale_intensity(intensity, irange, log=True)[source]

Scale an array of intensities to have values in the range of 0 to 1. Can be useful for plotting.

  • intensity (array_like) – The intensity array. Can have any dimensions.

  • irange (array_like) – Min and max intensity values used for the scaling. Intensity values outside this range will be clipped to the nearest bound.

  • log (bool, optional) – If set to True, will scale the log of the intensity values. Default is True.


scaled – Array of scaled intensity values. Will have the same dimensions as the input intensity array. The caling is calculated using the equation scaled = (intensity - imin) / (imax - imin), where imin and imax are specified by the input “irange” parameter.

Return type: