-
Notifications
You must be signed in to change notification settings - Fork 23
Converting amplitudes between polarization models #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
great! a few requests:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new method, get_generic_amplitude(), in result.py to convert amplitudes from the aligned model to those of the generic model by integrating the angular factors.
- Added get_generic_amplitude() method
- Converts aligned model "A" values to generic model amplitudes by computing angular factors
- Validates input by checking for the existence of the "cosi" key in the posterior data
Comments suppressed due to low confidence (1)
ringdown/result.py:976
- Consider adding a docstring for get_generic_amplitude() to describe its purpose, input expectations, and returned output for future maintainability.
def get_generic_amplitude(self):
| cosi = self.posterior.cosi.values | ||
| swsh = utils.swsh.construct_sYlm(-2, mode.l, mode.m) | ||
| ylm_p = swsh(cosi) | ||
| ylm_m = swsh(-cosi) |
Copilot
AI
Jun 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the shapes of ylm_p, ylm_m, and C are consistent for element-wise multiplication to avoid broadcasting issues; consider asserting or documenting the expected dimensions.
| ylm_m = swsh(-cosi) | |
| ylm_m = swsh(-cosi) | |
| # Assert shape consistency | |
| assert C.shape == ylm_p.shape == ylm_m.shape, ( | |
| f"Shape mismatch: C.shape={C.shape}, ylm_p.shape={ylm_p.shape}, ylm_m.shape={ylm_m.shape}" | |
| ) | |
For the aligned polarization model, the$\enspace_{-2}Y_{\ell m} \enspace$ are factored out of the mode amplitudes, whereas no constraints on polarizations (the generic model) allows us to absorb the angular factors into the intrinsic mode amplitudes. I have written a method in
Aparameter is different from that of the generic model; when enforcing equatorial plane symmetry (the aligned model), the angular factorsresult.pycalledget_generic_amplitude()which converts theAoutputted by the aligned model into that of the generic model.