Skip to content

Address the review of the side band pedestal - #150

Merged
kriboe90 merged 1 commit into
masterfrom
develop_sideband_pedestal_review
Oct 27, 2026
Merged

kriboe90 merged 1 commit into
masterfrom
develop_sideband_pedestal_review

Conversation

@kriboe90

Copy link
Copy Markdown
Contributor

Follow-up to #145, which was merged as-is. Three points from reviewing it, none of which change any numbers.

sideband_floor → background_floor

The lower limit is applied to bgsub2_sum_col_val as well, not only to the side band correction, so the name said less than the option does. Renaming it now, before it reaches a release, leaves users' config.ini untouched; after a release it would mean either breaking those files or carrying an alias. The generated comment in config.ini now names both affected columns.

Report which LED array file of step 2 is missing

_get_unmerged_led_arrays reads analysis/led_array_indices_<i>.csv with silent=True. read_table re-raises either way, so the flag only suppressed the one message that would explain the failure — an unexplained OSError, possibly minutes into a long step 3 run.

Dropping silent=True is not the fix: it also enables a "<file> successfully loaded." print on the success path, which runs once per array per image. The call now keeps silent=True and the failure raises an OSError naming the file, why the arrays of step 2 are needed, and the two ways out (re-run step 2, or unset merge_led_array_indices).

Document sideband_exclusion_margin

It defaults to search_area_radius, which is a geometric distance and knows nothing about how far the light of an LED actually reaches. For strips closer than the outer band distance and for wide halos, light from the neighbouring strip still enters the side bands and raises B.

Measured against the merged code with synthetic Gaussian LEDs, a pedestal of 10 and bands at 25–60 px: with halo sigma 1.5 and 4 px the estimator returns the pedestal exactly at every separation down to 20 px, while with sigma 8 px it returns 13.2 to 14.5, i.e. up to about 45 % high.

That inflation is mostly harmless, which is worth stating in the README rather than leaving implicit: the leaked light is LED light and dims with the same transmission as the LED itself, so it cancels in the ratio to the reference image. The optical depth came back exact from transmission 1.0 down to 0.005. What does not cancel is the case of two strips at different depths in the smoke — with the LED at transmission 0.05 and a clear neighbour, tau was 3.184 against a true 2.996, and that error grows as the LED dims while the neighbour stays bright.

The README now says this and says to raise the margin above the visible halo when the strips are close.

Not addressed here

Two points from the same review that are design questions rather than fixes, and better settled against real data:

  • estimate_sideband_background uses the arithmetic mean, while the existing ring estimator uses a median. The mean is the right unbiased estimator for a box sum and has to include the pixels clipped at 0, but it has no outlier resistance — and the halo leakage above is concentrated in the band pixels nearest the neighbouring LED, which a trimmed mean would largely reject.
  • Values sitting at background_floor are not flagged in the output. They are recoverable by comparing sum_col_val - sidebg_pedestal against the floor, but nothing downstream marks them, so a clamped plateau looks like a measurement.

Tests

🤖 Generated with Claude Code

Rename sideband_floor to background_floor: the lower limit applies to
bgsub2_sum_col_val as well, not only to the side band correction. Renaming
it before the option reaches a release keeps users' config.ini untouched.

Report which LED array file of step 2 is missing. read_table stays silent,
because it would otherwise report every file of every image, so its
unspecific OSError reached the user without a message. Step 3 now names the
file, why the arrays of step 2 are needed and the two ways out.

Document sideband_exclusion_margin in the README: it defaults to the search
area radius, which is a geometric distance and does not know the halo of the
LEDs. For closely spaced strips and wide halos the light of the neighbouring
strip reaches the side bands. Most of it cancels in the ratio to the
reference image, because it dims with the same transmission as the LED
itself; a bias remains if the strips lie at different depths in the smoke.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kriboe90
kriboe90 merged commit adc5c2c into master Oct 27, 2026
5 checks passed
@kriboe90
kriboe90 deleted the develop_sideband_pedestal_review branch October 27, 2026 12:15
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