combining files with SDDS
Posted: 16 Jan 2014, 04:41
Hi all
surely the way I deal with sdds is not particularly advanced and this is a trivial problem for many of you. I have two files:
1) VMX-twi.twi contains the Twiss parameters, in particular columns with s, betax, betay ... ElementName,ElementType, ElementGroup. It does NOT have the ParameterElement .
2) optVMX_v10-002198.param describes (mostly) magnets and bpms in the machine, it contains ElementName, ElementType, ParameterElement, ElementGroup. It does NOT have the 's' position for the elements
Eventually I wish to plot the quadrupole strengths vs position-s along the ring.
I have tried my way (end of the message) but I end up with a file (out.twi) whose sddsprintout for s, ParameterElement(K1) looks like
s ParameterValue
m
-------------------------------
6.074700e+00 0.000000e+00
7.359650e+00 0.000000e+00
... 220 rows == number of selected quadrupoles
5.559317e+02 0.000000e+00
s ParameterValue
m
-------------------------------
0.000000e+00 -7.223595e-01
0.000000e+00 1.253374e+00
... 220 rows again
0.000000e+00 -7.223595e-01
In other words, the last sddscombine concatenate the files rather then put positions and quad strenghts on the same row
This is the sequence of commands I use. I hope some can tip me a solution, thanks very much indeed.
#
# pick initial twiss file and extract only the qaudrupoles
# according to the quadlist.sdds list
#
sddsselect VMX-twi.twi quadlist.sdds selQuads.twi -match=ElementName -reuse
#
# pick the file of parameters and select the quadrupole parameters
# using quadlist.sdds
#
sddsselect optVMX_v10-002198.param quadlist.sdds selQuadsValues.param -match=ElementName -reuse
#
#
#
#
# filter only quadrupole parameters
#
sddsprocess selQuadsValues.param -match=column,ElementParameter=K1
sddscombine selQuads.twi selQuadsValues.param out.twi
sddscombine selQuads.twi selQuadsValues.param out.twi
surely the way I deal with sdds is not particularly advanced and this is a trivial problem for many of you. I have two files:
1) VMX-twi.twi contains the Twiss parameters, in particular columns with s, betax, betay ... ElementName,ElementType, ElementGroup. It does NOT have the ParameterElement .
2) optVMX_v10-002198.param describes (mostly) magnets and bpms in the machine, it contains ElementName, ElementType, ParameterElement, ElementGroup. It does NOT have the 's' position for the elements
Eventually I wish to plot the quadrupole strengths vs position-s along the ring.
I have tried my way (end of the message) but I end up with a file (out.twi) whose sddsprintout for s, ParameterElement(K1) looks like
s ParameterValue
m
-------------------------------
6.074700e+00 0.000000e+00
7.359650e+00 0.000000e+00
... 220 rows == number of selected quadrupoles
5.559317e+02 0.000000e+00
s ParameterValue
m
-------------------------------
0.000000e+00 -7.223595e-01
0.000000e+00 1.253374e+00
... 220 rows again
0.000000e+00 -7.223595e-01
In other words, the last sddscombine concatenate the files rather then put positions and quad strenghts on the same row
This is the sequence of commands I use. I hope some can tip me a solution, thanks very much indeed.
#
# pick initial twiss file and extract only the qaudrupoles
# according to the quadlist.sdds list
#
sddsselect VMX-twi.twi quadlist.sdds selQuads.twi -match=ElementName -reuse
#
# pick the file of parameters and select the quadrupole parameters
# using quadlist.sdds
#
sddsselect optVMX_v10-002198.param quadlist.sdds selQuadsValues.param -match=ElementName -reuse
#
#
#
#
# filter only quadrupole parameters
#
sddsprocess selQuadsValues.param -match=column,ElementParameter=K1
sddscombine selQuads.twi selQuadsValues.param out.twi
sddscombine selQuads.twi selQuadsValues.param out.twi