how can I use this grammar ?

Moderators: cyao, michael_borland

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

Re: how can I use this grammar ?

Post by michael_borland » 03 May 2012, 08:29

Joy,

Here's a new example file that may help you. Look at runScript2.

--Michael
Attachments
spotAnalysisExample.tar
(10 KiB) Downloaded 140 times

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 03 May 2012, 08:39

Hi, dear Micheal :

Please only see my last questions (NO1 and NO2)

Now I have No3: Because I used vary_element to scan K of a quadpole, finally there are 170 pages of density function in the file produced by sddshist2d and sddsimageconvert. Then I used sddsimageprofile, but there was only integrated profile of the first page. How can I caculate projections of all the pages by sddimageprofile ? I have not seen any imformation about page about sdddsimageprofile in the manual . I can deal with the problem when I use sddsplot by "-frompage=n -topage=n" and then I can do batch processing .
Or, can i save those data in some format that can be use by Matlab ? Then I can use Matlab to caculate the projections page by page ?

Best regards!
Joy

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

Re: how can I use this grammar ?

Post by michael_borland » 03 May 2012, 09:08

Joy,

Please see runScript3 in the attached file, which shows how to do this for a file with many pages. I don't think sddsimageprofiles is capable of handling multiple pages. We'll add that in the next release.

As for MATLAB, you can read data into MATLAB using
http://www.aps.anl.gov/Accelerator_Syst ... tlab.shtml
I can't say whether you can do this more easily in MATLAB as I don't use it.

--Michael
Attachments
spotAnalysisExample.tar
(10 KiB) Downloaded 124 times

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 03 May 2012, 09:47

Hi, Micheal

Thanks so much . But I think sddscollapse do not help me to break 170 pages in a file onto 170 files with only 1 page. Can you help me to think about how can I caculate the each projection of a page from 170 pages in a file most simply ?

Joy

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

Re: how can I use this grammar ?

Post by michael_borland » 03 May 2012, 09:51

Joy,

You don't need to break it into 170 files. The approach I used in runScript3 should work for you without doing that.

However, if you really need to do that, use sddssplit to make 1 file for each page, then write a loop in bash (or whatever script language you prefer) to process the files one at a time.

--Michael

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 03 May 2012, 10:15

Hi , Dear Micheal

I uesd " sddsrowstats sddsimageconvert.sdds sddsrowstats.sdds -sum=ColumnSun,Hello??? " (Hello is the prefix and sddsimageconvert.sdds is the file with multip-page) . The I can get the projections of every page(But I can not get y-direction projections in the same way).

Joy

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

Re: how can I use this grammar ?

Post by michael_borland » 03 May 2012, 12:26

Joy,

To get the y projections, you need to use sddstranspose first to flip the rows and columns, or else redo sddshist2d with -column=y,x instead of -column=x,y

---Michael

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 14 May 2012, 01:28

Hi, Michael

Not only change -col=y,x , but also should change the -xparam and -yparam.

Joy

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 16 May 2012, 05:53

Hi, Michael

I want to scan a set of K values through "vary_element " . It is successful only when I use "&bunched_beam" to define the input bunch. When I use a "sdds_beam" file as the input bunch, Elegant will show :

"Dumping output beam data...done.
Dumping centroid data...done.
Dumping sigma data...done.
Dumping final properties data...error: no particles in input file
error: no particles in input file"

why ?

But when I don't scan K values using "vary_element" , both of "bunched_beam" and "sdds_beam" run well, not any errors.

Joy

Joytop
Posts: 36
Joined: 02 Mar 2012, 09:50

Re: how can I use this grammar ?

Post by Joytop » 16 May 2012, 06:14

:oops: :oops:
Last edited by Joytop on 02 Jun 2012, 19:31, edited 1 time in total.

Post Reply