taurus-org / taurus

Moved to https://gitlab.com/taurus-org/taurus
http://taurus-scada.org
43 stars 46 forks source link

Display "realtime" plots for spectrum attributes being scanned #109

Open sf-migrator-bot opened 10 years ago

sf-migrator-bot commented 10 years ago

TaurusGui is currently able to create dynamic panels for displaying trends showing evolution of a scalar value being being scanned.

When 1D experimental channels are scaned, one could show a plot (which does not show the evolution) and/or a Trend2D (aka spectrogram).

This is a feature request for the first option.

Teresa already submitted a patch to the devel mailing list with a proposal for implementation: https://sourceforge.net/p/sardana/mailman/message/32680081/

Se also this email from Teresa introducing the request: https://sourceforge.net/p/sardana/mailman/message/32679717/

Reported by: cpascual ( http://sf.net/u/cpascual )

sf-migrator-bot commented 10 years ago

I tried this patch, and I have the following comments:

1) To make it work, the experiment config info must contain ndim (and this is not the case by default). As a workaround,just in order to test, I changed the line 141 of macrolistener.py (which says "ndim = chdata.get('ndim', 0)") to "ndim = chdata.get('ndim', 1)"

Note that a comment on the sameline says: "#TODO: get default value from the channel.". This already points in the right direction to have this solved in a better way.

2) In her original email, Teresa says:

I based now on the value of the 'DataSource' attribute, hoping that it corresponds to a Tango Attribute with the spectrum data".

In fact, the original motivation of the "DataSource" is to be able to provide sources that are not Tango attributes but also other types of Taurus attributes (so that one can .e.g use a taurus scheme for direct disk access to retrieve big images without having to pass them via Tango). In any case, the current implementation by Teresa is ok in this regard because it would work in principle for arbitrary Taurus schemes.

3) I see a potential problem in terms of synchronization: the proposed implementation only makes sense if one can guarantee that the attribute defined by the DataSource is configured to push events every time it changes during a scan (otherwise the taurus internal polling would refresh every 3s by default and not each time a new step is done)

4) The use of a TaurusPlot widget for this is ok as a first proof-of-concept but IMHO, the widget used should in some way be able to show the value of the scan "axis". That is: the widget should not only plot the 1D, but also provide info of which point in the scan is associated with the current plot. For example, if one does an ascan and sets the the "axis" to be "", the plot widget should show somewhere (e.g. , a dedicated label or the "plot title") the point-number of the scan for which the 1D is currently being plotted.

5) Related to 4). I think "Plot Axis" should be treated as similar as possible to the way it is treated for trends. It should be possible to set it to "" and "" (meaning, display the point number or the motor position, respectively) and also to an arbitrary counter value (just as you can do for trends).

6) Keep also in mind the possibility of using TaurusTrend2DDialog for representing this kind data. Long time ago I started playing with this idea (and there is some code in macrolistener.py along those lines). In fact, the TaurusTrend2DDialog provides cross-section plots which could be used to provide the 1D plots while still showing simultaneously the evolution as an spectrogram.

Conclusion: I think that at least the issues from comments 1 and 3 should be addressed before we integrate this patch. The rest of the comments could be addressed later on.

Original comment by: cpascual (http://sourceforge.net/u/cpascual)

sf-migrator-bot commented 9 years ago

Original comment by: cpascual (http://sourceforge.net/u/cpascual)

sf-migrator-bot commented 9 years ago

Ticket moved from /p/sardana/tickets/233/

Can't be converted:

Original comment by: tiagocoutinho (http://sourceforge.net/u/tiagocoutinho)