Don't necessarily overwrite luminosity distance if redshift is supplied
For cosmology studies, it is conceivable that a user will generate their own precomputed dL -> z mapping and save both of these values in the injection parameters, along with source-frame masses. Currently, in this case the conversion function will ignore the dL supplied by the user and overwrite it such that it uses the Planck15 dL given the supplied redshift.
This fix works under the assumption that if the user has supplied both z and dL, they have confirmed that they are related by the intended cosmology a priori.
Merge request reports
Activity
- Automatically resolved by Jacob Golomb
I'm happy for this to be added, as it should be an efficiency improvement when these calculations are not needed.
The recommended use would be to use the built-in cosmology setter.
If one is using a fixed different cosmology, this can be called once at the top of the script.
If the cosmology is being sampled over, I would recommend wrapping this conversion function first, update the cosmology in the wrapper through the above function, and then call
convert_to_lal_binary_black_hole...
.I guess there are other cases where people care about, for example, peculiar velocities that I haven't thought about, but I think that should be handleable with the above suggestion.
- Resolved by Colm Talbot
changed milestone to %1.3.0
@jacob.golomb please can you update to the latest version of master? That should fix the CI.
added 19 commits
-
135d397f...0cf93ff6 - 15 commits from branch
lscsoft:master
- 5732c2cf - Update bilby/gw/conversion.py
- e333f796 - Update bilby/gw/conversion.py
- ff3fbaf3 - Update AUTHORS.md
- 04cba1e3 - Merge branch 'allow-cosmology-agnostic-conversion' of...
Toggle commit list-
135d397f...0cf93ff6 - 15 commits from branch
- Resolved by Colm Talbot
@jacob.golomb it looks like you may have to add yourself to https://git.ligo.org/lscsoft/bilby/-/blob/master/test/check_author_list.py#L6.
added 1962 commits
-
8c241c02...6f6362f8 - 1959 commits from branch
lscsoft:master
- 81eae021 - Update bilby/gw/conversion.py
- fae45b6c - Update bilby/gw/conversion.py
- f79238a3 - Update AUTHORS.md
Toggle commit list-
8c241c02...6f6362f8 - 1959 commits from branch
mentioned in commit 6780f567