XML Converter: Right Ascension (-pi,pi) -> (0,2pi) If Needed
Some Injection XMLs use a (-pi,pi) range instead of a (0,2pi) range for ra, added catch to convert if necessary.
Merge request reports
Activity
Hi @joshua.brandt, I want to check this fix before merging.
In bilby, RA is specified on the domain [0, 2pi]. If it is specified on the domain [-pi, pi] in another code, I'd expect to apply the transformation +pi. Instead, what is being done is to add 2pi if it is less than 0. This amount to (I think) a reflection + translation of the region [-pi, pi] onto [pi, 2pi]. Is this what we want?
It would seem to me safer to add a flag to enable this conversion.
Hello @gregory.ashton
I believe a transformation of
+\pi
will rotate every angle by180^\circ
. Since[-\pi,\pi] \cap [0,2\pi] = [0,\pi]
we only need to adjust angles< 0
, because otherwise they're already in the[0,2\pi]
range, and adding+2\pi
keeps them in the same position, but just written in the Bilby range (rotates them360^\circ
). In other words\newline
[-\pi,\pi] = [-\pi,0] + [0,\pi] \newline [-\pi,0]
->[-\pi + 2\pi, 0 + 2\pi] = [\pi,2\pi] \newline [0,\pi] + [\pi,2\pi] = \newline [0,2\pi]
I agree with the flag to enable the conversion, I have added that in the recent commits, thanks!
- Resolved by Gregory Ashton
mentioned in commit ae75998a
changed milestone to %1.0.5