Coder Social home page Coder Social logo

Comments (10)

kklmn avatar kklmn commented on September 26, 2024

Hi,
You define x' and z' distributions as "none":

distxprime="none",
distzprime="none", 

The docs define the valid values as ‘normal’, ‘flat’, ‘annulus’ or None. Note, 'none' is not among them but it does nothing as well. So if you want a normal or flat distribution, you have to define it.

from xrt.

emasimak avatar emasimak commented on September 26, 2024

HI!
Thank you for your quick reply!
... and thank you for pointing out this silly mistake! I would not have noticed it.
If I were to use None for the distributions of dxprime and dzprime however, wouldn't that mean that the divergence should remain constant through the beam propagation? My understanding is that dx,dz are the beam sizes and dxprime, dzprime the angular divergence in each of the axes. So a constant angular divergence of dxprime would affect the FWHM of the beam in x as: (FW' - FW)/(distance) = dxprime. I tried to use also "flat" but I had the same results in terms of beam size.
I am misunderstanding something in the definition. If you can offer any advice it would be much appreciated.

from xrt.

kklmn avatar kklmn commented on September 26, 2024

If I were to use None for the distributions of dxprime and dzprime however, wouldn't that mean that the divergence should remain constant through the beam propagation?

Not just constant but zero. The size of None distribution is irrelevant. I don't see why a size parameter should define the central value. For the central x' and z' we have yaw and pitch.

I tried to use also "flat" but I had the same results in terms of beam size.

Then something is wrong in your script again.

from xrt.

kklmn avatar kklmn commented on September 26, 2024

If scripting is a problem, there are many ready examples to look at in 'examples' and 'tests'.
In particular, you may examine this one: tests/raycing/test_param_mirror.py.

from xrt.

emasimak avatar emasimak commented on September 26, 2024

Hi!
Your point on the central values being unaffected is perfectly clear. I was expecting that the FWHM values would change based on the angular distributions.
Thank you for the script! It is indeed very helpful to see an example.
I think my issue was in the plot definition (more specifically the fact that I had limits). It seems that I can now see the expected (based on the distxprime and dxprime that I define) angular distributions in the plots.
Thank you for the help!

from xrt.

emasimak avatar emasimak commented on September 26, 2024

Hi!
I thought I had understood how the definition of dxprime, dzprime worked but apparently not.

I am attaching a sketch to explain what I want to define in the code.
beam
On the left you see the beam that is defined through a GeometricSource when:
distx="normal", dx=Sx/2.355, disty=None, dy=0., distz="normal", dz=Sy/2.355

One the right you see the divergence I want to include in the beam. I want to accomplish a beam size of:
Sx' = Sx + (θ * dist).
I was expecting that if I define distxprime='flat', dxprime=1e-3, distzprime='flat', dzprime=1e-3
that θx (or 2θx) [rad] would be equal to dxprime (similarly for the zaxis) and that if I place a screen in 1m distance I would see an increase of Sx equal to 1mm. Instead I get the beam sizes shown in the picture below.

beamPropagation1m

It is not clear to me how I should define dxprime/dzprime to accomplish the beam divergence that I need.
Thank you in advance for your time!
/Myrto

// Used code:
geometricSource_wOneCrystal-demo_py.txt

from xrt.

kklmn avatar kklmn commented on September 26, 2024

Hi!

distx and distxprime are independent distributions. In other words, in your picture of the red source spot, each point has a random angular distribution distxprime, not that the top part will have positive inclinations.

What you describe as your expectation is a point source with a truncated tip, no idea why you want it truncated.

If you need a defined fan of rays then just define it as a point source. Then x and x' will be explicitly dependent at every distance D from the source as x = D x'.

from xrt.

emasimak avatar emasimak commented on September 26, 2024

Hi!
Thank you for quick and helpful clarification! I will keep it in mind.
I assume that as point source you refer to the MeshSource, right?

Thank you for your time!
Myrto

from xrt.

kklmn avatar kklmn commented on September 26, 2024

A point source is the same GeometricSource with distx, disty and distz as None.

from xrt.

emasimak avatar emasimak commented on September 26, 2024

Thank you!

from xrt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.