Some notes on galaxy modeling


The galaxy model fits (PSF convolved, Devaucouleur, Exponential & Sersic) have been having trouble converging on the correct R_major_ values and other values. I explored the code and found some issues.

Earlier this spring / summer, I found that the elliptical shape parameters (Sxx, Syy, Sxy) had some inconsistent representations. One particular problem came from the fitting limits for Sxy. It is critical to keep Sxy in the right range otherwise the value can result in a hyperbolic profile, rather than an elliptical one, with resulting NAN values in certain quadrants. Unfortunately, the allowed range for Sxy is a function of the current value of Sxx,Syy. The part of the fitting code which limits the range of values for Sxy had a factor of sqrt(2) in the wrong place. This error ultimately resulted from the fact that the DEV,EXP,SER models use Sxx,Syy to represent the effective radius, not a 'sigma', so there is a factor of 2 different in the model for for these terms. to be more specific, the functional form for DEV,EXP,etc is f ~ exp(-kappa q(1/n)) where q = (x/Sxx)2 + (y/Syy)2 + x y Sxy, while for a Gaussian (and the other stellar PSF models), the functional form uses q = (x/2Sxx)2 + (y/2Syy)2 + x y Sxy. I fixed this problem and as a result the angle distribution was well fitted, but the scale-lengths were still not right.

Next, I found that the normalization of q was not quite right. There is a coefficient in the equation above, kappa, which must be correctly set so that Sxx (or Rmaj after rotation) is the effective radius, that is the radius inside which 1/2 of the flux is found. The value of kappa is necessarily a function of the model index n (n = 0.5 to 5.0). I was using an analytical representation of kappa based on an article about Galfit. However, I missed a coefficient from that representation and was not getting the right value of kappa. I also was using an approximate value for the central pixel which was too crude. Fixing these issues gives a better fit to R_maj_, as seen in the plots below. However, it is still getting the value of R_maj_ wrong by a factor of 40% for the largest values of R_maj_.

Finally, I realized that the fits are very sensitive to the local sky. I allowed the sky to be fitted in as part of the model fit. This does really very well: