Barak 0.3.2 documentation

barak.spec.rebin

«  barak.spec.read   ::   Contents   ::   barak.spec.rebin_simple  »

barak.spec.rebin

barak.spec.rebin(wav, fl, er, **kwargs)[source]

Rebins spectrum to a new wavelength scale generated using the keyword parameters.

Returns the rebinned spectrum.

Accepts the same keywords as Spectrum.__init__() (see that docstring for a description of those keywords)

Will probably get the flux and errors for the first and last pixel of the rebinned spectrum wrong.

General pointers about rebinning if you care about errors in the rebinned values:

  1. Don’t rebin to a smaller bin size.
  2. Be aware when you rebin you introduce correlations between neighbouring points and between their errors.
  3. Rebin as few times as possible.

«  barak.spec.read   ::   Contents   ::   barak.spec.rebin_simple  »