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

Isophotal Ellipse model #5

Open
ConnorStoneAstro opened this issue Feb 2, 2023 · 9 comments
Open

Isophotal Ellipse model #5

ConnorStoneAstro opened this issue Feb 2, 2023 · 9 comments
Labels
feat Introduces a new feature to the codebase new model Request for a new kind of AutoProf model

Comments

@ConnorStoneAstro
Copy link
Member

Currently no isophotal ellipse model is available. Though models exist with similar levels of expressiveness, the isophotal ellipse model is an industry standard that should be available. The challenge is that there is no closed form way to handle nested elliptical isophotes.

@ConnorStoneAstro ConnorStoneAstro added the feat Introduces a new feature to the codebase label Feb 2, 2023
@ConnorStoneAstro ConnorStoneAstro added the new model Request for a new kind of AutoProf model label Feb 6, 2023
@dr-guangtou
Copy link

@ConnorStoneAstro Curious to know whether there is any progress on this.

It seems that the non-parametric galaxy model can not replace the isophotal ellipse one since it doesn't allow the shape of the galaxy to vary.

@ConnorStoneAstro
Copy link
Member Author

@dr-guangtou good question, there is a warp model class which can have a variable shape with radius and has essentially as much expressiveness as an isophotal ellipse model. However the shapes it makes are not strictly ellipses so it is not interpreted in the same way. You can try the nonparametric warp galaxy model to see if it fits your needs.

It turns out that strictly elliptical isophotes are challenging to produce in a forward modelling context with practical speeds.

@ConnorStoneAstro
Copy link
Member Author

Playing around with the warp model I have found it is actually able to represent spiral arm and bar features very well, possibly better than elliptical isophotes. So it is not clear which is "better", still it would be nice to have a strict elliptical isophote model for testing. An issue that arrises is that there is no straightforward (or fast) way to deal with overlapping isophotes. The warp model circumvents this issue

@ConnorStoneAstro
Copy link
Member Author

Section 2.4 in the pdf below demonstrates what a warp model can do. It should be able to fill the needs of an isophote model

https://raw.githubusercontent.com/ConnorStoneAstro/AutoProf/main/docs/tutorials/ModelZoo.pdf?raw=true

@dr-guangtou
Copy link

@ConnorStoneAstro Thx for the quick reply! Big fan of your work here.

I am playing with the different non-parametric models in the ModelZoo. They look really flexible and could have a lot of interesting applications. But, for my current science goals, I am looking to replace iraf.isophote with a Python version that is faster and more stable than the photutils one. I really like the now legacy AutoProf. It is still fully functional if I just need to extract the 1-D profile of a single galaxy, right?

I can see that isophote modeling is challenging for forward modeling and it is not easy to handle the overlapping regions. For now, I think I will just deal with contaminations or blended scenarios separately, and run the 1-D profile extraction in a "single object mode". But, in the end, I think we are just looking for a robust & flexible 2-D non-parametric photometric model. Will test the performance of the non-parametric models.

@ConnorStoneAstro
Copy link
Member Author

@dr-guangtou glad you like the software! Yes, the AutoProf-Legacy version remains fully functional and even continues to receive updates on occasion. A potential synergy is to use AutoProf to model the image, then subtract everything except the main object, afterwards you can run AutoProf_Legacy on an image that effectively only has a single object.

Thanks for reaching out though, I will think more about this feature in particular now that I know there is desire for it specifically. Also, if you have any ideas how to do this I would appreciate it! The core problem comes down to the fact that in forward modelling one must be able to evaluate a model at a specific pixel location, but with isophotal ellipse fitting this is not what is given, instead it is a representation of a number of ellipses which then must be projected onto the sky to find out which pixels they land on. It turns out that inverting the equations is essentially impossible for a general ellipse, so one has to get creative. I have developed things in the past that work, but which are too slow for regular use.

@ConnorStoneAstro
Copy link
Member Author

Update just to keep track of progress. I have something that almost works, but there seem to be certain configurations of PA/q that wont converge. The idea was to assign a radius to each pixel then go to that part of the PA/q profiles and get the ellipse parameters, then update the radius based on that. This can be applied iteratively until convergence. Unfortunately some arrangements dont converge so I may need a more clever update step.

@dr-guangtou
Copy link

Just saw this...Thanks for the effort and the update.

Is this already in the updated version of autoprof already? I wonder whether you have a demo or an example. I would love to try it out now.

@ConnorStoneAstro
Copy link
Member Author

I never ended up integrating it into AutoPhot since I couldn't get the algorithm to converge in all cases. If you are ok with a method that works for gradual PA/q shifts then I could add it in fairly easily. I'll demo below what the current state looks like.

First, here is an example profile of q and PA as a function of radius. As you can see there are some quite extreme changes in the parameters. Though there are no crossing isophotes.

example_q_pa

From those profiles I ultimately need to determine the radius at each x,y position so that I can enter it into the I(R) function and get a brightness. Below is a contour plot showing the radius at each position in the image. As you can see from the contours, this creates an ellipse model. The isophotes would then be ellipses.

example_ellipse_contours

However, while it visually looks good, there are regions where the radii are not exactly correct. The plot below shows roughly the error in radius vs position. So there are some places where the error is ~ 4% (near the center), though most of the errors are less than 1%.

example_convergence

For places where the change in q/PA is gradual the results are nearly exact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Introduces a new feature to the codebase new model Request for a new kind of AutoProf model
Projects
None yet
Development

No branches or pull requests

2 participants