Page 1 of 6

how can I use this grammar ?

Posted: 05 Mar 2012, 08:30
by Joytop
Hi~I have two questions that I cannot figure them out, please help me.
Now I need to turn "tomo0.png" into "tomo1.png", that is to say, I want to get some certain area of one picture from elegant,how can i do it?
Also, I want to know the size of each pixel of the picture, how can I do it ? I find "sddsspotanalysis" amybe can realize it, but I have tried more thatn 20 times about the synopsis of "sddssportanalysis", please give me a specific example.
Can you also give me a specific example of using the synopsis of "sddsbaseline" ? I found it is so hard to go through them.
Looking forward to your reply.

Re: how can I use this grammar ?

Posted: 09 Mar 2012, 05:29
by Joytop
Michael,please help me. :?:

Re: how can I use this grammar ?

Posted: 15 Mar 2012, 21:02
by michael_borland
Sorry I didn't see this post until today.

I'm not sure why you are using sddsspotanalysis and sddsbaseline on simulation data. The easiest way to analyze simulation data to obtain RMS parameters is using sddsanalyzebeam. Usually
sddsspotanalysis and sddsbaseline are used to analyze experimental beam spot images.

However, if you want to use sddsspotanalysis and sddsbaseline, you need to first make a 2d or 1d histogram, respectively.
I've attached a script that shows how to use sddsspotanalysis starting from (x, y) data.

--Michael

Re: how can I use this grammar ?

Posted: 19 Apr 2012, 09:20
by Joytop
Dear Michael,

I have tried to learn “sddsspotanalysis” as you described in the file (runScript) you sent to me last time. There are several problems I cannot solve by myself and I need your help.

First, what is the meaning of the sentence “\rm xyValues.* xyLines.sdds“ ? How can I get the file ?

Second, if I neglect the above problem and go on to write the following:
sddssampledist xyValues.sdds -samples=10000 \
-gaussian=column=x,mean=0.002,sigma=0.0005,units=m \
-uniform=column=y,minimum=-0.003,maximum=0.001,units=m
There was an error as the affix named “error from sddssampledist.PNG”: Error <sddssampledist>: too many filenames seen.
So I deleted the second line “-gaussian=…” , and a file named “xyValues” turned out, however, which lead another error as excepted when I run the next order: sddshist2d… . Another error turned out: wrong number of items for –x_parameter. (because I have deleted the line of –gaussian…)
Then I looked into the manual and found that the synopsis of sddssampledist was indeed sampler. But I still don’t know how to modify it. Please help me.

Actually, The reason that I study the usage of above orders is as follow:
I want to get several beam sizes from our designed setup in elegant to do phase space reconstruction by tomography. When I get the x-y distribution image, should I abstract the background from the image(like the affix named “1.png”) before I get corresponding projection ? If yes, can I realize it by sddsspotanalysis or sddsimageprofiles? Which one should I use ? I think it would be better for me to learn both of them.

