Page 1 of 1

SDDS: Output last entry of a column

Posted: 08 Aug 2008, 08:44
by tennant
Hi Michael,

Is there a command to output the last entry of a specified column in an SDDS file (e.g. you want the exit beta functions from a .twi file)? I have no doubt that this can be done, but a from a quick glance through the OAG manual, it wasn't clear to me how to do it.

Thanks,
chris

Re: SDDS: Output last entry of a column

Posted: 08 Aug 2008, 09:28
by michael_borland
Chris,

You need to use several commands togther. One way using SDDS tools only is

sddsprocess data.twi -clip=0,1,invert -pipe=out | sdds2stream -pipe -column=betax

Another way is

sdds2stream data.twi -column=betax | tail -1

If you are using the data inside elegant in an optimization term, you can use rpn_load. If you want to continue beta function calculations from a previous segment, you can use the reference_file feature of twiss_output.

--Michael