Slits and GaussianFit

Moderators: cyao, michael_borland

Post Reply
jtobin
Posts: 47
Joined: 23 Jul 2008, 15:00

Slits and GaussianFit

Post by jtobin » 02 Dec 2010, 18:30

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

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Slits and GaussianFit

Post by michael_borland » 02 Dec 2010, 18:48

Charles,

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

--Michael

jtobin
Posts: 47
Joined: 23 Jul 2008, 15:00

Re: Slits and GaussianFit

Post by jtobin » 02 Dec 2010, 18:54

Dear Michael,
It is a multi-slit.
regards,
Charles

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Slits and GaussianFit

Post by michael_borland » 02 Dec 2010, 23:22

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

jtobin
Posts: 47
Joined: 23 Jul 2008, 15:00

Re: Slits and GaussianFit

Post by jtobin » 10 Dec 2010, 12:29

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
Attachments
slits.tar.gz
(3 KiB) Downloaded 848 times

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Slits and GaussianFit

Post by michael_borland » 14 Dec 2010, 10:14

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
Attachments
slits.tar.gz
(2.82 KiB) Downloaded 876 times

jtobin
Posts: 47
Joined: 23 Jul 2008, 15:00

Re: Slits and GaussianFit

Post by jtobin » 14 Dec 2010, 13:34

Bingo..you are terrific...thanks!

regards,
Charles

Post Reply