Fix chroma tool + global moment compaction factor#222
Conversation
|
It's nice to be able to give the momentum compaction factor in the config if you don't have a lattice model, but I don't entirely understand the Also, can it optionally automatically be read from the lattice model if you have configured a simulator? If I have a lattice model I would like to get the energy and momentum compaction factor from that instead of putting it in the config. |
|
|
|
@kparasch When i do Ctrl+C in tune reponse matrix, the logging is incomplete: def callback(action: Action, data:dict):
print(f"{action}, data:{data}")
return True
sr: Accelerator = Accelerator.load("tests/config/EBSTune.yaml",ignore_external=True,use_fast_loader=True)
sr.design.trm.measure(n_step=3,n_avg_meas=3, callback=callback)Action.MEASURE, data:{'step': 0, 'avg_step': 2, 'magnet': 'QD2E-C04', 'tune': array([0.15999673, 0.33999769]), 'mode': 'Simulator:design', 'source_name': 'DEFAULT_TUNE_RESPONSE_MATRIX'}
Action.APPLY, data:{'step': 0, 'magnet': 'QD2E-C04', 'strength': -0.6174884055295032, 'mode': 'Simulator:design', 'source_name': 'DEFAULT_TUNE_RESPONSE_MATRIX'}
Action.MEASURE, data:{'step': 0, 'avg_step': 0, 'magnet': 'QD2E-C04', 'tune': array([0.16001458, 0.33987169]), 'mode': 'Simulator:design', 'source_name': 'DEFAULT_TUNE_RESPONSE_MATRIX'}
^CAction.RESTORE, data:{'step': 0, 'magnet': 'QD2E-C04', 'dtune': array([0., 0.]), 'mode': 'Simulator:design', 'source_name': 'DEFAULT_TUNE_RESPONSE_MATRIX'}
DEFAULT_TUNE_RESPONSE_MATRIX : measurement abortedWhile it works well in chroma response matrix: sr: Accelerator = Accelerator.load("tests/config/EBSOrbit.yaml",ignore_external=True,use_fast_loader=True)
sr.design.crm.measure(n_step=3,n_avg_meas=3, callback=callback)Thanks for help ! |
|
So the logging behavior difference is explained by pySC. Unfortunatly logging.basicConfig() affects all loggers :/ |
|
Ready to merge |
This PR fix chroma tool and add unit test for it.
This PR also add moment compaction factor as global accelerator parameters (similarly to energy).