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

Summary plot issue when no significant signals are detected (with potential fix) #201

Open
JenniferBurt opened this issue Aug 25, 2022 · 3 comments

Comments

@JenniferBurt
Copy link
Collaborator

When RVSearch does not find any significant signals to report, the process of creating the summary figure fails due to a gridspec error that claims:

Number of rows must be a positive integer, not {nrows}
ValueError: Number of rows must be a positive integer, not 0

Because RadVel's plot_multipanel() function has a default setting of nophase=False, gridspec tries to create rows in the summary figure equal to the number of planets detected. And if that number of planets is 0, then it throws the above error.

Updating the figure command just under the "#Generate an orbit plot" section in RVSearch to flip the nophase keyword depending on whether or not signals are discovered (as shown below) has fixed this issue for me and may help others as well :)

            if self.save_outputs:
                rvplot = orbit_plots.MultipanelPlot(self.post, saveplot=outdir +
                                                    '/orbit_plot{}.pdf'.format(
                                                    self.num_planets))
                if self.num_planets == 0:
                    multiplot_fig, ax_list = rvplot.plot_multipanel(nophase=True)
                else:
                    multiplot_fig, ax_list = rvplot.plot_multipanel()
                multiplot_fig.savefig(outdir+'/orbit_plot{}.pdf'.format(
                                                        self.num_planets))
@zhexingli
Copy link
Collaborator

Can confirm this fix works! Thanks Jen!!

@bjfultn
Copy link
Contributor

bjfultn commented Aug 26, 2022

Could one of you submit a PR for the fix?

@zhexingli
Copy link
Collaborator

Just submitted a PR on this with Jen's method.

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

No branches or pull requests

3 participants