Skip to content

Conversation

cmsaunders
Copy link
Contributor

No description provided.

bins=lineBins)
countAlongStreak, *_ = scipy.stats.binned_statistic(distanceFromLineEnd, maskDetections,
statistic='count', bins=lineBins)
detectionFraction = detectionsAlongStreak / countAlongStreak
Copy link
Contributor

Choose a reason for hiding this comment

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

Having just squashed a divide by zero runtime error yesterday I thought was impossible... think if truly impossible

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 don't think this can give a runtime error, because these are arrays, so dividing by zero gives a RuntimeWarning, not an error.

lineModel = LineProfile(data, weights, line=line, detectionMask=detectionMask)
# Skip any lines that do not cover any data (sometimes happens because of chip gaps)
if lineModel.lineMaskSize == 0:
if lineModel.lineMask.size == 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

Double check that you didn't mean if lineModel.lineMask.sum() == 0: here. lineMask.size isn't the same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it took me a while to figure out what it should be because I did this part a while ago, but it should be lineMask.sum() == 0. Good catch!

@cmsaunders cmsaunders merged commit 2825c19 into main Oct 9, 2025
5 checks passed
@cmsaunders cmsaunders deleted the tickets/DM-50118 branch October 9, 2025 02:25
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