From 637c779093b652ab7967deabc0f62210e34826de Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Wed, 15 Oct 2025 14:04:55 +0200 Subject: [PATCH] update worker/accumulator help output; remove random whitespaces --- README.md | 57 ++++++++++++++++++++++++------------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 580dd62..6d56609 100644 --- a/README.md +++ b/README.md @@ -41,28 +41,24 @@ Each worker runs independently and processes frames received via ZeroMQ. Before Input parameters: ```bash python dap/worker.py --help -usage: worker.py [-h] [--backend BACKEND] [--accumulator ACCUMULATOR] - [--accumulator_port ACCUMULATOR_PORT] - [--visualisation VISUALISATION] - [--visualisation_port VISUALISATION_PORT] - [--peakfinder_parameters PEAKFINDER_PARAMETERS] - [--skip_frames_rate SKIP_FRAMES_RATE] +usage: worker.py [-h] --backend_host BACKEND_HOST --backend_port BACKEND_PORT + [--accumulator_host ACCUMULATOR_HOST] [--accumulator_port ACCUMULATOR_PORT] + [--visualisation_host VISUALISATION_HOST] [--visualisation_port VISUALISATION_PORT] + [--peakfinder_parameters PEAKFINDER_PARAMETERS] [--skip_frames_rate SKIP_FRAMES_RATE] -options: +optional arguments: -h, --help show this help message and exit - --backend BACKEND backend address - --accumulator ACCUMULATOR - name of host where accumulator works + --backend_host BACKEND_HOST + --backend_port BACKEND_PORT + --accumulator_host ACCUMULATOR_HOST --accumulator_port ACCUMULATOR_PORT - accumulator port - --visualisation VISUALISATION - name of host where visualisation works + --visualisation_host VISUALISATION_HOST --visualisation_port VISUALISATION_PORT - visualisation port --peakfinder_parameters PEAKFINDER_PARAMETERS json file with peakfinder parameters --skip_frames_rate SKIP_FRAMES_RATE - send to streamvis each of skip_frames_rate frames + skip (approximately) skip_frames_rate % of pulses + ``` The number of required workers varies based on detector size and algorithm complexity. @@ -75,15 +71,12 @@ The accumulator collects results from workers due to network constraints, tempor Input parameters: ```bash python dap/accumulator.py --help -usage: accumulator.py [-h] [--accumulator ACCUMULATOR] - [--accumulator_port ACCUMULATOR_PORT] +usage: accumulator.py [-h] [--accumulator_host ACCUMULATOR_HOST] [--accumulator_port ACCUMULATOR_PORT] -options: +optional arguments: -h, --help show this help message and exit - --accumulator ACCUMULATOR - name of host where accumulator works + --accumulator_host ACCUMULATOR_HOST --accumulator_port ACCUMULATOR_PORT - accumulator port ``` # Implemented algorithms @@ -118,16 +111,16 @@ options: * `'cbd_mask_data_file': str` - [optional] hdf5 data file containing pre-calculated mask. * `'cbd_mask_dataset': str` - [optional] dataset containing pre-calculated mask, defaults to `'entry/instrument/detector/mask'`. * `'cbd_scale_whitefield': 1/0` - Specifies whether to scale whitefield to signal, useful if intensity jumps. - + * `'do_streakfinder_analysis': 1/0` - Specifies whether to execute the streak-finder algorithm. * `'cbd_peak_structure_radius': int` - Connectivity structure radius for *peaks* detection. - * `'cbd_peak_structure_rank': int` - Connectivity structure rank for *peaks* detection. + * `'cbd_peak_structure_rank': int` - Connectivity structure rank for *peaks* detection. * `'cbd_peak_vmin': float` - Peak threshold. All peaks with values lower than ``cbd_peak_vmin`` are discarded. * `'cbd_npts': int` - Support size threshold. The support structure is a connected set of pixels which value is above the threshold ``cbd_peak_vmin``. A peak is discarded is the size of support set is lower than ``cbd_npts``. * `'cbd_streak_structure_radius': int` - Connectivity structure radius for *streaks* detection. - * `'cbd_streak_structure_rank': int` - Connectivity structure rank for *streaks* detection. + * `'cbd_streak_structure_rank': int` - Connectivity structure rank for *streaks* detection. * `'cbd_streak_vmin': float` - Streak threshold. All streaks with values lower than ``cbd_vmin`` are discarded. * `'cbd_min_size': float` - Minimum number of linelets required in a detected streak. * `'cbd_xtol': float` - Distance threshold. A new linelet is added to a streak if it's distance to the @@ -135,7 +128,7 @@ options: * `'cbd_nfa': 1` - Number of false alarms, allowed number of unaligned points in a streak. * `'cbd_num_threads': int` - Number of threads to use for peak finder algorithm. * `'cbd_negative_handler': 'mask'/'zero'/'shift'/''` - [optional] Method to handle negative values in converted frames, defaults to `''` (do not handle). - * `'cbd_min_hit_streaks': int` - [optional] Minimum number of discovered streaks to categorize frame as a hit, defaults to 5. + * `'cbd_min_hit_streaks': int` - [optional] Minimum number of discovered streaks to categorize frame as a hit, defaults to 5. * `'cbd_mask_rois': list[(int, int, int, int)]` - [optional] list of `(x_min, x_max, y_min, y_max)` coordinates of ROIs to mask out during peak finding. * `'cbd_crop_roi': [int, int, int, int]` - [optional] run streak finder on a cropped image, e.g. one quadrant, for purpose of spedup. * `'cbd_lookahead': int` - [optional] Number of linelets considered at the ends of a streak to be added to the streak. @@ -249,7 +242,7 @@ options: * `'mask_dataset': str` [Optional] - Name of the dataset containing mask in the hdf5 file, default is `"mask_data"`. Algorithm Output: * `'mask_from_file_applied': 1/0` - Indicates whether the algorithm ran successfully. - + * **Filter based on pulse picker information** If the event propagation capability is accessible for the detector and the pulse picker information is correctly configured for propagation, the filtration based on pulse picker information becomes feasible by using the @@ -317,17 +310,17 @@ Example JSON for Convergent-Beam Diffraction Streak-Finder: "roi_y2": [], "": 1, "mask_file": "/sf/jungfrau/config/additional_mask/JF07T32V02.h5", - "mask_dataset": "mask_data", + "mask_dataset": "mask_data", "do_snr": 0, "cbd_std_data_file": "/sf/instrument/exp/00m_mustermann/res/aux_data/streakfinder_metadata.h5", - "cbd_std_dataset": "entry/crystallography/std", + "cbd_std_dataset": "entry/crystallography/std", "cbd_whitefield_data_file": "/sf/bernina/exp/00m_mustermann/res/aux_data/streakfinder_metadata.h5", - "cbd_whitefield_dataset": "entry/crystallography/whitefield", + "cbd_whitefield_dataset": "entry/crystallography/whitefield", "cbd_mask_data_file": "/sf/bernina/exp/00m_mustermann/res/aux_data/JF_mask.h5", - "cbd_mask_dataset": "mask_data", + "cbd_mask_dataset": "mask_data", "cbd_scale_whitefield": 0, "do_streakfinder_analysis": 1, - "cbd_negative_handler": "zero", + "cbd_negative_handler": "zero", "cbd_peak_structure_radius": 2, "cbd_peak_structure_rank": 2, "cbd_peak_vmin": 50, @@ -339,7 +332,7 @@ Example JSON for Convergent-Beam Diffraction Streak-Finder: "cbd_min_size": 25, "cbd_nfa": 1, "cbd_num_threads": 32, - "cbd_crop_roi": [0, 2107, 0, 2216] + "cbd_crop_roi": [0, 2107, 0, 2216] } ``` # Acknowledgment