Define scan frame#

The Scan setup frame is a graphical interface to configure the ScanContext which holds information about the scan setup.

The frame only holds the configuration widgets for its Parameters as well as some buttons for convenience functionality.

../../../_images/overview1.png

Control buttons#

Import scan settings#

../../../_images/import.png

The Scan settings can be imported from files written by pydidas. Clicking the corresponding button will open a selection dialogue to pick the file with the stored settings. File extensions will be pre-selected based on the available importers.

Import scan settings from beamline metadata files#

../../../_images/import_bl_file.png

A second option for importing scan settings is to use beamline metadata files. These files are created by beamline software and contain information about the scan setup. The button will open a file selection dialogue to pick the file with the stored settings. File extensions will be pre-selected based on the available importers.

If you are unsure how to proceed for your specific beamline metadata files, please discuss with your local beamline support.

If you are missing a specific beamline metadata importer, please contact the development team by raising a GitHub issue.

Reset Parameters#

../../../_images/reset.png

The “Reset all scan settings” button allows the user to change all Parameters back to their default values.

Export scan settings#

../../../_images/export1.png

At the bottom of the Frame, the export button allows users to export the current ScanContext Parameters to a file. This button will open a filename dialogue.

Scan dimension explanation#

../../../_images/more_dim_info.png

The scan dimension explanation section gives detailed information about the ordering of scan scan dimensions. The slowest scan dimension is dimension no. 0 and the fastest is the last scan dimension. This ordering corresponds to how the scan must be performed algorithmically. The button opens a window with an in-depth explanation, including images.

Tip

The detailed explanation for the scan dimensions can be found at Explanations of Scan dimensions.

Global Parameters#

../../../_images/globals.png

Here, global refers to general scan Parameters in contrast to Parameters for a specific scan dimension. The scan dimensionality defines the number of used dimensions (and also shows or hides the corresponding widgets for the selected dimensions). The scan title is used as reference in titles and captions.

The base directory and scan name pattern are used for InputPlugins to define the raw data source. The starting index defines the number of the first data file.

For a detailed description of each Parameter, please refer to the list of ScanContext Parameters found at the bottom of this page.

Tip

The detailed explanation for the scan file naming pattern are given in Explanations of Scan file naming.

The detailed explanation for multi-frame handling are given in Explanations of Scan multi-frame handling.

Configuring a scan dimension#

Note

Following the python nomenclature, the first index is 0 (zero) and so forth.

../../../_images/dimension.png

The configuration for each scan dimension is the same, and dimension #1 is shown only exemplarily.

At the top, next to the name, are two small buttons with up and down arrows which allow to move the given scan dimension up or down in the list to change the order. Only reasonable arrows are shown, for example the first scan dimension cannot be further moved upwards.

Each scan dimension has one mandatory field which is the number of scan points. This number determines the layout of the data in pydidas. The other information is metadata which is used to determine labels and axis ranges (for plots and export metadata) but which has no further relevance. The name of the scan dimension corresponds to the label. The unit is also used to label the dimension range.

The range of each scan dimension is determined by the number of points \(N\), the step width \(\Delta x\) between two points and the offset \(x_0\). The full range is thus

\[x_0,\ x_0 + \Delta x,\ x_0 + 2 * \Delta x,\ ...,\ x_0 + (N - 1) * \Delta x.\]

List of all ScanContext Parameters#

  • scan_title (type: str, default: , unit: )

    The scan name or title. This is used exclusively for reference in result exporters.

  • scan_base_directory (type: Path, default: , unit: )

    The absolute path of the base directory in which to find this scan. Note that individual plugins may automatically discover and use subdirectories. Please refer to the specific InputPlugin in use for more information.

  • scan_name_pattern (type: Path, default: , unit: )

    The pattern used for naming scan (files). Use hashes ‘#’ for wildcards which will be filled in with numbers for the various files. Note that individual plugins may use this Parameter for either directory or file names. Please refer to the specific InputPlugin in use for more information.

  • pattern_number_offset (type: int, default: 0, unit: )

    The first number in the pattern to be used in processing. This number will be applied as offset in the scan naming pattern to identify the respective filename for scan points. For example, if the first file is named scan_0001.h5, the offset should be set to 1.

  • pattern_number_delta (type: int, default: 1, unit: )

    The difference in the index between two consecutive pattern points. A value of 1 would mean that each index is processed in the pattern whereas a value of n would mean that only every n-th index (e.g. filename) is processed.For example, a value of 3 would process the files with the names scan_0000.h5, scan_0003.h5, scan_0006.h5 etc.

  • frame_indices_per_scan_point (type: int, default: 1, unit: )

    The number of frame indices (in frames) between two scan points. A value of 1 would increment the image index by 1 for each scan point whereas a value of n corresponds to only using every n-th index. For example, a value of 3 frame indices per scan point process the frame 0 for scan point 0, frame 3 for scan point 1 etc.Please note that the index stepping refers to the frames, not the filenames. In the case of container files (e.g. hdf5), the index stepping will skip process every n-th frame, not every n-th file.

  • scan_multi_frame_handling (type: str, default: Average, unit: )

    Define the handling of images if multiple images were acquired per scan point. If all individual images should be kept, please set the scan multiplicity to 1 and add an additional dimension with the multiplicity to the scan.

  • scan_frames_per_point (type: int, default: 1, unit: )

    The number of frames to process at each scan point. The default of 1 corresponds to one image per scan point. Please note that the value for the points. If this setting is used for averaging images, please reduce the number of scan points correspondingly.

The following Parameters exist for each scan dimension, i.e. scan_dim{i}_label stands for scan_dim0_label, scan_dim1_label, scan_dim2_label, scan_dim3_label. For clarity, only the generic form is described here.

  • scan_dim{i}_label (type: str, default: “”)

    The axis name for scan direction {i}. This information will only be used for labelling.

  • scan_dim{i}_n_points (type: int, default: 0)

    The number of scan points in scan direction {i}.

  • scan_dim{i}_delta (type: float, default: 1)

    The step width between two scan points in scan direction {i}.

  • scan_dim{i}_offset (type: float, default: 0)

    The coordinate offset of the movement in scan direction {i} (i.e. the counter / motor position for scan step #0).

  • scan_dim{i}_unit (type: str, default: “”)

    The unit of the movement / steps / offset in scan direction {i}.