Open gergopokol opened 4 years ago
Should the FLAP plotter be considered?
Should the FLAP plotter be considered?
Yes. FLAP uses matplotlib routines, and so it can be parameterized as needed. In principle...
My main concern is if the interactive features would require detailed information on colour scales, etc.. that are now calculated internally in FLAP plotters and the info might not be accessible. Should be tested, I guess...
@poloskeipeter opened new issue for the discussion, contents of which are copied herein:
I would like to initiate a discussion about the functionality of the displayed plots. What are the crucial functionalities which should be implemented?
* different windows for stft and modenumbers * channel selection for stft * colorbar * basic zooming * filtering (IDL ones) * saving figures (with parameters & ID)
The proposal by @poloskeipeter slightly refined (can be iterated further):
@gergopokol it is possible in QTdesign to set up a single interface with multiple "subwindows" (for modenumbers and anything else).
Although I am not 100% sure if the main plotting interface should contain options for anything else but spectrograms and modenumbers.
With other suggestions I agree, and I will create their place and their basic functionality (for spectrograms and modenumbers I think I know how).
As we don't have the calculations yet implemented, @martonvavrik would it be possible to prepare a plot-testing data set in the flap format ?
@martonvavrik is working on the data reader in #22. Almost ready, just debugging.
First contourplots have been added, with a function, if you click on the figure, while no tool is selected, it prints the value of the contourplot wherever the cursor was.
Current possibilities & how to test them:
Idea for modenumber plotting:
Basic plotting window funtionality is done.
There were a couple ideas from Gergo to the detailed plotting:
Relevant part of help has been added
Interaction with the color scale seems to be a bit buggy. Tested on various sav files (e.g. AUGD_38088_Loaded-with-MTR_processed_spectrogram_smoothed.sav) with current version of the python-new-GUI branch.
The following error was given when clicking on the colorbar (when it also produces the previous bug):
Traceback (most recent call last): File "C:\Users\Marci\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 215, in process func(*args, **kwargs) File "E:/marci main/Fusion/nti-wavelet-tools/python/gui/main.py", line 339, in MouseClickInteraction high = self.colorbar.boundaries[int((act - lo) / step) + 1] IndexError: index 12 is out of bounds for axis 0 with size 12 Traceback (most recent call last): File "C:\Users\Marci\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 215, in process func(*args, **kwargs) File "E:/marci main/Fusion/nti-wavelet-tools/python/gui/main.py", line 338, in MouseClickInteraction low = self.colorbar.boundaries[int((act - lo) / step)] IndexError: index 12 is out of bounds for axis 0 with size 12 Traceback (most recent call last): File "C:\Users\Marci\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 215, in process func(*args, **kwargs) File "E:/marci main/Fusion/nti-wavelet-tools/python/gui/main.py", line 338, in MouseClickInteraction low = self.colorbar.boundaries[int((act - lo) / step)] IndexError: index 14 is out of bounds for axis 0 with size 12
Bug investigated: If the coordinate is normalized in line 336 of main.py, it works on Gergő's and Marci's laptop. Peti's laptop does need the normalization. To be investigated further.
@gergopokol @martonvavrik please check if this works for you or not
Position on the color scale is correctly indicated. Spectrogram filtering seems to work just fine. Modenumber filtering fails fo highlight some mode numbers, and even more if we plot on a large mode number scale, say [-20,20].
Despite our best attempts, mode number highlighting is still buggy.
The actually plotted colour values (checked from saved plot with GIMP) on the cloor scale (checked from saved plot with GIMP) sit just in the middle of the corresponding selectedCmap values remaining after the selection, which seems to be ok. This bug is a mistery... Also, it works differently at Peti, but still buggy.
An idea would be to explicitly state the number of colorscale elements (maximal - minimal +1), and reimplement the selection part algorithm, using a similar method as now, but without the rescaling needed.
It seems that using this method leads to a double-length (2 long) bin for the 0 modenumber instead of a 1 long. My suspicion is getting stronger around int-casting.
Pushed code seems to provide the requested plot-interaction functionality. It works both for me and @gergopokol (matplotlib 3.2.2 and matplotlib 3.1.2). Other versions were not tested.
2D plots should be plotted preferably in new window opened from the GUI. Should be a universal plotter, and specific plotters can be children of the universal one.
First, functionality is to be discussed. Then GUI design, Implementation of auxiliary calculations. Implementation can be tested after #13