tomoscan.tomoscan_stream_32id

Software for tomography stream scanning with EPICS at APS beamline 2-BM

This class support tomoStream by providing:

  • Dark-flat field image PVs broadcasting
    Dark-flat field images are broadcasted using PVaccess. Dark-flat field images are also saved in a temporary hdf5 file that are re-written whenever new flat/dark fields are acquired. Acquisition of dark and flat fields is performed without stopping rotation of the stage. Dark-flat field images can also be binned setting the binning parameter in ROI1 plugin.
  • On-demand capturing to an hdf5 file
    The capturing/saving to an hdf5 file can be done on-demand by pressing the Capture proj button in the Stream MEDM control screen. Whenever capturing is done, dark/flat fields from the temporarily hdf5 file are added to the file containing the projections and the experimental meta data. In addition, the circular buffer plugin (CB1) of AreaDetector is used to store a set of projections acquired before capturing is started. This allows to save projections containing information about the sample right before a sample change is detected. Data from the circular buffer is also added to the hdf5 after capturing is done. The resulting hdf5 file has the same format as in regular single tomoscan file.

Classes

TomoScanStream32ID

Derived class for tomography scanning in streaming mode with EPICS at APS beamline 32-ID

Functions:

tomoscan.tomoscan_stream_32id

exception tomoscan.tomoscan_stream_32id.SampleXError[source]

Bases: Exception

Exception raised when SampleX is not equal to SampleInX

class tomoscan.tomoscan_stream_32id.TomoScanStream32ID(pv_files, macros)[source]

Bases: TomoScanStreamPSO

Derived class used for tomography scanning in streamaing mode with EPICS at APS beamline 2-BM

Parameters
  • pv_files (list of str) – List of files containing EPICS pvNames to be used.

  • macros (dict) – Dictionary of macro definitions to be substituted when reading the pv_files

begin_scan()[source]

Performs the operations needed at the very start of a scan.

This does the following:

  • Set data directory.

  • Calls the base class method.

  • Opens the front-end shutter.

  • Sets the PSO controller.

  • Creates theta array using list from PSO.

close_frontend_shutter()[source]

Closes the shutters to collect dark fields. This does the following:

  • Closes the 32-ID-C front-end shutter.

close_shutter()[source]

Closes the shutters to collect dark fields. This does the following:

  • Closes the 32-ID-C fast shutter.

end_scan()[source]

Performs the operations needed at the very end of a scan.

This does the following: - Calls save_configuration(). - Put the camera back in “FreeRun” mode and acquiring so the user sees live images.

  • Sets the speed of the rotation stage back to the maximum value.

  • Calls move_sample_in().

  • Calls the base class method.

  • Closes shutter.

fly_scan()[source]

Control of Sample X position

open_frontend_shutter()[source]

Opens the shutters to collect flat fields or projections.

This does the following:

  • Checks if we are in testing mode. If we are, do nothing else opens the 2-BM-A front-end shutter.

open_shutter()[source]

Opens the shutters to collect flat fields or projections.

This does the following:

  • Opens the 32-ID-C fast shutter.

set_trigger_mode(trigger_mode, num_images)[source]

Sets the trigger mode SIS3820 and the camera.

Parameters
  • trigger_mode (str) – Choices are: “FreeRun”, “Internal”, or “PSOExternal”

  • num_images (int) – Number of images to collect. Ignored if trigger_mode=”FreeRun”. This is used to set the NumImages PV of the camera.

set_trigger_mode_grasshopper(trigger_mode, num_images)[source]
wait_frontend_shutter_open(timeout=-1)[source]

Waits for the front end shutter to open, or for abort_scan() to be called.

While waiting this method periodically tries to open the shutter..

Parameters

timeout (float) – The maximum number of seconds to wait before raising a ShutterTimeoutError exception.

Raises
  • ScanAbortError – If abort_scan() is called

  • ShutterTimeoutError – If the open shutter has not completed within timeout value.

wait_pv(epics_pv, wait_val, timeout=-1)[source]

Wait on a pv to be a value until max_timeout (default forever) delay for pv to change