Compatibility with TraceWin DAT files

LightWin uses the same format as TraceWin for the linac structure. As TraceWin developers implemented a significant number of elements and commands, those will be progressively implemented in LightWin too.

“Useless” commands and elements

Some instructions will raise a warning, even if they will not influence the results. As an example, if you use Envelope1D, transverse dynamics are not considered and the fact that transverse field maps are not implemented should not be a problem.

“Useful” commands and elements

You should clean the DAT to remove any command that influences the design of the linac. In particular: SET_ADV, ADJUST commands. If you choose TraceWin solver for the optimization, both LightWin and TraceWin could modify the design of the linac at the same time, so unexpected side effects may appear.

Note

  • Since 0.6.21, SET_SYNC_PHASE commands can be kept in the original DAT.

  • Since 0.8.0b3, the SET_SYNC_PHASE can be exported in the output DAT file.

See also: ListOfElements.store_settings_in_dat() (the method which is actually called to create the DAT).

Implemented commands and elements

The following commands are considered implemented, meaning they are explicitly recognized by the code:

  • If a command is not needed in the current context, an informational message is logged.

  • If a command is relevant but not yet supported, a warning is raised.

'ADJUST'

'ERROR_CAV_CPL_STAT'

'FREQ'

'ADJUST_STEERER'

'ERROR_CAV_NCPL_DYN'

'LATTICE'

'DUMMY_COMMAND'

'ERROR_CAV_NCPL_STAT'

'LATTICE_END'

'CHOPPER'

'ERROR_CAV_NCPL_STAT_FILE'

'MARKER'

'END'

'ERROR_GAUSSIAN_CUT_OFF'

'PLOT_DST'

'ERROR_BEAM_DYN'

'ERROR_QUAD_NCPL_DYN'

'REPEAT_ELE'

'ERROR_BEAM_STAT'

'ERROR_QUAD_NCPL_STAT'

'SET_ADV'

'ERROR_BEND_CPL_DYN'

'ERROR_RFQ_CEL_NCPL_DYN'

'SET_SYNC_PHASE'

'ERROR_BEND_CPL_STAT'

'ERROR_RFQ_CEL_NCPL_STAT'

'SHIFT'

'ERROR_BEND_NCPL_DYN'

'ERROR_STAT_FILE'

'STEERER'

'ERROR_BEND_NCPL_STAT'

'ERROR_SET_RATIO'

'SUPERPOSE_MAP'

'ERROR_CAV_CPL_DYN'

'FIELD_MAP_PATH'

Similarly, the following elements are implemented. If their transfer matrix is not supported by the chosen BeamCalculator, a warning is raised and the element is internally replaced by a DRIFT.

'APERTURE'

'DIAG_DSIZE3'

'DIAG_DTWISS'

'BEND'

'DIAG_DSIZE4'

'DIAG_DTWISS2'

'DIAG_CURRENT'

'DIAG_DPSIZE2'

'DIAG_SEPARATION'

'DIAG_DCURRENT'

'DIAG_PHASE'

'DIAG_SIZE_MAX'

'DIAG_POSITION'

'DIAG_ENERGY'

'DIAG_SIZE_MIN'

'DIAG_DPOSITION'

'DIAG_DENERGY'

'DIAG_PHASE_ADV'

'DIAG_DIVERGENCE'

'DIAG_DPHASE'

'DIAG_BETA'

'DIAG_DDIVERGENCE'

'DIAG_LUMINOSITY'

'DIAG_DBETA'

'DIAG_SIZE_FWHM'

'DIAG_WAIST'

'DRIFT'

'DIAG_SIZE'

'DIAG_ACHROMAT'

'DUMMY_ELEMENT'

'DIAG_SIZEP'

'DIAG_EMIT'

'EDGE'

'DIAG_DSIZE__FWHM'

'DIAG_EMIT_99'

'FIELD_MAP'

'DIAG_DSIZE'

'DIAG_HALO'

'QUAD'

'DIAG_DSIZE2_FWHM'

'DIAG_SET_MATRIX'

'SOLENOID'

'DIAG_DSIZE2'

'DIAG_TWISS'

'THIN_STEERING'

How to implement commands or elements

You can implement the desired elements and integrate them to the source code. Alternatively, file an issue on GitHub and I will try to add the desired element(s) as soon as possible.

Warning

Field maps file formats must be ascii, binary files to handled yet