Page 1 of 1

Slits and GaussianFit

Posted: 02 Dec 2010, 18:30
by jtobin
Dear Michael ,

I have a slit followed by a screen downstream. Let us say the slits are along y-axis. So, the beam image has vertical slices whose projection in x yields a series of Gaussian profile separated by some distance .

"Goal": I want the rms of each of these Gaussians and the distance between the peaks written to a file using sddsgfit (or) other sdds fitting tools and plot it [for different beam settings upstream]. (Basically, for a resolution check with the instrumentation).

Right now, all i can think of is using an ascii file output and then use a fitting tool.
Is there a way to extract this just from the sddsfile using sddsgfit?

Thanks....your help is much appreciated.

regards,
Charles

Re: Slits and GaussianFit

Posted: 02 Dec 2010, 18:48
by michael_borland
Charles,

Is there a single slit that is varied in position or size, or a multiple-aperture slit?

--Michael

Re: Slits and GaussianFit

Posted: 02 Dec 2010, 18:54
by jtobin
Dear Michael,
It is a multi-slit.
regards,
Charles

Re: Slits and GaussianFit

Posted: 02 Dec 2010, 23:22
by michael_borland
Charles,

Assuming your spots are separated by gaps of 1e-3 (1mm), I'd try something like this:

sddssort output.sdds -pipe=out -column=x,incr \
| sddsbreak -pipe -gap=x,amount=1e-3 \
| sddshist -pipe -bins=100 -data=x \
| sddsgfit -pipe -column=x,frequency -tolerance=1e-14 \
| sddscollapse -pipe=in fitResults.sdds

sddsprintout -col fitResults.sdds

If you need more help, please post a sample output file.

--Michael

Re: Slits and GaussianFit

Posted: 10 Dec 2010, 12:29
by jtobin
Dear Michael,
First of all, many thanks for the script.
I have been testing the script and i believe it is working. But to convince myself, I would like to plot the series of Gaussian with the calculated sigmas (from fitResults.sdds) on top of the actual projections. How can i do that?

For sample: I am attaching my ele and lte files. The output is in A0_Xchngr1.x4. I would like to see a plot of the calculated Gaussians on top of the actual projections. For convenience, I am attaching my plotting script rmsplot.s { Usage: rmsplot.s X4). It plots the beam transverse profile and its projections on x and y at location X4 and also prints out the gFitsigmas from your script for each of the beamlets.
Thanks again!
regards,
Charles

Re: Slits and GaussianFit

Posted: 14 Dec 2010, 10:14
by michael_borland
Charles,

I cleaned up your multi-slit script so it is more compact and easier to follow. I also added commands to your rmsplot script to overlay the fits on the beamlet histograms.

Please see attached.

--Michael

Re: Slits and GaussianFit

Posted: 14 Dec 2010, 13:34
by jtobin
Bingo..you are terrific...thanks!

regards,
Charles