cohere_ui¶
cohere_gui¶
This script provides GUI interface to cohere tools. User can create new cohere experiment or load an existing one. The GUI offers user friendly interface that allows to define configuration, set parameters to defaults, and run the scripts: beamline_preprocessing, standard_preprocessing, run_rec, and beamline_visualization, with push buttons.
To run this script from command line:
cohere_gui
optional arguments may follow: --no_verify, --debug
Use --help to get explanation of command line parameters.
beamline_preprocess¶
This script reads raw data, applies correction related to instrument, aligns multiple scans data if applicable, and saves the preprocessed data in cohere experiment space in the preprocessed_data subdirectory. User can control some elements of the preprocess, like cropping area around maximum intensity, or accepting only scans with set number of frames, removing outliers. The configuration parameters are described in config_prep.
It is designed to support different beamlines that may use different file format and different instrument. The specifics are obtained from beamline instrument implementations. The configuration of instrument is define by beamline. Refer to config_instr for definitions of these parameters.
To run this script from command line:
beamline_preprocess <experiment_dir>
optional argument may follow: --no_verify
One can use --help to get explanation of command line parameters.
standard_preprocess¶
This script reads all instrument corrected data instances found in the cohere experiment space. The data is then preprocessed for phasing by calling the standard_preprocessing api from the cohere_core package. Refer to config_data for definition of parameters that direct the processing.
The steps implemented in standard_preprocessing: removing aliens, removing noise, applying sqrt, cropping and padding, centering, and binning.
To run this script from command line:
standard_preprocess <experiment_dir>
optional argument may follow: --no_verify
One can use --help to get explanation of command line parameters.
cohere_reconstruction¶
This script manages reconstruction(s). Depending on configuration it starts either single reconstruction, GA, or multiple reconstructions. In multiple reconstruction scenario or separate scans the script runs parallel execution. Refer to config_rec for definitions of these parameters.
The reconstruction can run on GPUs, which has very good performance, or on CPU. The hardware is defined in the configuration file by a package that must be installed. Cohere supports cupy and torch GPU processing, and numpy processing on CPU.
To run this script from command line:
run_reconstruction <experiment_dir>
optional argument may follow: --no_verify, --rec_id <rec_id> --debug
One can use --help to get explanation of command line parameters.
beamline_postprocess¶
This script reads phasing result image file(s) and applies postprocessing as defined in config_disp file. Refer to config_disp for definition of parameters that direct the processing. The outcome is a collection of files in vti and vtk formats that can be visualized with Paraview.
To deliver the files for visualization the program calculates geometry that depends on parameters in config_instr file that differ for beamlines. Refer to config_instr for definitions of these parameters by beamline. The parameters are metadata, however for some beamlines some parameters have to be configured.
The script will generate image of the reconstructed object in direct space in vts format. In addition, through configuration user can request twin image, unwrapped phase, interpolation, resolution, and reciprocal space view.
To run this script from command line:
beamline_visualization <experiment_dir>
optional argument may follow: --no_verify
One can use --help to get explanation of command line parameters.
cohere_full¶
This user script invokes in sequence all scripts needed to visualize reconstructed data from raw data: beamline_preprocess, standard_preprocess, run_reconstruction, beamline_visualization. This script uses configuration parameters from the cohere experiment configuration files.
To run this script from command line:
everything <experiment_dir> --rec_id <rec_id>
optional argument may follow: --no_verify, --rec_id, --debug
One can use --help to get explanation of command line parameters.
simple_phasing¶
This script executes reconstruction of provided data in tiff or npy formats. The data can be preprocessed by any package, not necessarily cohere.
This script does not use cohere experiment framework. It simply calls the reconstruction process from cohere_core package on the provided data. The basic parameters are hardcoded in the script. User can copy the script and modify the parameters if needed.
The results, like reconstructed image, support, errors, and metrics are saved by default in 'results' directory.
To run this script from command line:
simple_phasing <data_file>
optional argument may follow: --debug
One can use --help to get explanation of command line parameters.
create_aps34idc_experiment¶
This user script create a new cohere experiment directory space.
The experiment directory will contain "conf" subdirectory with configuration files. The initial configuration files contain all parameters, but most of them are commented out to clock the functionality.
To run this script from command line:
create_aps34idc_experiment <id> <scan_no> <working_dir> --specfile <specfile>
One can use --help to get explanation of command line parameters.
copy_setup¶
This script is used to create a cohere experiment directory structure with predefined configuration files. The main configuration file is created and the other files are copied into the newly created experiment space.
This script is typically used to create an initial cohere experiment after data collection.
To run this script from command line:
copy_setup <id> <scan_no> <conf_dir> --specfile <specfile> --copy_prep
One can use --help to get explanation of command line parameters.