zkbt / chromatic

Tools for visualizing spectrosopic light curves, with flux as a function of wavelength and time.
MIT License
14 stars 4 forks source link

Fix weighting issue for non-flux quantities in binning. #162

Closed zkbt closed 2 years ago

zkbt commented 2 years ago

@catrionamurray identified a weird feature where binning lots of wavelengths together (e.g. to make an integrated-wavelength light curve) can introduce a transit into non-flux quantities like wavelength_2d or background. We think this is because of the uncertainty weighting that has been applied to all quantities during the binning. Let's fix it, to avoid injecting transits into data that we want to be useful as diagnostics.

zkbt commented 2 years ago

Here's our hypothesis. When we bin across all wavelengths, we’re essentially multiplying the left two panels together and summing along columns. The right panel is the inverse variance normalized by its median at each wavelength, showing that the in-transit times get relatively higher weight at shorter wavelength. Because quantities like wavelength_2d and background decrease sharply toward shorter wavelengths, when we shift the weights toward shorter wavelengths, we’re also shifting toward lower values.

image

It's a subtle effect, but we should try to avoid it nonetheless! I think I’m just going to turn off the uncertainty weighting in the binning for non-flux quantities. This should avoid cross talk between the flux and any potential cotrending variables.

zkbt commented 2 years ago

Closed (by just pushing to develop). We got rid of uncertainty weighting for all flux like quantities except flux and model.