-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pmcx fails to read cfg['angleinvcdf']
and cfg['invcdf']
array data
#233
Comments
cfg['angleinvcdf']
and cfg['invcdf']
array data
for your above comment - the 4th element of |
Hi Dr. Fang, I have a question, that may just be a geometry question rather than a package issue. I am trying to simulate an LED source, I have the invCDF angles calculated, that is, angles which carry equal emission probability between them. However, including zero, or small angles in general, seems to create an artifact I don't understand. If I run a simulation (same code as above) with the invCDF angles of [0,0.5] I expect an isotropic source that is only launching photons along the source Dir with direction components Vz >=0, and is azimuthally symmertric. That is, it should have an equal probability of emissions between theta 0 and pi/2. However- I see a strong forward propagation component, which appears to give more phtons along Dir. See plot below. Do you know why this could be? I thought it may have to do with the way that photons can be generated, if you have an equal probability between 0 and pi/2 AND azimuthal symmetry then there can be a buildup of photons around theta = 0 because all azimuthal angles contribute to the flux at small angles, which is not true of photons with larger azimuthal angles which explore a region of the volume that cannot be approximately accessed by other combinations of theta/phi. if this is true, maybe we need to change the probability function for theta given that more Phi angles can contribute? Im not sure. Any help here is appreciated. Best regards PS See you at Photonics West? |
@vzoutenbier, is the invcdf you computed based on angle or based on u=cos(angle)? here is the help info for invcdf, as you can see it uses u as the variable, not angle
I haven't decided yet - my student, Shijie Yan will give a talk on our most recent works on mmc. |
Hi Fang, any chance you can comment on why photons are evenly being distributed through the different angles in my last image above? :) |
@vzoutenbier, I am so sorry for my late reply. my earlier comment regarding There are two modes to control launch angle generation using
here is the relevant documentation here is the demo in order to create a continuous distribution, you should set the 4th element of srcdir to 0. |
Thanks for these resources! Using your demo_.._launchangle.m file I was able to make a function to create a function which generates an even distribution photons from the source through the angle of 0 to pi/2. Because of the nonlinearity of cosine, the uniformity of the source output is HIGHLY dependent on the number of points used in the angleinvcdf for small angles. Using a low number of points creates the very strong directly forward scattering artifact, which is what I was chasing in my previous comments. I show this below by showing the output at 5, 50, 500, and 5000 sampling points for angleinvcdf. Below is my code for anyone else that may have a similar issue, which takes the number of input points for angleinvcdf and creates sampling points for a uniform distribution of source photons between theta_min and theta_max. I know there are other ways to achieve this same effect in MCX, but this is a good basis to use to create arbitrary angle outputs... function normalized_theta_values = calculateNormalizedTheta(num_points)
end |
@vzoutenbier, thanks for the follow up. are you trying to create a Lambertian source? if so, can you try setting cfg.srcdir(4) to -inf? mcx has built-in support to Lambertian source, see source code https://github.com/fangq/mcx/blob/v2024.2/src/mcx_core.cu#L1538-L1544 |
this was reported by @vzoutenbier in the following post in #194
#194 (comment)
the issue seems that the supplied data are only read partially.
The text was updated successfully, but these errors were encountered: