Closed aagnello closed 10 years ago
what PSF model are you using? Is this for SDSS or PS images? I believe the standard PSF models (tractor.basics.GaussianMixturePSF, eg) already have fully functional derivatives.
At the moment, for the SDSS case, we are using a single Gaussian with FWHM=1.4'' as a first guess. I'm sure this can be done way better, e.g.: -- reading run,camcol,field from the header and finding the psf information on the sdss database from those? would that be possible? -- however, rumor has it the db info on the psf is not very accurate for sdss; so could we simply model the psf as two Gaussians and fit for those as well? Perhaps the only missing step is passing the initialised single Gaussian to GaussianMixturePSF and requiring that the MGE use just two components when fitting. I'll leave that to you, since you have a way clearer idea of how things work within SDSS and the Tractor.
get_tractor_image supports two different PSF models (specified by setting psf='dg' or psf='kl-gm'). 'dg' is a double-Gaussian, using fit values from the SDSS headers. 'kl-gm' also uses SDSS pipeline results; it instantiates the "KL" (eigen-PSF) model and fits a Gaussian mixture model to it.
In my experience the SDSS PSFs are fine, but to be honest I haven't scrutinized them too closely.
I just pushed a commit where the single Gaussian PSF optimizes fine :-) I had to carefully take care of the thawing/freezing before and after optimizing the PSF. I do now see intermittent patch errors that I think happen when the model goes crazy: we'll address this cause next! Part of our goal is to work at speed, so we'll stick with the single Gaussians for now: I'll check out the dg model in the SDSS context as necessary. Thanks for the pointers, Dustin!
We now need the derivatives to be fully implemented for the psf too. Based on the examples we have explored (LensTractor runs successfully!), we would need a few steps of psf optimization per round, to avoid the "ringing" in residuals between peaks and wings. Also, in practice the psf is not the same in different bands, so we'd need to allow for (small?) variations across bands when optimizing it. @dstndstn , you're the ideal candidate for this task, for obvious reasons.