calculate_bin_widths

synphot.binning.calculate_bin_widths(edges)[source]

Calculate the widths of wavelengths bins given their edges.

Parameters:
edges : array-like or Quantity

Sequence of bin edges. Must be 1D and have at least two values. If not a Quantity, assumed to be in Angstrom.

Returns:
widths : Quantity

Array of bin widths. Will be 1D, have one less value than edges, and also the same unit.

Raises:
synphot.exceptions.SynphotError

Invalid input.