Allow user choice for sky loc param names, add unit tests for sky loc dists #5189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current sky location distributions require the angular parameters to be called "ra" and "dec". This allows the user to use different names.
Standard information about the request
This is a new feature.
This change affects mostly PyGRB and potentially inference.
This change changes the syntax of config files.
Motivation
Most of the existing sky location distributions hardcode the angular parameters to be called "ra" and "dec". This prevents the use of waveform transforms, e.g. the case where we draw the sky location from a Fisher distribution but then want to transform it to keep the source fixed with respect to the Earth. This patch enables the use of arbitrary names, based on how the
angularmodule does it.Contents
Each distribution specification can now use
azimuthal-angleandpolar-angleto indicate the names of the corresponding parameters. These should match the section tag, and this is enforced.I also removed some code duplication by introducing a parent class to implement some common stuff.
Finally, I added very basic unit tests for (some) of the sky loc distributions. More complicated tests would be good, but will come in later PRs once I find the resources :)
Links to any issues or associated PRs
None.
Testing performed
Relying on the new unit tests.
Additional notes
None.