Skip to content

Output Stokes Q, U, and V flux contributions#261

Merged
petercamps merged 4 commits intoSKIRT:masterfrom
BertVdM:StokesComponents
Feb 3, 2026
Merged

Output Stokes Q, U, and V flux contributions#261
petercamps merged 4 commits intoSKIRT:masterfrom
BertVdM:StokesComponents

Conversation

@BertVdM
Copy link
Copy Markdown
Contributor

@BertVdM BertVdM commented Feb 3, 2026

Description and motivation
We extend the FluxRecorder to also output the flux contributions (i.e., direct, scattered, secondary) of the Stokes Q, Stokes U, and Stokes V photon fluxes when modelling polarisation, which is crucial to analyse and interpret (X-ray) polarisation simulations. The main motivation is the analysis of a project I am working on now, but I have missed this functionality before.

We decided to only output the flux contributions for the SED instruments and not for the IFU instruments, in order to not let the number of output files explode (one IFU per contribution). If this information would be required for IFUs in the future, SKIRT can be extended following the same pattern.

The order of the columns could be debated. Now the order seems illogical as the pattern is different for Stokes I vs. Q, U, and V. But this is consistent with the current implementation (i.e., not changing the order of the columns that are already there).

I also changed the order "SecondaryTransparent, SecondaryDirect, SecondaryScattered" -> "SecondaryDirect, SecondaryScattered, SecondaryTransparent" in the code (no effect for the user), to be consistent with the order of the output columns.

Tests
As a test case, we ran X-ray radiative transfer simulations of an AGN torus, centred on a polarised X-ray point source (PL=10%, gamma = 30 deg). We compare the total Stokes parameters to the current implementation: CompareCurrentNew.pdf. We plot the Stokes Q and Stokes U contribution (noting that Stokes V is not being studied in X-rays): StokesUComponents.pdf and
StokesQComponents.pdf. Finally, we checked if the Stokes contributions add up to the total Stokes parameters: ConsistencyCheck.pdf.

Also confirmed there are no changes to the IFU instrument output.

@petercamps petercamps merged commit d762d4b into SKIRT:master Feb 3, 2026
6 checks passed
@BertVdM BertVdM deleted the StokesComponents branch February 3, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants