providing / searching a list of scan#
For now to search scan only the following options exists:
data listener: when a bliss scan is acquired)
scan discovery: allow research of a scan (bliss - nxtomo - edf) with some possible filtering
scan watcher: same as the scan discovery but retriggering discovery each n seconds until stopped by the user.
But has those search could still be lilited according to your use cases here are two possible ‘workaround’.
Get input as a list of file#
The first one is to have the list of files (or folder in the case of EDF) you want to treat as text, separated by a n or ;. You can for example obtain this list by a
# here for example we want to list all the .nx (nxtomo) for a specific proposal
ls -d /data/visitor/es1303/id19/20230713/PROCESSED_DATA/*/*/*.nx
At the end the output will look like:
/data/visitor/es1303/id19/20230713/PROCESSED_DATA/test_TUBS-M/test_TUBS-M_nominal_700_degree/test_TUBS-M_nominal_700_degree_0000.nx
/data/visitor/es1303/id19/20230713/PROCESSED_DATA/test_TUBS-M/test_TUBS-M_nominal_700_degree/test_TUBS-M_nominal_700_degree_0001.nx
/data/visitor/es1303/id19/20230713/PROCESSED_DATA/test_TUBS-M/test_TUBS-M_nominal_700_degree/test_TUBS-M_nominal_700_degree_0002.nx
/data/visitor/es1303/id19/20230713/PROCESSED_DATA/test_TUBS-M/test_TUBS-M_nominal_700_degree/test_TUBS-M_nominal_700_degree_0003.nx
...
Then you can copy this list to clipboard and paste it to one of the ‘list’ widget from a right-clik ‘copy’ (scan list, scan selector, nxtomomill converters…) - since version 1.2
Get it from a Python script and us the ‘hub’ widget#
The second option is to create a list of “TomwerScanBase” instances (NXtomoScan in most of the case) and send it to the workflow.
Here is an example of python code browsing for a file pattern and creating scans from discovered files:
from glob import glob
from tomwer.core.scan.scanfactory import ScanFactory
scans = []
# create tomwer scans by browsing input file
for file_path in glob("/data/visitor/es1303/id19/20230713/PROCESSED_DATA/*/*/*.nx"):
scans.extend(ScanFactory.create_scan_objects(file_path))
# this will trigger a list of scans
out_tomo_objs = scans
Note
in the following examples we are producing a list of scans (as tomo objs). Most of the widgets expect a single scan / tomo obj as input. To split the list you can use the ‘tomo objs hub - in ‘other’ section like: