Make instruments record fluorescence as secondary emission #256
Merged
petercamps merged 5 commits intoSKIRT:masterfrom Sep 26, 2025
Merged
Make instruments record fluorescence as secondary emission #256petercamps merged 5 commits intoSKIRT:masterfrom
petercamps merged 5 commits intoSKIRT:masterfrom
Conversation
Koseimatsu
pushed a commit
to Koseimatsu/SKIRT9
that referenced
this pull request
Dec 17, 2025
* detect emulation in configuration * add no-op scattering to base class * honor emulation in medium system * honor emulation in instruments * store rf according to phase
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.
Motivation
While fluorescence is a form of secondary emission by a given medium, the
XRayAtomicGasMixclass instead implements fluorescence as a form of scattering. This substantially simplifies the implementation, but it also means that - before this update - fluorescence radiation is mixed in with primary radiation and cannot be recorded separately.A group of users in the X-ray community requested to resolve this issue, because in X-ray spectral fitting fluorescent lines are commonly introduced as a separate spectral component. Furthermore, other future material types may face a similar problem.
Description
With this update, fluorescence photon packets are "rebranded" during the scattering event to look like secondary emission packets, and the instruments record them accordingly (assuming the recordComponents property is enabled).
Future material mixes may use this feature to rebrand photon packets that emulate secondary emission through a scattering interaction, including but not restricted to fluorescence.
Caveats
The emulation of secondary emission by rebranding photon packets only works for recording by instruments. Specifically:
Tests
Apart from the expected changes in recorded X-ray flux components, all functional tests produce binary identical results.
Context
This feature was requested by @BertVdM.