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

Why Does the COG Drop When Apertures are Larger than Cutout #171

Open
robelgeda opened this issue Jan 3, 2023 · 3 comments
Open

Why Does the COG Drop When Apertures are Larger than Cutout #171

robelgeda opened this issue Jan 3, 2023 · 3 comments
Labels
Photutils Question Further information is requested

Comments

@robelgeda
Copy link
Contributor

When apertures are larger than the cutout image, there seems to be a drop in the COG. This could be because of how area is calculated in Photutils. Its currently not clear if this is a bug or a real feature but should be looked at.

@lucatelli
Copy link

Hi there, what is the state of this issue?

I am using petrofit to analyse Radio Interferometric images, and I found two occasions where this happens: 1. the same as you described; and 2. in the case where the slice (or averaged brightness profile) oscillates between + and - values.

The second case, seems to be natural, but the first case I managed to do a 'workaround' just by inspecting if the values of R_last are np.nans, which means that there is no enough radial points to fill the 2xRp region. So at the end, I just have to run the photometry again with a larger area (i.e. min of 2xRp) and therefore the COG should be fine. However, more experiments are yet to be made.

@robelgeda
Copy link
Contributor Author

robelgeda commented Mar 8, 2023

Thank you so much! This is very helpful to know.

I just want to confirm and document that case two is natural. Here is an example profile (without any background subtraction):

image

Note that the issue with the corners does not occur here because the apertures are spaced out by a few pixels. When you look at the sum of negative pixel values to positive pixel values within an aperture, you see the negative values start to dominate. i.e This kind of dip can be attributed to less than ideal background subtraction:

image
In this plot the x-axis is aperture index instead of pixel radii but it maps the same since the radii are evenly spaced.

This applies to case two even if the masked sources were set to 0 instead of np.nan.

I am working on case one now.

@lucatelli
Copy link

Hi there. I have missed this. Thank you so much for your reply.

OKay, I will keep an eye on this to see what I can do.

@robelgeda robelgeda added the Question Further information is requested label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Photutils Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants