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

DM-46342: Reorder and pad artifact mask handles #72

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

arunkannawadi
Copy link
Member

No description provided.

if dataIds != psfMatchedDataIds:
supplementaryData.warpRefList = reorderAndPadList(
supplementaryData.warpRefList, psfMatchedDataIds, dataIds
)
Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea what I was thinking here. These are not used in this block, and supplementaryData.warpRefList is already reordered and padded by the time it gets here.

Copy link
Contributor

Choose a reason for hiding this comment

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

And those pads were the Nones that were causing the crashes as I understand it?

Copy link
Member Author

Choose a reason for hiding this comment

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

They were Nones yes. But the supplementaryData was never used in this block or after, making these lines unnecessary.

if dataIds != psfMatchedDataIds:
supplementaryData.warpRefList = reorderAndPadList(
supplementaryData.warpRefList, psfMatchedDataIds, dataIds
)
Copy link
Contributor

Choose a reason for hiding this comment

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

And those pads were the Nones that were causing the crashes as I understand it?

):
if warpRef is None:
continue
assert warpRef.dataId == outputRef.dataId, "DataId mismatch between warp and artifactMask"
Copy link
Contributor

Choose a reason for hiding this comment

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

This I don't understand. Isn't it possible for the artifactMaskRefList to be padded with None and then outputRef.dataId isn't valid? I would think that this should have an if outputRef is None: continue to account for the possible padding.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're absolutely right. I should condition on outputRef.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm back to saying that checking for None and continueing is unnecessary.

First, these data handles are from the time QG was generated and they know nothing about which quanta actually succeeded. This is particularly true with outputRef, which would only get reordered and never padded. Second, the altMaskList may be padded, and yet a check is not warranted. If the padded value (it's a dict with specific schema of empty list) is passed, it simply produces a trivial mask with all 0s (these are just the additional mask that needs to be applied). It'd be cleaner to persist it than skip it, since the storage cost to save a mask is low and similar masks would be persisted if there were no artifacts whatsoever. If we attempt to not persist this for padded quanta, then we would have to special case in assemble_cell_coadd and it would not be worth the trouble IMO.

P.S.: I was concerned why the previously failing quanta were passing with this branch setup even before I added this guard, and I have an explanation now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see your point. All output refs will be defined, so there won't be padding there. That makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

For the future us, if the corresponding PSF-matched warp is missing for a warp, then the artifact_mask is set to NO_DATA everywhere, which will automatically avoid a warp without its PSF-match counterpart from entering into a coadd.

@arunkannawadi arunkannawadi merged commit b7c32bf into main Sep 18, 2024
3 checks passed
@arunkannawadi arunkannawadi deleted the tickets/DM-46342 branch September 18, 2024 15:54
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.

2 participants