NSLS-II / lsdc

LSDC - Life Sciences Data Collection
https://nsls-ii.github.io/lsdc
BSD 3-Clause "New" or "Revised" License
3 stars 14 forks source link

FMX energy scan issues #119

Closed JunAishima closed 3 years ago

JunAishima commented 3 years ago

Reported in spreadsheet - this appears in the log from an hour ago:

2021-09-13 14:36:32,411 daq_lib INFO robot gov status = False 2021-09-13 14:36:33,412 daq_lib INFO robot gov state = 1 2021-09-13 14:36:33,577 daq_main_common ERROR Attribute Error: 'list' object has no attribute 'sum' 2021-09-13 15:29:41,637 daq_main_common INFO command: openPort(1) 2021-09-13 15:29:41,648 daq_lib INFO Mon Sep 13 15:29:41 2021 openPort(1) 2021-09-13 15:29:41,648 daq_main_common INFO executing command: openPort(1) 2021-09-13 15:30:58,311 daq_main_common INFO command: closePorts()

JunAishima commented 3 years ago

the field 'mercury_mca_spectrum' now returns a list, which apparently can't be summed.

Was Bluesky returning a different type that could be summed before? lsdcServer_2021-1.0 - bluesky 1.6.0rc4, ophyd 1.4.0rc5 lsdc-server-2021-1.1 - bluesky 1.7.0, ophyd 1.6.2

This seems to be two problems - the first is the plotting, the second with the data type returned.

RobertSchaffer1 commented 3 years ago

I admit I'm a little lost - nowhere in daq_main_common.py does it attempt to sum anything, unless I'm missing something. Has this error occurred somewhere downstream and just not outputted any of the useful traceback information? If so, is there a place to go to get it?

JunAishima commented 3 years ago

I had filtered the daq_main_common part out - the energy scan is in daq_macros, and there is a sum in there. However, looking at the output from July to now, it looks fairly different. I need help, trying to understand this...

Jun


From: RobertSchaffer1 @.> Sent: Tuesday, September 14, 2021 10:58 AM To: NSLS-II/lsdc @.> Cc: Aishima, Jun @.>; Author @.> Subject: Re: [NSLS-II/lsdc] FMX energy scan issues (#119)

I admit I'm a little lost - nowhere in daq_main_common.py does it attempt to sum anything, unless I'm missing something. Has this error occurred somewhere downstream and just not outputted any of the useful traceback information? If so, is there a place to go to get it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/NSLS-II/lsdc/issues/119#issuecomment-919233292, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA3AKDJ4JV45G7L2G4DVV2TUB5PJVANCNFSM5D6S5NUA. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.com/v3/__https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!P4SdNyxKAPE!QskTrmn90b-6P3S7lNDbPncMqxsPl9b3_v3zE8Db-J7g3-teCUPBi1FyvoEj3jGm$ or Androidhttps://urldefense.com/v3/__https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!P4SdNyxKAPE!QskTrmn90b-6P3S7lNDbPncMqxsPl9b3_v3zE8Db-J7g3-teCUPBi1Fyvrwdfmhm$.

RobertSchaffer1 commented 3 years ago

Tbh, now I'm even more lost - why did the error log say:

2021-09-13 14:36:33,577 daq_main_common ERROR Attribute Error: 'list' object has no attribute 'sum'

if the error occurred in daq_macros and not daq_main_common? How did you find the error if there is no traceback info?

In any case, you can sum a list of numbers, just use the sum() command on it instead of calling its sum attribute. Should be a pretty quick fix.

WRT the plotting, it looks like a separate (much more serious) issue, will take some time to try to understand.

JunAishima commented 3 years ago

Data coming out of LSDC after - these are my fields, which are different values than shown below. 2021-09-14 10:19:08,542 daq_macros INFO scanID: ('c377cc3d-5411-49dc-ac0e-225321518658',) 2021-09-14 10:19:08,602 daq_macros INFO data and seq_num: {'mercury_mca_preset_live_time': 0.5, 'mercury_mca_spectrum': [80, 80, 91, 84, 88, 114, 118, 128, 113, 135, 121, 116, 144, 152, 159, 133, 159, 167, 148, 156, 142, 161, 159, 163, 157, 149, 149, 167, 161, 135, 134, 143, 145, 131, 101, 106, 97, 95, 104, 98, 105, 85, 87, 88, 86, 92, 73, 78, 60, 54, 55, 44, 62, 35, 40, 49, 42, 22, 40, 28, 28, 25, 27, 26, 20, 16, 17, 16, 15, 10, 13, 13, 10, 4, 15, 4, 6, 11, 5, 8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 0.0, 'mercury_mca_rois_roi2_count': 0.0, 'mercury_mca_rois_roi3_count': 0.0, 'vdcm_e': 12637.0, 'vdcm_e_user_setpoint': 12637.5} 1

Data coming out of LSDC before (seq_num and mercury_mca_rois_roi0_count[index+1] for multiple points above): 2021-07-09 12:17:10,783 databroker._core INFO Interpreting key = a0d5627e-e546-4143-b78e-4917009b1664 as a str 2021-07-09 12:17:10,798 daq_macros INFO 1 9125 2021-07-09 12:17:10,799 daq_macros INFO 2 8493 2021-07-09 12:17:10,800 daq_macros INFO 3 7447 2021-07-09 12:17:10,801 daq_macros INFO 4 7559 2021-07-09 12:17:10,802 daq_macros INFO 5 6718 2021-07-09 12:17:10,803 daq_macros INFO 6 6928 2021-07-09 12:17:10,803 daq_macros INFO 7 6403 2021-07-09 12:17:10,804 daq_macros INFO 8 6505 2021-07-09 12:17:10,805 daq_macros INFO 9 6668 2021-07-09 12:17:10,806 daq_macros INFO 10 6660 2021-07-09 12:17:10,807 daq_macros INFO 11 6849 2021-07-09 12:17:10,807 daq_macros INFO 12 6538 2021-07-09 12:17:10,808 daq_macros INFO 13 6659 2021-07-09 12:17:10,809 daq_macros INFO 14 6601 .....

I have fixed the bug for summing, so hopefully will get a chance to test this later today.

I suspect the exception is being shown as coming from daq_main_common because it is the first place where the exceptions are caught and logged. I also have tended to only show the messages and not the entire stack trace.

JunAishima commented 3 years ago

Looks like that simple fix (doing sum correctly) made the scan work. so nothing to do with bluesky and ophyd.

There is an exception at the end for "chooch not found" - so there may be an issue with setting up environment and from what Martin was just saying, CCP4.

JunAishima commented 3 years ago

downstream issue of broken chooch partly fixed by correcting PATH (also putting ccp4 at place indicated in PATH): https://github.com/NSLS-II/lsdc/commit/7659e2f4e4f68e14f7879825036d710726597bde