Skip to content
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

Fix bug when plotting maximum likelihood point in create_multidim_plot #4942

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

acorreia61201
Copy link
Contributor

@acorreia61201 acorreia61201 commented Nov 14, 2024

This is a bugfix to the create_multidim_plot function in scatter_histograms.py. Specifying --plot-maxl does not plot the expected maximum likelihood point when used in conjunction with --plot-scatter in multidimensional plots. Currently, plot-maxl selects the index of the max likelihood sample before plot-scatter sorts the samples by their z argument. When both options are specified, the selected maxL index will generally not correspond to the maxL sample in the newly sorted array.

This PR moves the indexing selection for plot-maxl after the samples are sorted by plot-scatter. This should have no effect if using either option separately with codes using create_multidim_plot (e.g. pycbc_inference_plot_posterior), but should now correctly plot the maxL sample if both are specified.

@acorreia61201 acorreia61201 changed the title Fix bug when plotting maximum likelihood point in pycbc_inference_plot_posterior Fix bug when plotting maximum likelihood point in create_multidim_plot Nov 14, 2024
@acorreia61201 acorreia61201 marked this pull request as ready for review November 14, 2024 20:09
Copy link
Contributor

@cdcapano cdcapano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing

@cdcapano cdcapano merged commit 53b1757 into gwastro:master Nov 14, 2024
29 checks passed
prayush pushed a commit to prayush/pycbc that referenced this pull request Nov 21, 2024
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.

2 participants