Skip to content
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

Cylindrical MC - Uniform source off-centre and at an angle. #28

Open
l-hemsley opened this issue Oct 11, 2024 · 2 comments
Open

Cylindrical MC - Uniform source off-centre and at an angle. #28

l-hemsley opened this issue Oct 11, 2024 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@l-hemsley
Copy link

When I make a source that is off centre and at an angle to the cylindrical sample, as in;

source = mc.mcsource.UniformBeam([0.5e-3,5.0e-3],position =(-20e-3, 5e-3, 0),direction=(np.cos(2*np.pi*ang/360), np.sin(2*np.pi*ang/360),0))

Looks like this in the x-y plane

image

But the 2D cross section of the beam seems to be tilted - the beam should be symmetrical in the z axis I believe.

image

It looks like the beam is rotated somehow.

Thank you :)

@xopto
Copy link
Owner

xopto commented Oct 15, 2024

The rotation of non-circular beams in current implementation of the UniformBeam wont be aligned with the coordinate system if the propagation direction is not along the x, y, or z axis.

A solution to this issue is to slightly modify the UniformBeam constructor to take orientation of the beam (the first axis of the ellipse) and rewrite the sampling part of the OpenCL code. Unfortunately, I don't have an example yet but will come back to you later with a snippet.

@xopto xopto added bug Something isn't working enhancement New feature or request labels Oct 15, 2024
@l-hemsley
Copy link
Author

Thanks for your quick response! I am trying to implement a slit-type uniform input off-axis and off-angle. I was thinking if nothing else works then I can just iterate over the line source though will be time consuming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants