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

Math operations and binning should treat `.model`(s) in `RainbowWithModel` the same as `flux`. #140

Closed zkbt closed 2 years ago

zkbt commented 2 years ago

Right now, if we bin a RainbowWithModel, the flux gets uncertainty weighting, but everything else gets uniform weighting. Likewise, if we do math on a Rainbow, the flux and uncertainty?!?!) are affected by the calculation, but nothing else.

For making it easier to propagate models through multiple Rainbow actions, we should change the RainbowWithModel to:

zkbt commented 2 years ago

Oh fudge! This made me check; right now normalize() affects uncertainty, but none of the basic math operations do. That's a bug. When we do rainbow*2, both its flux and its uncertainty should be multiplied by 2.

zkbt commented 2 years ago

Interestingly, it turned out that inverse-variance uncertainty weighting was actually happening already. All fluxlike quantities get uncertainty weighting. None of the wavelike or timelike ones get uncertainty weighting because it would require too many choices and would produce uneven time/wavelength grids that cause more trouble than they'd be worth.