Skip to content

Censor unbracketed half-power crossings; weight by populated lag range - #44

Merged
richteague merged 4 commits into
masterfrom
fix/half-power-lag-bracketing
Nov 24, 2026
Merged

richteague merged 4 commits into
masterfrom
fix/half-power-lag-bracketing

Conversation

@richteague

Copy link
Copy Markdown
Collaborator

Radial lags are one-sided, so the rings at the outer edge of a band keep
only a few short radial lags, and their plateau comes from the azimuthal
slice alone. Such a ring could "cross" half power in its last populated
bin -- a coin flip on one bin -- and report a lag set by the truncation,
not the field. calculate_heuristics then weighted it by the NOMINAL lag
range over that tiny lag, handing the worst-measured ring the largest
weight in the stack. On TW Hya CS this made the empirical null bimodal
in log A and alpha_r (55/45 split decided by the r = 2.19" ring alone).

  • half_power_lag(min_bracket=2.0): NaN unless the populated slice
    reaches min_bracket x the crossing lag; threaded through
    half_power_lags and calculate_heuristics. min_bracket=None reproduces
    the old behaviour exactly.
  • n_eff weights (calculate_heuristics, reliability_weight('neff')) use
    the populated radial range via a new _populated_max_lag.
  • Two regression tests on a synthetic edge ring; the halved-plateau
    counterfactual in an existing test now passes min_bracket=None.

🤖 Generated with Claude Code

richteague and others added 4 commits October 13, 2026 12:34
Radial lags are one-sided, so the rings at the outer edge of a band keep
only a few short radial lags, and their plateau comes from the azimuthal
slice alone. Such a ring could "cross" half power in its last populated
bin -- a coin flip on one bin -- and report a lag set by the truncation,
not the field. calculate_heuristics then weighted it by the NOMINAL lag
range over that tiny lag, handing the worst-measured ring the largest
weight in the stack. On TW Hya CS this made the empirical null bimodal
in log A and alpha_r (55/45 split decided by the r = 2.19" ring alone).

- half_power_lag(min_bracket=2.0): NaN unless the populated slice
  reaches min_bracket x the crossing lag; threaded through
  half_power_lags and calculate_heuristics. min_bracket=None reproduces
  the old behaviour exactly.
- n_eff weights (calculate_heuristics, reliability_weight('neff')) use
  the populated radial range via a new _populated_max_lag.
- Two regression tests on a synthetic edge ring; the halved-plateau
  counterfactual in an existing test now passes min_bracket=None.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stub half_power_lags now accepts min_bracket, and the analytic
StructureFunctions carry fully populated pair counts so the n_eff
weights can read the populated radial lag range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@richteague
richteague merged commit 7d52e65 into master Nov 24, 2026
3 checks passed
@richteague
richteague deleted the fix/half-power-lag-bracketing branch November 25, 2026 14:55
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