Skip to content

Conversation

@titodalcanton
Copy link
Contributor

@titodalcanton titodalcanton commented Sep 24, 2025

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 angular module does it.

Contents

Each distribution specification can now use azimuthal-angle and polar-angle to indicate the names of the corresponding parameters. These should match the section tag, and this is enforced.

[prior-foora+bardec]
name = fisher_sky
mean_ra = 10deg
mean_dec = 10deg
radius = 10deg
azimuthal-angle = foora
polar-angle = bardec

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.

  • The author of this pull request confirms they will adhere to the code of conduct

@titodalcanton titodalcanton marked this pull request as draft September 24, 2025 15:44
@titodalcanton titodalcanton changed the title Allow user choice for sky loc param names Allow user choice for sky loc param names, add unit tests for sky loc dists Sep 25, 2025
@titodalcanton titodalcanton marked this pull request as ready for review October 3, 2025 11:51
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.

1 participant