Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: No meaningful fit was possible. [photutils.isophote.ellipse] error when slightly changing galaxy centre #1696

Open
shruti-ramaiya opened this issue Jan 21, 2024 · 2 comments
Labels

Comments

@shruti-ramaiya
Copy link

shruti-ramaiya commented Jan 21, 2024

I am currently using photutils Ellipse() method to fit isophotes around galaxies.

I am set to run the code on many galaxy images but for now I am just experimenting getting code to run on a single image.

I have two images of the same galaxy. One of the images is centered on the galaxy and one is very slightly offset from the centre of the galaxy.

When starting with the basic Ellipse() method and not including the geometry argument (i.e. so the fit starts from the image centre):

a) on the image where the galaxy is slightly off centre (but ellipse is still fitting from the image centre), a resulting fit is successfully produced

however,

b) when running ellipse on the image where the galaxy is centered, it says: WARNING: No meaningful fit was possible. [photutils.isophote.ellipse]

The reason for opening this issue is that I am unsure if this is caused the images or is an issue with how the code is fitting in the background.

For both images, the one slightly 'off centre' has pixel positions (149, 149) and checking the galaxy centre for the same image gives pixel values (152,157), so reasonably close to each other.

I was just wondering if anyone was able to provide insight into the reason for getting an error for the slight shift in position in this case where, since I am omitting the geometry argument, the only changed variable is the galaxy position. Understanding this will help me know how to proceed when running code on thousands of galaxies and how I can combat this to avoid loss of data from unsuccessful fits. I was unable to find insight into the cause of this issue online but any guidance on how to work around would be most appreciated.

Thank you

@larrybradley
Copy link
Member

@shruti-ramaiya I would recommend using a centroiding algorithm to define your initial guesses for the centers. In your example, you are 8.5 pixels away from the true center. I think you need a better starting guess. Also, if your galaxies do not have elliptical isophotes, then the ellipse-fit is not going to give good results and it's not surprising that it could fail (not converge).

@shruti-ramaiya
Copy link
Author

Thanks Larry, I'll look at using a centroiding algorithm for my initial guesses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants