Skip to content

Modularize emittance calc for generalization.#280

Merged
roussel-ryan merged 14 commits intoslaclab:mainfrom
dylanmkennedy:main
Jul 10, 2025
Merged

Modularize emittance calc for generalization.#280
roussel-ryan merged 14 commits intoslaclab:mainfrom
dylanmkennedy:main

Conversation

@dylanmkennedy
Copy link
Contributor

@dylanmkennedy dylanmkennedy commented May 27, 2025

Modularizes emittance calculation for generalization to multi-device measurements (e.g. 3-wire measurement). The functionality formerly found in compute_emit_bmag is now found in analyze_quad_scan, as it is specific to quad scan emittance measurements. New functionality of compute_emit_bmag is independent of measurement method.

@shamin-slac
Copy link
Collaborator

Design-wise, I would prefer emittance.py only contains details related to the actual emittance computation itself, so details related to units or quad scan vs multi-device should be handled in the emittance measurement classes (see my current PR about subclassing the emittance measurement #277)

@roussel-ryan
Copy link
Collaborator

roussel-ryan commented May 30, 2025

So I would agree with that Shamin, but I'm concerned about connecting it too closely to the emittance measurement objects so that these calcs can be used outside the context of slac-tools. In that case maybe it makes sense to include these convenience functions in this file? IDK if this is in opposition to our discussion over slack

@shamin-slac
Copy link
Collaborator

Well these files are part of slac-tools, so if someone is using them, I would think it would be with slac-tools. I think separating the responsibilities in this way lets people use emittance.py separately if they want to do their own specific emittance computation, and if they're doing the typical measurements, they should just use the emittance measurement classes.

@shamin-slac
Copy link
Collaborator

@dylanmkennedy were you able to confirm or test that compute_emit_bmag works for the multi-device case?

@dylanmkennedy
Copy link
Contributor Author

@dylanmkennedy were you able to confirm or test that compute_emit_bmag works for the multi-device case?

I actually think I need to make a small change to the handling of the bmag calculation for the multi point measurement. I'm fixing it now.

Copy link
Collaborator

@shamin-slac shamin-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@roussel-ryan roussel-ryan merged commit a18a01b into slaclab:main Jul 10, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants