Skip to content

Conversation

@mrawls
Copy link
Contributor

@mrawls mrawls commented Dec 24, 2024

No description provided.

@mrawls mrawls requested a review from parejkoj December 24, 2024 07:56
Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get a unittest that confirms the bug is fixed? Because as coded, this wouldn't fix it (and I'm now not sure what the underlying bug truly is anyway!).

xv = (np.rint(sources.getX() - mask.getX0())).astype(int)
yv = (np.rint(sources.getY() - mask.getY0())).astype(int)

# The source catalog may not be contiguous.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this comment is necessary: the lines below say the same thing.

yv = (np.rint(sources.getY() - mask.getY0())).astype(int)

# The source catalog may not be contiguous.
if not sources.isContiguous():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this is too late to fix the problem, since the error report has it coming from the xv=... line above. When I said line 854, it must have been on a different version of the file. What I had meant was just after the call to self.sourceSelector.selectSources in _sourceSelector(). Except _checkMask is called on sources, not selected, so I don't see how it could fail in this way, unless the input catalog is broken somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the putative fix in _checkMask because it operates on the source table in question, but you're probably right that this would best be handled earlier.

@mrawls
Copy link
Contributor Author

mrawls commented Jan 9, 2025

I'd like to add a unit test but I'm not sure how to make a non-contiguous source catalog on purpose. I think the test would best go here; I can work on this tomorrow.

@parejkoj
Copy link
Contributor

I think we need to find out how this was triggered in this first place. I posted a followup question on the ticket, because it doesn't seem possible to have failed with a non-contiguous, unmodified catalog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants