Skip to content

Fix radial_profile(percentiles=True) - #48

Merged
richteague merged 1 commit into
masterfrom
fix/radial-profile-nanpercentile
Nov 24, 2026
Merged

richteague merged 1 commit into
masterfrom
fix/radial-profile-nanpercentile

Conversation

@richteague

Copy link
Copy Markdown
Collaborator

radial_profile(percentiles=True) crashed with an AttributeError because of a typo (np.nabpercentile). This PR fixes it.

It also drops the [None, :] index when dividing the uncertainties by sqrt(nbeams). With assume_correlated=False, nbeams is the scalar 1.0 and the indexing failed. Broadcasting handles both cases.

Tested on the J1604 12CO v0 map: percentiles=True now runs with assume_correlated set to both True and False, returning (n,) profiles and (2, n) uncertainties. The mean path is unchanged.

🤖 Generated with Claude Code

np.nabpercentile -> np.nanpercentile, and divide the asymmetric
uncertainties by sqrt(nbeams) via broadcasting so the percentile path also
works with assume_correlated=False (where nbeams is a scalar).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@richteague
richteague merged commit 1d53570 into master Nov 24, 2026
3 checks passed
@richteague
richteague deleted the fix/radial-profile-nanpercentile branch November 24, 2026 17:19
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.

1 participant