Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extracting onekey from pyCHX results file returns an empty dictionary #68

Open
ambarb opened this issue Jun 21, 2021 · 3 comments
Open
Labels
bug discussion V1 V2 required to move towards share XPCS/speckle analysis for CHX/CSX

Comments

@ambarb
Copy link
Collaborator

ambarb commented Jun 21, 2021

def extract_xpcs_results_from_h5( filename, import_dir, onekey=None, exclude_keys=None, two_time_qindex = None ):

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:

  • onekey argument
  • excluded_keys argument

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

def extract_xpcs_results_from_h5_debug(
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 or g12b. 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 and default onekey

----> 2 total_res = load_data_from_pipeline_onekey(uid,)# onekey_s = 'md')#onekey='g12b')

/XF11ID/analysis/2018_3/lwiegart/development/Auto_Analysis_Functions_dev1.py in load_data_from_pipeline_onekey(uid, onekey_s)
    29                 #print('also tried: '+inDir+'uid=%s_Res.h5'%uid_full)
    30                 input_filename='uid=%s_Res.h5'%uid_full
---> 31                 total_res[u] = extract_xpcs_results_from_h5_debug( filename = 'uid=%s__Res.h5'%uid_full, import_dir = inDir,exclude_keys=exclude_keys, onekey = onekey_s )
    32 
    33         #total_res[uid] = extract_xpcs_results_from_h5( filename = 'uid=%s_phi_Res.h5'%uid_full, import_dir = inDir+ uid + '/' )

/XF11ID/analysis/2018_3/lwiegart/development/Auto_Analysis_Functions_dev1.py in extract_xpcs_results_from_h5_debug(filename, import_dir, onekey, exclude_keys)
    29                 if key not in exclude_keys:
    30                     if key in dicts:
---> 31                         extract_dict[key] = recursively_load_dict_contents_from_group(
    32                             hf, "/" + key + "/"
    33                         )

NameError: name 'recursively_load_dict_contents_from_group' is not defined
@ambarb ambarb added bug discussion V1 V2 required to move towards share XPCS/speckle analysis for CHX/CSX labels Jun 21, 2021
@ambarb
Copy link
Collaborator Author

ambarb commented Jun 21, 2021

Please join in the discussion on how to fix, but more importantly, the ultimate location of the extraction function for common use.

@ambarb
Copy link
Collaborator Author

ambarb commented Jun 21, 2021

Do we want to return a named tuple? Cannot return pandas because some arrays are 3D

@ambarb
Copy link
Collaborator Author

ambarb commented Jun 21, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug discussion V1 V2 required to move towards share XPCS/speckle analysis for CHX/CSX
Projects
None yet
Development

No branches or pull requests

1 participant