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

Improve trending plots, particularly wfe_histogram arrows display #870

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

mperrin
Copy link
Collaborator

@mperrin mperrin commented Jun 11, 2024

Improves the trending.wfe_histogram_plot arrow markers to show corrections.

  • switches to use matplotlib.annotate to draw the arrows, instead of separate calls to plot lines and draw triangle markers. This ultimately is cleaner but ended up taking a while to figure out since there's a ridiculously complicated set of options to the arrow-drawing functions.
  • Adds min_wfe and max_wfe options to that function, which can be used to directly set custom min and max ranges if the defaults aren't suitable in some particular case. The histogram and cumulative histogram display is updates to clip values, such that values outside of min and max are still included in the histogram at the extreme bottom or top bin of the histogram, respectively.

Example output:

Unknown-12

Separately, this PR also has a minor fix to some unrelated display issues elsewhere in trending.py, by setting clip_on=True in a couple function calls, to prevent labels being drawn outside of axes sometimes depending on x and y ranges there. This is mostly unrelated but is convenient to combine into this same PR.

@mperrin mperrin added bug Something isn't working JWST Affects JWST models in WebbPSF labels Jun 11, 2024
@mperrin mperrin requested a review from kulpster85 June 11, 2024 19:01
@mperrin mperrin self-assigned this Jun 11, 2024
@pep8speaks
Copy link

pep8speaks commented Jun 11, 2024

Hello @mperrin, Thank you for updating !

Line 386:70: E226 missing whitespace around arithmetic operator
Line 390:17: E124 closing bracket does not match visual indentation

Comment last updated at 2024-06-11 19:05:15 UTC

@kulpster85
Copy link
Collaborator

Looks great! Did some testing with the various options and it works well with changing the min,max values as well as the correction markers.

@mperrin mperrin merged commit 7c74ffb into spacetelescope:develop Jun 11, 2024
7 checks passed
@mperrin mperrin deleted the trending_plot_fixes branch June 11, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working JWST Affects JWST models in WebbPSF
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants