Hello!
I am trying to create a sinusoidal illumination pattern on a rectangular volume, but am running into an interesting issue in pmcx. When I analyze the output photons, it appears that they are from a planar source- although the flux shows that a patterned source was simulated.
First I show that I can run a simulation and what my outputs look like. On the left you see the flux from illumination with a gaussian beam. This simulation has a bc_planes detector along the top (z=0) plane. On the right, you see a binned intensity image of a histogram of photons that were detected from the volume detp.x[:].
For a gaussian beam, we see the beam scatter in depth, and see a broader beam at the surface than in the volume. Great!
I can repeat this for a planar source:
This also looks like it makes sense.
7.29e6 photons are detected of 1e7, with no absorbers this seems reasonable.
The issue comes when I try to use an input pattern image. Below I put in a sine wave which is constant along Y and varies slowly along X, as can be seen in the flux image and the replay simulation.
However, when I look at the detp photons returned from the simulation, I see basically the same results as if it were a planar souce. Again, I see 7.29e6 detected photons, and more critically no pattern in the binned image (or its cross sectional profile).
I've tried many things in troubleshooting it.
- Both bc_planes and a discretely placed detector show this issue
- Other patterns show this issue
- Other volume sizes show this issue
- The energy plot does show the input pattern through the volume, but also does not give the proper detp out.
- Placing a mirror on the bottom of the volume with negligible scattering and absorption does not show the pattern on the detector plane.
- Adding some absorption does localize the areas with light flux, but still shows photons in regions with no flux below it.
- I've tried switching to Shapes input volume description,
.... others that I'm forgetting now.
Do you have any advice on what to troubleshoot next, or can you see if this is a bug?
here I paste my cfg, without the patterned image, from a jdata.savet command. For the full cfg you can use the link:
(sorry, only available for 21 days)
Any help appreciated
Vincent
{
"dim": [
961,
961,
213
],
"prop": {
"_ArrayType_": "double",
"_ArraySize_": [
2,
4
],
"_ArrayData_": [
0.0,
0.0,
1.0,
1.38,
1.0,
1.3583032455451094,
0.6,
1.42
]
},
"issrcfrom0": 0,
"unitinmm": 0.0468,
"tstart": 0,
"tend": 5e-09,
"tstep": 5e-09,
"srctype": "pattern",
"srcpos": [
224.5,
160.5,
0
],
"srcdir": [
0,
0,
1,
0
],
"srcparam1": [
512,
0,
0,
512
],
"srcparam2": [
0,
640,
0,
640
],
"srcpattern": {
"_ArrayType_": "double",
"_ArraySize_": [
512,
640
],
"_ArrayData_": []
},
"nphoton": 10000000.0,
"isreflect": 1,
"bc": "______001000",
"isnormalize": 1,
"seed": -1,
"maxdetphoton": 10000000.0,
"autopilot": 1,
"outputtype": "flux",
"savedetflag": "pxv",
"debuglevel": "P",
"issavedet": 1,
"issaveseed": 1,
"verb": 2
}