annayqho / TheCannon

a data-driven method for determining stellar parameters and abundances from stellar spectra
MIT License
40 stars 17 forks source link

Write a function to bin down spectra #58

Closed annayqho closed 9 years ago

annayqho commented 9 years ago

Bin it down by combining 2 pixels at a time (write a function, smooth_spectrum or something, that takes in a dataset object and returns a binned-down dataset object)

binned wl = (wl1 + wl2) / 2 binned flux = (ivar1 x flux1 + ivar2 x flux2) / (ivar1 + ivar2) binned ivar = np.sqrt(ivar1^2 + ivar2^2)