Search exposures recursively via CLI

Hi everyone,

I am trying to work with CryoSPARC Live Session following the official guide. The guide is super useful, but I cannot find how to set the live session to look for exposures recursively. There is a switch in the interface of CryoSPARC Live Session - “Search Recursively”, but I can’t find how to set it via the CLI. There is a method exposure_group_update_value to set up session’s exposure group parameters, but I can’t find anywhere the name of the setting for this “Search Recursively” feature.

That is how the guide suggests to set up session’s exposure group parameters:

file_engine_watch_path_abs = '/data/EMPIAR/10025/data/14sep05c_raw_196/'
file_engine_filter = '*.frames.mrc'
gainref_path = '/data/EMPIAR/10025/data/14sep05c_raw_196/norm-amibox05-0.mrc'

rtp.exposure_group_update_value(project_uid=project_uid, session_uid=session_uid, exp_group_id=1, name='file_engine_watch_path_abs', value=file_engine_watch_path_abs)
rtp.exposure_group_update_value(project_uid=project_uid, session_uid=session_uid, exp_group_id=1, name='file_engine_filter', value=file_engine_filter)
rtp.exposure_group_update_value(project_uid=project_uid, session_uid=session_uid, exp_group_id=1, name='gainref_path', value=gainref_path)

rtp.exposure_group_finalize_and_enable(project_uid=project_uid, session_uid=session_uid, exp_group_id=1)

and it actually works, except that I have exposures in many different sub directories, which CryoSPARC ignores since I can’t find a way to set “Search Recursively” programmatically.

I have even tried to get the description of all available methods from the server via system.describe, but documentation of exposure_group_update_value says nothing valuable unfortunately:

{'idempotent': False,
 'name': 'exposure_group_update_value',
 'params': [],
 'return': {'type': 'any'},
 'summary': None
},

The version of CryoSPARC is 4.2.1

Hi @Aleksandr,

Apologies for the confusion!
The name of the key you’re looking for is: file_engine_recursive (boolean)
You can set it like so:
rtp.exposure_group_update_value(project_uid=project_uid, session_uid=session_uid, exp_group_id=1, name='file_engine_recursive', value=True)

Here is the full list of keys in each exposure group:

'exp_group_id'
'gainref_path'
'defect_path'
'num_exposures_found'
'num_exposures_ready'
'file_engine_watch_path_abs'
'file_engine_strategy'
'file_engine_recursive'
'file_engine_filter'
'file_engine_interval'
'file_engine_enable'
'ignore_exposures'
'final'
'file_engine_min_file_size'
'file_engine_min_modified_time_delta'

Note that only the following keys can be changed when the exposure group is “final”:

'final'
'file_engine_enable'
'ignore_exposures'
'file_engine_min_file_size'
'file_engine_min_modified_time_delta'
1 Like

@stephan thank you, it works :blush:

Can the documentation be updated to describe each keyword, allowed values?