slaclab / lcls-tools

Python tools for LCLS: post processing data, PV handling, pulling archive settings, etc.
Apache License 2.0
2 stars 20 forks source link

Calculate normalized emittance, twiss parameters, and bmag from quad scan or multi-wire/screen scan #156

Open shamin-slac opened 3 months ago

phys-cgarnier commented 2 weeks ago

Look at possibility moving bmag and twiss from Williams BMAD model to a more general location.

nneveu commented 2 weeks ago

Emittance gist: https://gist.github.com/thduong2/591c67f82d95e7cfffd41f4c397ef201

nneveu commented 2 weeks ago

@shamin-slac @phys-cgarnier There is simple quad scan code in the emittance gist, see below. There is already a scan function in the magnet class. The beam size function would be replaced w/ Chris' code.

# create some scan: quad between -6 and 0
scan_settings = [
  {"QE04": -6},  # step 1
  {"QE04": -3},  # step 2
  {"QE04": 0},  # step 3
]

# start scan, we call the 'acquire_images' function after each step
magnets.scan(scan_settings=scan_settings, function=acquire_images)
beam_sizes = get_beamsize(image_file = image_file_locations) #x_rms, y_rms, x_stdz, y_stdz
nneveu commented 2 weeks ago

@phys-cgarnier , please @ Alex in after this comment and add her as assignee on the issue (I don't know her github name). I think for the bmag and twiss parts of this, she can do the following:

aikuma14 commented 1 week ago

My username is aikuma14, can I be added as an assignee?