oasys-kit / shadow3

Official repository for shadow3 (x-ray-tracer engine)
MIT License
31 stars 19 forks source link

Wiggler source size calculation #40

Closed zimeng657 closed 4 years ago

zimeng657 commented 4 years ago

Hello,

I have a problem when tracing a wiggler source using shadowoui. The sizes of source it gives are different from that of Spectra with the same parameters. It gives 118 micron x 35 micron with two distinct spots as shown below while the Spectra gives 1940 micron x 160 micron.

wiggler

Is there a problem here in my settings?

Thank you for any help, Zimeng Wang

srio commented 4 years ago

Dear Zimeng,

everything depends on what you call source size. Your settings look correct.

What you get in the plot is the cartesian projection of the rays on the (x,z) plane. But this is not the size, as the effect of the depth is ignored.

In order to get into account the depth you can propagate the source to a screen in the far field, and then backpropagate to the source plane again. Or, similarly the use of a sort of "ideal lens" or ideal mirror to make a 1 to 1 image. I prefer to "propagate" all the rays to the (x,z) plane (not project!) just by adding a PlotXY widget and retracing to a distance zero. This will calculate the intersection of every ray in the (x,z) plane and gives a better idea of the source size:

image

You see that the image has a Lorentzian shape typical of a source with depth. Pay attention to the dimensions: FWHM is 934 x 83 um but the sigmas are: 1890 x 130 um. The vertical size depends much on the energy range. For a Gaussian distribution FWHM=2.35 sigma, and here sigmas are higher than FWHM because of the long tails of the Lorentzian.

I hope this helps!.

Regards, Manuel

zimeng657 commented 4 years ago

Dear Manuel ,

Thank you very much! This really helps!

Best, Zimeng

srio commented 4 years ago

You're welcomed!