SDDS: Output last entry of a column

Moderators: cyao, michael_borland

Post Reply
tennant
Posts: 85
Joined: 31 Jul 2008, 07:19
Location: Jefferson Laboratory

SDDS: Output last entry of a column

Post by tennant » 08 Aug 2008, 08:44

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

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

Re: SDDS: Output last entry of a column

Post by michael_borland » 08 Aug 2008, 09:28

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

Post Reply