sardana-org / sardana

Moved to GitLab: https://gitlab.com/sardana-org/sardana
39 stars 52 forks source link

Continuous scan improvements with Referables #1448

Open 13bscsaamjad opened 3 years ago

13bscsaamjad commented 3 years ago

Problem Statement

For continuous scans like timescan, experimental channels like CounterTimer are read multiple times during the acquisition and it seems like they are updated with the acquired data on the spock in bunches of 10 data points. This is very useful for the users since they get feedback that the scan is proceeding well.

But this is not true for the 2D channels with refs enabled. For these, nothing is printed until the scan is finished. I think its done like this because 2D referable channel needs to be embedded into the master file being written by recorder and since there is no guarantee that this file would be available to be embedded until the end of the scan, its better to wait for the scan to finish before embedding it.

This is a problem for the users when they run a scan which takes some time and they don't see any output until the scan is finished. Its not a good user experience and the users feel nervous about the scanning system.

Suggestion

For the continuous scans from Referable channels, there should be only one file/dataset written by the external channels and RefAll and RefOne should be called multiple times just as from a CounterTimer channel to give feedback to the users about the scan status. And if the RefOne is only giving a ref to one file/dataset maybe it is not a good idea to return ref string to fill the spock output with the same string pointing to the ref for each point. Perhaps it is better to return a bool and just print it when the scan is finished that the channels ref is embedded with this ref.

This might have some implications that I might not thought about. Opening the issue to get comments from the fellow developers.

reszelaz commented 3 years ago

Hi Abdullah, I have just read the "Problem Statement" and I think what you describe is a bug and a fix was already proposed: https://github.com/sardana-org/sardana/pull/1442. Could you confirm that with this PR it is fixed for you? I will read the "Suggestion" part carefully afterwards, if still necessary.

13bscsaamjad commented 3 years ago

Hi Zbi,

Thanks for the reply. It is exactly the bug you are pointing out. I will test the solution you proposed in the PR and get back to you.