# 2023-06-13 Quicklook Qt meeting
Participants: **David, Frédéric, Éric, Alfred**
* [Next notes](https://codimd.math.cnrs.fr/l4T7u6INTHC3H7CXNMvuaw?both#)
## Questions
(You can answer here :grinning:)
- Do we want to suggest a **global export option**? This way you could choose which windows, plots, parameters... you want to export in one main popup. :arrow_right: ...
* question was about exporting all maps.
* Export button next to graph: call Pyqtgraph dialog (same right click) instead of direct output to PNG file with no option
- Value scaling
* Changing percentiles
- To discuss: **loading** heavy data **files** can show **"Force quit"** for a little while (not critical but not clean either). Data loading were already moved to threads but we can't move "display-related" processes to threads (it must be done in the main process, otherwise blackout display issues come up).
Pyqtgraph needs 100 ms to display a plot (even empty) which leads to e.g. for 8 windows: $0.100 \times 8 \times 6=4.8s$ :arrow_right: ...
- Are plots **$I(x)$ and $I(y)$** useful to show somewhere? :arrow_right: ...
- Could be a choice in the current I(λ) plot
- Should fit maps be $(t,y)$ for sit and stare? :arrow_right: ...
- Yes, maps are still 2D (t, y).
- Intensity **level values and pourcentiles** are still "disconnected", is the current behavior good enough? :arrow_right: ...
- Do show **"Reset zoom"** buttons for each plot or is a global button enough? :arrow_right: ...
- No need
- Is it useful to suggest to **hide processes in the footer** once they are done? :arrow_right: ...
- Better order them by finished status before ordering them by date
- Do people see all the buttons in the top menu bar? Claude's system seems to hide some of them. :arrow_right: ...
- Yes
- Linking $I(x,y)$ maps' **zoom/pane** with "fit maps" make the slider movements really slow, can we let these disconnected? :arrow_right: ...
- Not so bad?
- Next **main feature** to focus on? :arrow_right: ...
## Ready to be checked :checkered_flag:
- By double-cliking you can aim a $(x,y)$ or $(\lambda,y)$ position in one shot instead of moving horizontal and vertical bars
- OK
- Show thread progresses in the footer
- OK
- When moving a slider, update everything in real time (i.e. other related sliders, $I(\lambda)$ plot, ...)
- OK
- Show mouse coordinates on mouse hover (+ $I$ value)
- OK
- Add a button to reset zoom (triggers "View All")
- OK
- Fix level option especially for $log$ and $sqrt$ methods (it crashed) and prevent user to click on "Apply" twice
- OK
- Automatically reset zoom (View All) on $I(\lambda)$ each time it must be updated
- OK
- Find a way to exclude dumbbells in fit maps generation (even better: the user can now select a small region of interest thanks to the grey bars in the $I(x,y)$ map before generating it)
- Bars are not much visible
- No need to redisplay the message each time
- Fix: reload several data files crashed the app
- Working up to now
- Abort processes when user loads another data file (--> interrupted progress bar in the footer changes to red)
- OK
- Show more study and window details (slit, ...)
- Change to show all as a list
- Fix: moving the $y$ horizontal bar worked for the 1st window but didn't correctly for the other ones
- OK
- Add an offset $+ K$ in the gaussian fit
- OK
- But the NaNs seem to be considered as 0 for the fit and 1D fit plot, they should remain NaN. Also for the 2D map fit.
- Review the layout of the local level option in order to put side by side a maximum of window blocs, e.g. to view all the $I(x,y)$ maps
- OK
- Remove the $y$ slider, the $y$ value is only handled by the horizontal bars
- OK
- Show number of current running threads
- OK
- Hide ROI and Menu buttons next to maps
- OK
- Clarify $x, y, \lambda, t$ next to NAXIS values
- OK
- Do not show NaN warnings, no reason to worry, they are in the data
- OK
- Sometimes by default, the right part of the $I(x,y)$ map was not visible, "View All" is triggered after loading the maps to fix it
- OK
- Moving hardly the 3rd dimension slider of the second map shouldn't freeze the app anymore
- OK
- Fix: the fit maps titles were wrong after moving the mouse over one of it
- OK
- Add pop-ups to explain what the user can do with fit maps
- OK
## To do next (features)
- **Keep zoom and pane state after updating the maps** (checkbox, apply average, levels, ...)
:point_right: *This is solved by restoring ViewBox's state when maps are not "zoom-linked", find a way to make it work with "zoom-linked" maps.*
- **Global export option**:question:
- Not needed
- **Set relevant names in image outputs** (instead of output.png)
- Yes
- **Adapt app to Full Spectrum input files**
- **Show real units instead of cube indexes** (Å, ", ...)
- There could be a choice
- **Remove triangles in level histograms**
- Can be removed
- **Show a relevant message if the user doesn't load a level 2 fits file**
- Yes
- *Cf. Trello board Data quicklook*
## To do next (optimization)
- **Speed up data file loading**
:point_right: *Still show "Force quit" (for a little while) if there are a lot of windows to display but processings that are updating the display can't be moved to threads in background :warning:*
- **Double-check memory leak when generating window blocs**
- Now crashes after loading a few tens of files (in a row; only the last file is open), this is better than before, but should still be improved.
- **Is it not safe to use `curve_fit` in a thread?**
- Seems to work.
- **Secure menu, do not allow to change things while files are loading**
- **Put "Refresh plots" in a thread to avoid freezes**
- *Cf. Trello board Data quicklook*
## Ideas
*Cf. Trello board Data quicklook*