At the same time, I also should know the size of a pixel from the image 1.png. So I should use sddsspotanalysis, too. I am really confused with the input file type. What is the type of “SDDS image files” in the manual of SDDStoolkit? How can I produce “SDDS image files” ? For example, I want to analysis the size of a pixel in 1.png, which file should be the [inputfile] ? I have tried the file of 1.png, but failed with the Error: Unable to read layout- - no header lines found <SDDS_ReadLayout> ; I also have tried the file(affix named “4.out”,sorry,it‘s too big,57m,actually it's the *.twi output from elegant) which can produce 1.png by sddsplot. This time there were no error, but result(affix named “4result.out”) did not include the size of a pixel and so on.

Re: how can I use this grammar ?

Posted: 19 Apr 2012, 10:13
by michael_borland
Joytop wrote: First, what is the meaning of the sentence “\rm xyValues.* xyLines.sdds“ ? How can I get the file ?
This is a Unix command to remove two files. It's a way of cleaning up before running.
Joytop wrote: Second, if I neglect the above problem and go on to write the following:
sddssampledist xyValues.sdds -samples=10000 \
-gaussian=column=x,mean=0.002,sigma=0.0005,units=m \
-uniform=column=y,minimum=-0.003,maximum=0.001,units=m
There was an error as the affix named “error from sddssampledist.PNG”: Error <sddssampledist>: too many filenames seen.
I suspect there is a stray space or other whitespace character in the command. E.g., sometimes a space gets inserted after the \ that is supposed to end the command line.
Joytop wrote: I want to get several beam sizes from our designed setup in elegant to do phase space reconstruction by tomography. When I get the x-y distribution image, should I abstract the background from the image(like the affix named “1.png”) before I get corresponding projection ?
If you are getting x-y particle locations from elegant, there's no need to subtract the background, since it is already zero. Background comes from electronic offsets and stray light in imaging systems
Joytop wrote: At the same time, I also should know the size of a pixel from the image 1.png. So I should use sddsspotanalysis, too. I am really confused with the input file type. What is the type of “SDDS image files” in the manual of SDDStoolkit? How can I produce “SDDS image files” ? For example, I want to analysis the size of a pixel in 1.png, which file should be the [inputfile] ? I have tried the file of 1.png, but failed with the Error: Unable to read layout- - no header lines found <SDDS_ReadLayout> ; I also have tried the file(affix named “4.out”,sorry,it‘s too big,57m,actually it's the *.twi output from elegant) which can produce 1.png by sddsplot. This time there were no error, but result(affix named “4result.out”) did not include the size of a pixel and so on.
In my example, the pixel size is something you determine when you make the 2d histogram with sddshist2d. It is given by the parameters of -xparam and -yparam, and also by the parameters xInterval and yInterval in the sddshist2d output file (xyValues.h2d).

--Michael

Hi,Michael, Thanks for your help but I still have questions.

Posted: 26 Apr 2012, 06:29
by Joytop
Hi, Michael:

Thanks so much for your helps!

And I run the example successively. But I still have questions:

N01: I cannot get the size of a pixel(?mm/pixel) from the results of sddssportanalysis. And I found that maybe I should not use this grammar to get what I really want is how many mm/pixel on the image 1.png last time I showed it to you because I found that -ROI and -spotROI are both only giving the area that one is interested but not ? mm/pixel and also, actually one have already give the size of a pixel, which is 0.02/100, in "sddshist2d -xparam=100,-0.01,0.01 -yparam=100,-0.01,0.01 " .
After I know ?mm a pixel on the 1.png, I can caculate the <x^2> of 1.png and then I can compare it with the results caculated by elegant(usually showed in *.sig). Now, do I make my aim clearly to you ? If yes, please tell me what else I should do to achieve my goal.

Regards!
Joy

Re: how can I use this grammar ?

Posted: 28 Apr 2012, 02:04
by Joytop
Hi, Michael,

Because I should caculate the rms using the picture during my process and compare it with the result from .sig by elegant , so I cannon make the number of histogram of the image by myself. I should know the default histogram number of 1.png itself. Please help me.

Regards!

Joy

Re: how can I use this grammar ?

Posted: 28 Apr 2012, 12:24
by michael_borland
Joy,

If you want to recover pixel/mm information from the PNG file, I don't think PNG files store that kind of information. It's just a graphics format, without any knowledge of the data.

--Michael

Re: how can I use this grammar ?

Posted: 29 Apr 2012, 21:57
by Joytop
Dear Michael,

I almost cannot beleive there is no way to know the variable(mm/pixel) of the PNG file produced by elegant because when the elegant use sddsplot to plot a x-y image, elegant should know how many pixels will be used inside the axis of coordinates. I did not meant that I should know pixel/mm only by the picture itself. Anyway , I just want to know the mm/pixel or pixel/mm that have been determined by elegant when the picture was produced by sddsplot. So, I have also tried the sddsplot to set the number of grids of the region inside the axis of coordinates which only include the particles.
Regards!
Joy

Re: how can I use this grammar ?

Posted: 29 Apr 2012, 22:23
by Joytop
Dear Michael,

Thanks so much for your help.

Best wishes for your families,
Joy.