Add PulsePattern.plot_grid()#504
Conversation
e407c05 to
6681592
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #504 +/- ##
==========================================
- Coverage 73.67% 73.66% -0.02%
==========================================
Files 35 35
Lines 6831 6956 +125
==========================================
+ Hits 5033 5124 +91
- Misses 1798 1832 +34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
A couple of questions before looking at any of the code:
|
|
Also, for a sequence split over multiple rows, I might prefer the first row at the top rather than the bottom. But if you've done it this way to match the Karabo widget (I haven't really used that), consistency is a good argument. |
Apologies, I silently expected context from the earlier MR last week and missed it in the description. Transparency (technically color, though I chose the colormap to be roughly equivalent) is used to indicate variable patterns, with the value weighted by the frequency of occurence. For a constant pattern, you will only see one level. In the example, we're looking at alternating trains of all pulses pumped vs FEL for only the first two. But there are various forms of rotating FEL pulse patterns in use at other instruments the plot must be able to handle.
As mentioned above, this is meant as a base implementation and thus treats all pulses the same, whether FEL-only, PPL-only, or pumped. In a next step, I would want to customatize this method in
Interesting idea, yes. It would somewhat collide with the point above 🙃
Ah, that sounds like a good idea. Generally I would imagine this plot is mostly used to get a mental image, like done for the original it is modelled after in Karabo:
|
Therein lies the problem. The SCS/HED version (screenshot above) is top to bottom, the SPB version from LFF is bottom to top. Generally I would gravitate towards the latter, as from a scientist perspective 2D plots continue to have their origin in the lower left. |
|
Thanks! For plots with two separate axes I think the origin at the bottom makes sense, but where it's really one long sequence that we're chopping up ~arbitrarily into multiple rows, I think a page of text is a better model. So if we've already got a mixture in Karabo, I'd lean towards following the SCSH/HED version. |
|
The comparison to Karabo can be distracting though, as these plots will rather appear in notebooks. I would certainly be confused by any plot, 2D or otherwise, to go top to bottom there. This is consistent with the 2D plotting methods in Regarding your earlier point about counting from left to right: Maybe instead of a homogeneous grid, we could go for different grid styles of major/minor ticks to ease counting. |
|
After the generalizations we made in #499 and some more discussion with Fady, I decided to also make a generic version of that in Therefore I renamed this method |
|
+1 for top to bottom. My rational is that this isn't a plot, rather a representation of organized (monotonically increasing indices) data, and it's much natural for me to read left>right, top>bottom. |
|
I've asked around some more and did not find strong opinions to keep the origin in the lower left. Improvements based on feedback so far:
* After playing around with ticks, I noticed even powers of two don't make it particularly intuitive to count. It is fine-ish for X, but then adding the number to Y is cumbersome. This became much better by going to multiples of 10, as now Y's ticks are generally also multiples of 10 and the X-axis runs up to |
Shall we rename it then to something like |
|
Nice, thanks 👍 I was also wondering about suggesting a rename. 'inspect' could be another option, like EXtra-geom. But we have various 'plot' methods like |
|
I think I like We could also introduce this for other components like |
83e495f to
8494848
Compare


This is the second part after #499 to add basic visualization for any pulse pattern, here inspired by the common online diagnostics already in Karabo with some tweaks for better offline compatibility.
This is meant to only cover the base implementation in
PulsePattern, with advanced implementations likePumpProbePulsescustomizing this with their specialized data.