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

Add parser for the output of data_d_array #47

Closed ChristopherMayes closed 2 years ago

ChristopherMayes commented 2 years ago

This parses the string output of data_d_array so that: tao.data_d_array('orbit', 'x')

returns a list of dicts, like:


[{'ix_d1': 1,
  'data_type': 'bpm_orbit.x',
  'merit_type': 'target',
  'ele_ref_name': '',
  'ele_start_name': '',
  'ele_name': 'BPM10',
  'meas_value': 0.0,
  'model_value': 1.19045903284358e-08,
  'design_value': 1.19045903284358e-08,
  'useit_opt': True,
  'useit_plot': True,
  'good_user': True,
  'weight': 1.0,
  'exists': True},
... ]