Repository navigation
Address the review of the side band pedestal - #150
Merged
Merged
Conversation
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>
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #145, which was merged as-is. Three points from reviewing it, none of which change any numbers.
sideband_floor→background_floorThe lower limit is applied to
bgsub2_sum_col_valas 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.iniuntouched; after a release it would mean either breaking those files or carrying an alias. The generated comment inconfig.ininow names both affected columns.Report which LED array file of step 2 is missing
_get_unmerged_led_arraysreadsanalysis/led_array_indices_<i>.csvwithsilent=True.read_tablere-raises either way, so the flag only suppressed the one message that would explain the failure — an unexplainedOSError, possibly minutes into a long step 3 run.Dropping
silent=Trueis 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 keepssilent=Trueand the failure raises anOSErrornaming the file, why the arrays of step 2 are needed, and the two ways out (re-run step 2, or unsetmerge_led_array_indices).Document
sideband_exclusion_marginIt 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_backgrounduses 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.background_floorare not flagged in the output. They are recoverable by comparingsum_col_val - sidebg_pedestalagainst the floor, but nothing downstream marks them, so a clamped plateau looks like a measurement.Tests
🤖 Generated with Claude Code