photutils icon indicating copy to clipboard operation
photutils copied to clipboard

How to use photutils.ellipse.fit_image() to fit the profile of Low surface brightness galaxy

Open PaulLiu666 opened this issue 1 year ago • 1 comments

I have a low surface brightness galaxy. image The maximum pixel value is 0.39, the minimum pixel value is -0.32. Then I use photutils.ellipse.fit_image() to fit the galaxy. There is a warning.

AstropyUserWarning: No meaningful fit was possible.

I can't get a real fitting.

### Tasks

PaulLiu666 avatar Jun 08 '23 05:06 PaulLiu666

Actually I have the same problem and I am still trying to figure out how to solve it. What I have noticed is that: -increasing maxgerr and conver parameters about 2*default_value helps a lot the convergence, reducing the computation time. However it reduces the accuracy. -multiply the image for a large number (e.g., 1012) helps a lot the convergence and the numerical error introduced by 1012/10**12=1 is negligible. Unfortunately, in this way, a3,b3.a4,b4 are automatically set to nan. Which is not necessarily a bad thing in the case of LSB galaxies. -increasing maxit helps the convergence but increases drastically the computation time.

-Finally, THE MOST IMPORTANT, the initial guess must be an EllipseGeometry and it has to be accurate. Fit_image starts fitting the deviations from such EllipseGeometry shape, hence, if EllipseGeometry is not accurate Fit_image fails at the first isophote and stops saying "AstropyUserWarning: No meaningful fit was possible."

I hope this helps, waiting for a better answer from the developers

nicolabellucco avatar Jul 04 '23 08:07 nicolabellucco