NSLS-II / Bug-Reports

Unified issue-tracker for bugs in the data acquisition, management, and analysis software at NSLS-II
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

PS not available if scan stopped. #162

Closed ambarb closed 7 years ago

ambarb commented 7 years ago

Often stop scans to not collect useless data. Is there a way to retain the peak stats?

In [255]: gs.TABLE_COLS = ['fccd_stats2_total','fccd_stats3_total']; gs.PLOT_Y = 'fccd_stats2_total'

In [256]: RE(dscan(theta,-5,5,20))
Transient Scan ID: 74416 @ 2017/02/18 16:49:02
Persistent Unique Scan ID: '9224b4cb-94dc-4521-a3be-46d22822c452'
+-----------+------------+------------+---------------------+-------------------+-------------------+
|   seq_num |       time |      theta | theta_user_setpoint | fccd_stats2_total | fccd_stats3_total |
+-----------+------------+------------+---------------------+-------------------+-------------------+
|         1 | 16:49:19.8 |    49.2500 |             49.2500 |            769210 |           1110173 |
|         2 | 16:49:27.7 |    49.7500 |             49.7500 |            767063 |           1105875 |
|         3 | 16:49:35.2 |    50.2500 |             50.2500 |            786643 |           1152988 |
|         4 | 16:49:42.9 |    50.7500 |             50.7500 |            787527 |           1195116 |
|         5 | 16:49:50.6 |    51.2500 |             51.2500 |            793459 |           1264127 |
|         6 | 16:49:58.0 |    51.7500 |             51.7500 |            798956 |           1412229 |
|         7 | 16:50:05.6 |    52.2500 |             52.2500 |            953573 |           1764931 |
|         8 | 16:50:13.0 |    52.7500 |             52.7500 |           1186169 |           2133055 |
|         9 | 16:50:20.5 |    53.2500 |             53.2500 |           1639138 |           2306899 |
|        10 | 16:50:28.3 |    53.7500 |             53.7500 |           2224078 |           2127408 |
|        11 | 16:50:36.4 |    54.2500 |             54.2500 |          25628964 |           1761322 |
|        12 | 16:50:44.5 |    54.7500 |             54.7500 |           2247034 |           1397038 |
|        13 | 16:50:52.5 |    55.2500 |             55.2500 |           1597779 |           1223686 |
^CA 'deferred pause' has been requested. The RunEngine will pause at the next checkpoint. To pause immediately, hit Ctrl+C again in the next 10 seconds.
Deferred pause acknowledged. Continuing to checkpoint.
|        14 | 16:51:01.4 |    55.7500 |             55.7500 |           1183695 |           1131150 |
Pausing...
Out[256]: ['9224b4cb-94dc-4521-a3be-46d22822c452']

In [257]: gs.PS.max[0]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/xf23id1/Users/2017_2_Frano/startup.py in <module>()
----> 1 gs.PS.max[0]

TypeError: 'NoneType' object is not subscriptable

In [258]: RE.stop()
Stopping: running cleanup and marking exit_status as 'success'...

In [259]: gs.PS.max[0]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/xf23id1/Users/2017_2_Frano/startup.py in <module>()
----> 1 gs.PS.max[0]

TypeError: 'NoneType' object is not subscriptable

In [260]: 

In [260]: 
tacaswell commented 7 years ago

Something is odd, it should be firing on the stop. @gjwillms reported something similar...

Do those headers have stop documents in the database?

If you call gs.PS.compute() to force the computation. You can also make a PeakStats object and restream the data from databroker back through it.