Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Advance output of last points in continuous scan #1668

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

reszelaz
Copy link
Collaborator

@reszelaz reszelaz commented Jul 27, 2021

#1651 points that output of last points in continuous scan often comes too late.

  • Change logger for data events processing messages to GSF classes level (CTScan and TScan) instead of the macro level. These messages may be confusing if macro is run in debug mode (the messages are interleaved with the output fo the scan records)
  • Delay overshoot correction until after ending all records.

Fixes #1651.

In case of TScan some data events processing messages are logged
from the TScan level and some from the macro level. Unify them and log
both from the TScan level. Do the same for the CTScan class and log
both messages fom the CTScan level.
RecordList.end() completes iniitilzed records and
officially ends the scan data handling. Split the
completion part into a separate method:
endRecords() and keep just the end of the scan data
handling in the end() method.
Call RecordList.endRecords() as soon as all the data
events are processed.
It does not make too much sense to log on the macro
level messages like: "on_waypoints_end() entering...".
Chnage its logger to the CTScan level.
It may happen (race-condition) that "Correcting overshoot" info
message appears in the middle of the records output. This is
missleading. Change the approach and only print info on overshoot
correction after all the data were processed. This way they will never
mix with the records output.
@reszelaz
Copy link
Collaborator Author

I have implemented the delayed info on overshoot correction as proposed in #1651 (comment).
The output now looks like this, in case the overshoot correction was done:

   99       9.9       0.1       0.2       0.3       0.4       11.9  
  100        10       nan       nan       nan       nan        12   
Overshoot was corrected
Operation saved in /tmp/test2d.h5 (HDF5::NXscan)
Scan #17 ended at Fri Oct 29 11:16:06 2021, taking 0:00:15.137578. Dead time 99.7% (setup time 0.3%, motion dead time 99.7%)

and in case it was disabled (senv ScanOvershootCorrection False):

   99       9.9       nan       nan       nan       nan       11.9  
  100        10       0.1       0.2       0.3       0.4        12   
Overshoot was not corrected
Operation saved in /tmp/test2d.h5 (HDF5::NXscan)
Scan #18 ended at Fri Oct 29 11:22:56 2021, taking 0:00:15.207367. Dead time 99.8% (setup time 0.2%, motion dead time 99.8%)

Before it could look like this:

   99       9.9       0.1       0.2       0.3       0.4       11.9  
Correcting overshoot...
  100        10       nan       nan       nan       nan        12   
Operation saved in /tmp/test2d.h5 (HDF5::NXscan)
Scan #16 ended at Fri Oct 29 11:06:15 2021, taking 0:00:15.607811. Dead time 99.9% (setup time 0.1%, motion dead time 99.9%)

In case of the ascanc macros the overshoot correction info messages are printed in the old way - there we are not processing the data events asynchronously so there is no risk to mix with the records output.

@johanfforsberg could you please review and eventually merge it? Thanks!

@reszelaz reszelaz changed the title WIP: Advance output of last points in continuous scan Advance output of last points in continuous scan Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output of last points in continuous scan often comes too late
1 participant