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

Add folding period to ephemeris viewers axis label #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bmorris3
Copy link
Contributor

It's easy to forget what period you have set in the Ephemeris plugin, and it's a bit annoying to need to open the plugin if it isn't already visible. This confusion is multiplied when you have multiple ephemerides (with distinct periods).

This PR adds the period to the x-axis label in phase viewers. Here's an example for RR Lyra:

Screen Shot 2023-11-13 at 20 53 35

The x axis is probably the best place to put the period label for now. I tried using bqplot's title attr, but it only sits at the top-center. See the right-most phase viewer here:

Screen Shot 2023-11-13 at 21 06 48

Often the data will sit beneath that label, so I prefer the x label.

@bmorris3 bmorris3 requested a review from kecnry November 14, 2023 02:09
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (a5065e5) 94.93% compared to head (5d8e01b) 94.92%.
Report is 4 commits behind head on main.

Files Patch % Lines
lcviz/viewers.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
- Coverage   94.93%   94.92%   -0.01%     
==========================================
  Files          32       32              
  Lines        1381     1359      -22     
==========================================
- Hits         1311     1290      -21     
+ Misses         70       69       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

self.figure.axes[0].num_ticks = 5

ephem = self.jdaviz_helper.plugins.get('Ephemeris', None)
if ephem:
self.figure.axes[0].label = f'phase (P = {ephem.period:.2g} d)'
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this rounding could be deceptive.... can we use tex to show ~=?

We could also add a settings expansion menu and make this a togglable option (having phase:ephemeris_component might also be an option people want in some cases, and actually briefly happens sometimes since that is the name of the data component). It would be really cool if we had some presets for the labels but also allowed custom formatting 😉

Copy link
Member

Choose a reason for hiding this comment

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

Getting back to this - I think for now this is a good improvement, if we can use tex to avoid rounding confusion. Let's defer anything else to potential follow-up work 🐱.

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