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
Ellipse method with geometry argument just getting stuck and not loading all of a sudden in Jupyter notebook #1693
Comments
Did you change the packages (or update versions) in your Python environment? That would be the only explanation I can think of for why things suddenly changed behavior. Also, the |
Many thanks for getting back to me on this issue.I haven’t changed anything with the version as this is my first time using photutils so I just recently installed it for the first time (so it’s the most current version). I was unsure if it was due to setting parameters in the EllipseGeometry object as 0 for sma, eps and pa but again, that wouldn’t explain why it worked for a short while and suddenly stopped. I also hadn’t touched the python environment it’s in when this happened so very puzzled. I tried changing the eps, pa and sma to the default values that are stated in the docs and the same thing happens, it gets stuck but works perfectly quickly when I omit the geometry argument.
Shruti
… On 18 Jan 2024, at 17:44, Larry Bradley ***@***.***> wrote:
Did you change the packages (or update versions) in your Python environment? That would be the only explanation I can think of for why things suddenly changed behavior. Also, the isophote code in Photutils has not changed since version 1.7.0 -- and that was only a bugfix in the calculation of upper harmonics.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
@shruti-ramaiya Here's an example of an "off-center" isophotal fit (modified from the example shown in the docs here: https://photutils.readthedocs.io/en/latest/isophote.html): https://gist.github.com/larrybradley/07f58039917dada1e84a725de2d7a313 It is important that your initial Note that setting Also, if there are other sources in the image, the fit will likely fail. |
Dear Larry,
Thank you for linking the an example of using the geometry argument, I’d used this as a reference when writing my code but I will go through and fiddle around with the data again and see if I can get it to work.
I appreciate all your help
Best wishes,
Shruti
… On 18 Jan 2024, at 20:03, Larry Bradley ***@***.***> wrote:
@shruti-ramaiya <https://github.com/shruti-ramaiya> Here's an example of an "off-center" isophotal fit (modified from the example shown in the docs here: https://photutils.readthedocs.io/en/latest/isophote.html):
https://gist.github.com/larrybradley/07f58039917dada1e84a725de2d7a313
It is important that your initial geometry be close/reasonable to the data. If not, the fit will fail. In the notebook above, I show how you can plot the initial ellipse geometry on the data to check.
Note that setting sma=0 will not work. sma is the semimajor axis length.
—
Reply to this email directly, view it on GitHub <#1693 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AWW7NVJV7ICF5M6CQLEQPIDYPF5YZAVCNFSM6AAAAABB7ELKEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJZGEZDMNJQGM>.
You are receiving this because you were mentioned.
|
I am doing an analysis that involves using fitting elliptical isophotes around galaxy images for which I am using photutils
For a galaxy image, I first begin by using the Ellipse class, as the galaxy is centered in the image and this works as expected
The code for which is,
`ellipse = Ellipse(my_image)
isolist = ellipse.fit_image()
isolist.to_table() #displaying results using astropy table method
`
Now, for most of my data, the galaxy is NOT centered in the image, so using the same galaxy image example, I do the same process but this time passing the geometry argument into the instance of the Ellipse class. For the geometry object I input the same centre coordinates and this was all working fine. Doing so gave me the exact same results as when I omitted the geometry argument, which is what was expected.
The code for which is,
`
geometry = EllipseGeometry(x0=150,y0=150,sma=0.,eps=0.,pa=0.)
ellipse = Ellipse(my_image,geometry=geometry)
isolist = ellipse.fit_image()
isolist.to_table() #displaying results using astropy table method
`
For the last couple days this was working perfectly and running extremely quickly.
Now all of a sudden, the code block where I input the geometry object is just not loading in my jupyter notebook. It is getting stuck on the fit_image() portion of the code and just failing to load at all, its just getting stuck on *. I have changed nothing and I am not sure why all of a sudden this is happening. It loads very quick when I remove the geometry argument but it was running quick before even with this argument and nothing has changed
I thought perhaps a memory issue? Something due to me rerunning that code block multiple times but even after clearing jupyter notebook memory and trying again the same issue persists.
I am only confused as it was running very quick prior to this and then now won't load at all.
If anyone has any ideas or suggestions as to why this is happening I would be most grateful
The text was updated successfully, but these errors were encountered: