Closed hcferguson closed 4 years ago
That's maybe a little opaque but not a bug. We split the observed psfs
into a minimal part and a difference kernel. The minimal part prevents undersampling. It's the effective PSF of the model, which we convolved with the diff kernel to match the observations. PointSource
renders a shifted model_psf
from its analytic form, a small Gaussian. That's what self.frame.psf.__call__
is supposed to do. You attempted to use the images of observed PSF instead. That fails because we don't include code to shift a PSF image to an arbitrary location.
Thanks @pmelchior. If I have an analytic ePSF that is separate for each channel, can I pass it a function that takes the channel as an argument, as well as x,y?
That is possible, just not with the PointSource
class included in scarlet. I think the best way to do this would be to initialize both your model frame and observation without passing either a PSF. That prevents the code from doing a convolution during fitting. For your point sources you'll need to either subclass PointSource
or more likely scarlet.component.FunctionComponent
and take ePSF
as an argument. Then you can set your parameters (x, y, amplitude) similar to the way it is done in PointSource, where you can make your model as simple or complex as you like.
Thanks. I'll give that a try.
@hcferguson Can I ask you why you want a model PSF that is different in each band. We don't support this mode for a good reason, namely that you can't guarantee consistent colors that way.
I have created an oversampled ePSF "model" using the machinery in Photutils. For my current tests, it's not essential, I didn't instantly see that you could feed Scarlet an oversampled PSF, and in any case the photutils machinery already does the interpolation, so I figured I could just pickle the models.
I tried the quick-start guide with just the point source. It works if I use the Gaussian model PSF, but if I swap in the PSFs that were read in earlier in the example (by assigning
model_psf = psfs
it fails. Traceback below.