tomoscan.tomoscan_stream_2bm

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

TomoScanStream2BM

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

Functions:

tomoscan.tomoscan_stream_2bm

class tomoscan.tomoscan_stream_2bm.TomoScanStream2BM(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.

  • Set the TomoScan xml files

  • 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 2-BM front-end shutter.

close_shutter()[source]

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

  • Closes the 2-BM fast shutter.

end_scan()[source]

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

  • clears callback for lens change

  • call end_scan from super

  • close shutter

lens_change_sync()[source]

Save/Update dark and flat fields for lenses. This way we dont always need to retake flat fields when the lens is changed

  • copy dark and flat fields for the current lens to dark_fields_<lens_cur>.h5, flat_fields_<lens_cur>.h5

  • copy dark and flat fields for the new lens from dark_fields_<lens_new>.h5, flat_fields_<lens_new>.h5 to dark_fields.h5, flat_fields.h5

  • broadcast flat and dark

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 2-BM-A fast shutter.

pv_callback_stream_2bm(pvname=None, value=None, char_value=None, **kw)[source]

Callback functions for lens and camera change

reinit_camera()[source]

Init camera PVs based on the mctOptics selection.

Parameters

camera (int, optional) – The camera to use. Optique Peter system support 2 cameras

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_adimec(trigger_mode, num_images)[source]
set_trigger_mode_grasshopper(trigger_mode, num_images)[source]
set_trigger_mode_oryx(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