bmad-sim / pytao

PyTao is Python interface for Tao, which is based on the Bmad subroutine library for relativistic charged–particle and X-ray simulations in accelerators and storage rings.
https://bmad-sim.github.io/pytao
GNU General Public License v3.0
9 stars 6 forks source link

Regarding the output of "tao.var_v1_array" and "tao.var" interface commands #55

Closed weiyuanlou closed 6 months ago

weiyuanlou commented 2 years ago

The output of tao.var_v1_array(var_name) is a huge list of all the values which requires additional parsing on the user end. A dictionary is preferred.

The output of tao.var(var_name) is a list of some (index?) values which does not include the variable value. Is this intended?

My example code below requires $LCLS_LATTICE, but I'm sure the same thing happens with other lattices with pre-defined variables.

`from pytao import Tao

tao = Tao(f'-init $LCLS_LATTICE/bmad/models/sc_hxr/tao.init -noplot')

tao.var_v1_array('q.L1')

tao.var('q.L1[1]')`

DavidSagan commented 2 years ago

meas_value is the value of the variable and is outputted. The var_v1_array command was constructed to be used for gui display so that is why it is a list. Is there any issue to be resolved here?

ChristopherMayes commented 2 years ago

56 adds special parsing of tao.var_v1_array

DavidSagan commented 6 months ago

I assume this issue is solved and will close it.