ephyviewer icon indicating copy to clipboard operation
ephyviewer copied to clipboard

Add TraceImageViewer, plus other small updates

Open grahamfindlay opened this issue 1 year ago • 1 comments

Added a prototype TraceImageViewer to display current source density (or any kind of signal vs time traces)

Example: spw_viewer_example

This is a very quick-and-simple minimal implementation, so there are a few known issues:

  1. When the viewer is first opened, and the window displays a time range that extends beyond the edge of the data (e.g. data start at 0, but window is (-2, +8)), setImage fills the whole window, so that the TraceImage is misaliged to traces. Example: misaligned

  2. The color limits are set based on the local image currently being displayed, not on the full data. This means that the RGB value on one page may not map to the same absolute CSD value on another page. Personally, I actually like it this way, but someone will be surprised by this behavior. Example (there is a 100ms scroll between these two images): aligned local_color_scale

  3. I naively added the ability to change multiplicative gain by scrolling the mousewheel, like in the TraceView, but because of issue 2 above, you can't actually see the effect, so I probably ought to just remove that logic to avoid confusion 🤦

Also made a few other small changes:

  1. Put abstract sample_rate property on BaseAnalogSignalSource, and implemented the property on necessary subclasses.
  2. Removed unused imports in several places
  3. Replaced deprecated matplotlib.cm.get_cmap(name, N) pattern with matplotlib.colormaps.get_cmap(name).resampled(N)

grahamfindlay avatar May 10 '23 18:05 grahamfindlay

Hi @samuelgarcia, what's the status on this? Can we merge or is there an alternative?

TomBugnon avatar Nov 27 '23 15:11 TomBugnon