Closed pmelchior closed 3 months ago
The pixel spectrum is straightforward for multi-observations, but the adaptive morphology is trickier. What we basically attempt to do is to determine the moments of the observed images, but in the frame of the model. That has two different steps:
Given item 2, it sounds best to me to treat the moment measurement (including the definition of the adaptive box) independently across the observations and only combine the moments afterwards for the final estimate of the Gaussian shape.
closed with #74
None of the init methods were tested for multi-observation scenarios. The main reason is that it's not clear at all how that should be done. For instance,
spectrum = init.pixel_spectrum(observations, center)
can imply a number of things that are supposed to happen:observations
contain different channels, and the resultingspectrum
gets a concatenation in the order of observations. However, this may not be the order of channels in the model frame. In this mode, we should read the model frame channels and associate the observed channel with the model channel accordingly.observations
contain (at least some) identical channels. Should we average the results? Maybe.So, we could improve this by implementing a channel check as in item 1 and maybe a warning in case 2.
The situation gets more complicated for
adaptive_morphology
. The method finds the largest bounding box aroundcenter
to contain light that has the same color as the center pixel. It then measures the moments of the image in that box to create a Gaussian with those moments. If the placement or resolution of the observations is different, we have to make adjustments to how this Gaussian moments are combined. In particular, we can take advantage of DEIMOS (#65), which means we have deconvolved moments, so the effects of different PSFs are already taken out. What's missing is that different resolutions means a different numbers of pixel for an objects with the same physical size. But that correction is also analytic: the correct factor is $(s\mathrm{frame} / s\mathrm{obs})^p$ for the $p$-th moment. So, we can combine the moments across different observations.Originally posted by @pmelchior in https://github.com/pmelchior/scarlet2/issues/72#issuecomment-2221127686