Open ambarb opened 3 years ago
Please join in the discussion on how to fix, but more importantly, the ultimate location of the extraction function for common use.
Do we want to return a named tuple? Cannot return pandas because some arrays are 3D
note to self or others new to this library. don't name a list of exlcuded_keys "get_avg_img" because this is a function in standard pyCHX imports to calculate the average images (which I guess is what generated the array found in the pyCHX results file.
https://github.com/NSLS-II/pyCHX/blob/6ae02935814caa0ca1efe413bc480a74c4c8fb94/pyCHX/Create_Report.py#L1826 Using this function with default arguments to extract data. Works well, but so much data takes a long time. I tried to speed up by only asking for what I want. I tried the follow:
excluded_keys
this is the best hack around accessing just 1 key so you are not pulling all 2-time and roi intensity with time data if you just want an average image or g2b and tb. Did notice, that accessing 2time data (
g12b
) is only 2 seconds on the server, but the gateway must be bogging down the communication to the notebook.onekey
tried
onekey = 'md'
,onekey = 'g12b'
,onekey = 'avg_img'
,onekey = 'imgsum'
and all behaved the same way.It seems that https://github.com/NSLS-II/pyCHX/blob/6ae02935814caa0ca1efe413bc480a74c4c8fb94/pyCHX/v2/_futurepyCHX/Create_Report.py#L2192 tried to implement the approach i used in my own editing of the function.
For my own function, the change i made doesn't seem to help though it seems to me to be exactly what was done in the debug function for the 'onekey' not None block. The debug function cannot extract
md
org12b
. Didn't try others.For the the "_debug" version, not applying any extra arguments, there is an error so it seems this is also a work in progress. This is with default
excluded_keys
anddefault onekey