Closed Mikea1985 closed 8 years ago
Crap. This is the result of changing how I generated lookup tables. I thought I had got it right, but looks not so. Once I get this fixed, I'll bump to v0.3. :)
NOTE - you are still subtracting -0.5 off the pixel coordinates, which is something you shouldn't do anymore.
Quick fix for 1 and 2: after a PSF restore, do a .genPSF(). That will create the object longPSF from which the correct FWHM will be computed. This will be folded into the restore command soon.
NOTE: in 2, the magnitude should be different because you are using a different aperture radius. So it is not reasonable to compare photometry of two separate apertures unless you first correct for relative aperture radii. I am assuming you didn't which is why you got the strange result.
NOTE: even after a restore, the aperture corrections you calculated before as still kept and accessible via the appropriate functions.
3) This is probably a bug like what I refered to in the last message. Will fix and let you know when to update.
OK. Big changes to the psf/psfchooser/pill to handle these bugs. Save/Restore should now work. Also, psf.FWHM() now uses fromMoffatProfile boolean to determine if you want the moffat-only or moffat+lookupTable FWHM, because both are different.
I have noticed that if I first run through the tutorial (with Polonskaya.fits or my own images), then use the restore function mentioned in the tutorial:
and then do everything from the tutorial after the restore again, three things happen:
1)
goodPSF.FWHM()
returns the pure moffat FWHM, not the FWHM including the lookup table (even thoughgoodPSF.genLookupTable(data,goodFits[:,4]-0.5,goodFits[:,5]-0.5,verbose=False)
was run before storing the PSF).2) After running
the value of
phot.magnitude
is significantly different from what it was the first time (with the newly-made, non-restored PSF). In some casesphot.magnitude
differs by more than the uncertainty between the two cases. I assume this is because phot is using a different (incorrect?)fwhm
the second time.3)
fitter.fitWithModelPSF()
fails with the error message:(I'm aware that nBurn=nStep=nWalkers=12 is probably not enough, but I'm just trying to speed things up while I'm just playing around - that's irrelevant to the error.)
It is unclear to me whether a) the
psfStore
function needs to save more information (which thepsf.modelPSF(restore=filename)
then needs to restore correctly), or b) the tutorial needs to have a few extra steps explaining how to fully restore the restored PSF into something useable.