### Install Tomoscan Library Source: https://github.com/tomography/tomoscan/blob/master/docs/source/usage.md Install the tomoscan library by navigating to its source directory and running the setup script. This enables the tomoscan command-line interface. ```bash cd ~/epics/synApps/support/tomoscan/ python setup.py install ``` -------------------------------- ### Running a Vertical Scan with tomoscan-cli Source: https://github.com/tomography/tomoscan/blob/master/docs/source/demo.md This example demonstrates how to run a vertical tomography scan with specific start, step, and points parameters using the tomoscan-cli. It also shows the expected log output during the scan. ```bash $ tomoscan vertical --vertical-start 0 --vertical-step-size 0.1 --vertical-steps 2 2020-05-29 16:54:03,354 - vertical scan start 2020-05-29 16:54:03,356 - vertical positions (mm): [0. 0.1] 2020-05-29 16:54:03,358 - SampleInY stage start position: 0.000 mm 2020-05-29 16:54:03,362 - single scan start 2020-05-29 16:54:51,653 - single scan time: 0.805 minutes 2020-05-29 16:54:51,654 - SampleInY stage start position: 0.100 mm 2020-05-29 16:54:51,658 - single scan start 2020-05-29 16:55:47,607 - single scan time: 0.932 minutes 2020-05-29 16:55:47,607 - vertical scan time: 1.738 minutes 2020-05-29 16:55:47,608 - vertical scan end ``` -------------------------------- ### Build and Install Support Modules Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Commands to update the release file and build all support modules after configuration changes. ```bash $ cd ~/epics-ts/synApps/support $ make release $ make -sj ``` -------------------------------- ### begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_pso.md Performs the initial setup for a tomography scan, including motor speed, position computation, PSO driver programming, and initiating streaming. ```APIDOC ## begin_scan() ### Description Performs the operations needed at the very start of a scan. This includes setting the rotation motor speed, computing scan positions, programming the Aerotech driver for PSO pulses, and beginning the data stream. ### Method This is a method of the `TomoScanStreamPSO` class. ``` -------------------------------- ### Running the Python Tomography Scan Demo Source: https://github.com/tomography/tomoscan/blob/master/docs/source/demo.md This example shows how to execute the `scan_demo` Python function and its expected output, demonstrating a scan of an EPICS motor PV. ```python >>> from scan_demo import scan_demo >>> scan_demo('13BMDPG1:TS:', .01, '13BMD:m90', 5, 1, 5) Completed dataset T:\tomo_user\2020\Run1\Test\Test_R_001.h5 Completed dataset T:\tomo_user\2020\Run1\Test\Test_R_002.h5 Completed dataset T:\tomo_user\2020\Run1\Test\Test_R_003.h5 Completed dataset T:\tomo_user\2020\Run1\Test\Test_R_004.h5 Completed dataset T:\tomo_user\2020\Run1\Test\Test_R_005.h5 ``` -------------------------------- ### Install Tomoscan Python Library Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Installs the Tomoscan Python package as a library after creating beamline-specific Python classes. ```bash $ cd ~/epics-ts/synApps/support/tomoscan/ $ conda activate tomoscan $ pip install . ``` -------------------------------- ### Tomoscan CLI Help Source: https://github.com/tomography/tomoscan/blob/master/docs/source/usage.md Display general help for the tomoscan CLI, showing available commands and global options. Use this to get an overview of the CLI's capabilities. ```bash tomoscan -h ``` -------------------------------- ### begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_32id.md Performs the operations needed at the very start of a scan, including setting the data directory, opening the front-end shutter, setting the PSO controller, and creating the theta array. ```APIDOC ## begin_scan() ### Description 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. ``` -------------------------------- ### Run assemble_synApps Script Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Execute the assemble_synApps.sh script to build a minimal synApps installation, specifying the output directory and EPICS base path. ```default $ ./assemble_synApps.sh --dir=synApps --base=/home/beams/FAST/epics-ts/epics-base ``` -------------------------------- ### Start EPICS IOC and MEDM Screen Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Commands to start the EPICS IOC and associated MEDM screen for Tomoscan. Ensure you are in the correct directory. ```bash $ cd ~/epics-ts/synApps/support/tomoscan/iocBoot/iocTomoScan_13BM_PSO $ start_IOC $ start_medm ``` -------------------------------- ### begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_step.md Performs the operations needed at the very start of a scan. This includes calling the base class method and setting the HDF plugin. ```APIDOC ## begin_scan() ### Description Performs the operations needed at the very start of a scan. This does the following: - Calls the base class method. - Set the HDF plugin. ``` -------------------------------- ### Install Tomoscan Python Package Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Installs the Tomoscan package using pip after setting up the conda environment and requirements. ```bash $ cd ~/epics-ts/synApps/support/tomoscan $ pip install . $ cd ~/epics-ts/synApps/support/tomoscan/iocBoot/iocTomoScan_13BM_PSO/ $ python -i start_tomoscan.py ``` -------------------------------- ### Basic tomoscan-cli Command Source: https://github.com/tomography/tomoscan/blob/master/docs/source/demo.md This command initiates a single tomography scan using the tomoscan-cli. It's the simplest way to start a scan with the tool. ```bash $ tomoscan single ``` -------------------------------- ### begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_pso.md Performs the operations needed at the very start of a scan, including setting motor speed, computing positions, and programming the Aerotech driver for pulses. ```APIDOC ## begin_scan() ### Description Performs the operations needed at the very start of a scan. This does the following: - Calls the base class method. - Sets the speed of the rotation motor - Computes the delta theta, start and stop motor positions for the scan - Programs the Aerotech driver to provide pulses at the right positions ``` -------------------------------- ### Busy Record for Start Scan Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan.template.md Manages the 'Start Scan' process, with states for 'Done' and 'Acquire'. ```EPICS record(busy,"$(P)$(R)StartScan") { field(ZNAM,"Done") field(ZSV, "NO_ALARM") field(ONAM,"Acquire") field(OSV, "MINOR") field(VAL, "0") } ``` -------------------------------- ### Navigate to IOC Boot Directory Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Changes the current directory to the IOC boot directory. ```bash $ cd ~/epics-ts/synApps/support/tomoscan/iocBoot/ ``` -------------------------------- ### collect_projections() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_pso.md Collects projections in fly scan mode, including taxiing to start, setting camera trigger mode, moving to end, computing motor speed, and starting PSO capture. ```APIDOC ## collect_projections() ### Description Collects projections in fly scan mode. This does the following: - Call the superclass collect_projections() function - Taxi to the start position - Set the trigger mode on the camera - Move the stage to the end position - Computes and sets the speed of the rotation motor so that it reaches the next projection angle just after the current exposure and readout are complete. - These will be used by the PSO to calculate the Taxi distance and rotary stage acceleration. - Starts the file plugin capturing in stream mode. - Starts the camera acquiring in external trigger mode. - Starts the PSOfly. - Wait on the PSO done. ``` -------------------------------- ### Create EPICS Base Directory Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Create a directory for EPICS base and navigate into it. ```default $ mkdir ~/epics-ts $ cd epics-ts ``` -------------------------------- ### Navigate to EPICS Directory Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Navigate to the EPICS timestamp directory before building synApps. ```default $ cd ~/epics-ts ``` -------------------------------- ### Build and Compile Tomoscan Module Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Navigate to the synApps support directory and run make release followed by make -sj to build and compile the tomoscan module. ```default $ cd ~/epics-ts/synApps/support/ $ make release $ make -sj ``` -------------------------------- ### begin_stream() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_pso.md Configures streaming settings at the beginning of a scan, such as disabling static dark/flat fields, setting binning, and managing capturing status. ```APIDOC ## begin_stream() ### Description Adjusts streaming settings at the beginning of the scan. This involves setting dark/flat field modes to None, configuring binning in the ROI1 plugin, resetting capturing statuses, setting up a circular buffer, and adding callbacks for capturing size changes. ### Method This is a method of the `TomoScanStreamPSO` class. ``` -------------------------------- ### Control Outlets via HTTP Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_2bm.md Demonstrates powering outlets on/off and checking their status using the NetBooter_Control class over an HTTP connection. ```python NetBooter.power_on(2) #Return (True,'') for set Outlet 2 ON success ``` ```python NetBooter.power_off(4) #Return (True,'') for set Outlet 4 OFF success ``` ```python Outlet3_Status = NetBooter.check_outlet_status(3) #Return (True,'') for Outlet 3 is ON | (False,'') for OFF ``` -------------------------------- ### update_status Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan.md Updates scan status including images collected, images saved, elapsed time, and remaining time. It requires a start time to calculate the elapsed duration. ```APIDOC ## update_status(start_time) ### Description When called updates `ImagesCollected`, `ImagesSaved`, `ElapsedTime`, and `RemainingTime`. ### Method Not specified (assumed to be a method call within a library/SDK) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **start_time** (time) - Required - Start time to calculate elapsed time. ### Response #### Success Response * **elapsed_time** (float) - Elapsed time to be used for time out. ### Request Example ``` update_status(start_time='2023-10-27T10:00:00Z') ``` ### Response Example ```json { "elapsed_time": 120.5 } ``` ``` -------------------------------- ### TomoScan2BMSTEP.begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Initiates a new scan sequence with the TomoScan2BMSTEP device. This prepares the system for data acquisition. ```APIDOC ## TomoScan2BMSTEP.begin_scan() ### Description Initiates a new scan sequence. ### Method Not specified (likely a method call within a Python class) ### Endpoint Not applicable (Python method) ### Parameters Parameters are not detailed in the source. ### Request Example Not specified. ### Response Response details are not specified. ``` -------------------------------- ### Initialize NetBooter_Control via HTTP Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_2bm.md Instantiate the NetBooter_Control class for HTTP communication. Provide the IP address of the NetBooter device. ```python NetBooter = NetBooter_Control(mode='http',ip='192.168.1.101') ``` -------------------------------- ### TomoScan Default Substitution Configuration Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan.substitutions.md Defines the default mapping of parameters for tomoScan, including camera, file plugin, rotation, and shutter settings. This is used for standard scanning setups. ```default file "$(TOP)/db/tomoScan.template" { pattern { P, R, CAMERA, FILE_PLUGIN, ROTATION, SAMPLE_X, SAMPLE_Y, CLOSE_SHUTTER, CLOSE_VALUE, OPEN_SHUTTER, OPEN_VALUE} {13BMDPG1:, TS:, 13BMDPG1:, 13BMDPG1:HDF1:, 13BMD:m119, 13BMD:m114, 13BMD:m115, 13BMA:CloseBMDShutter.PROC, 1, 13BMA:OpenBMDShutter.PROC, 1} } ``` -------------------------------- ### Copy IOC Configuration for New Beamline Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Copies the default IOC configuration to a new directory for a specific beamline (e.g., iocTomoScan_2BM). ```bash $ mkdir ~/epics-ts/synApps/support/tomoscan/iocBoot/iocTomoScan_2BM $ cd ~/epics-ts/synApps/support/tomoscan/iocBoot/ $ cp -r iocTomoScan_13BM/* iocTomoScan_2BM/ ``` -------------------------------- ### TomoScan 13BM Substitution Configuration Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan.substitutions.md Defines the beam ready and ready value parameters for the 13BM beamline's tomoScan setup. This configuration is specific to the 13BM beamline's operational requirements. ```default file "$(TOP)/db/tomoScan_13BM.template" { pattern { P, R, BEAM_READY, READY_VALUE,} {13BMDPG1:, TS:, 13BMA:mono_pid1Locked, 1,} } ``` -------------------------------- ### Navigate to SynApps Support Directory Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Change directory to the synApps support directory after the build process. ```default $ cd synApps/support/ ``` -------------------------------- ### TomoScan 13BM PSO Substitution Configuration Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan.substitutions.md A minimal substitution configuration for the 13BM beamline's PSO setup, defining only the primary and record parameters. This is a streamlined version for specific 13BM configurations. ```default file "$(TOP)/db/tomoScan_13BM_PSO.template" { pattern { P, R} {13BMDPG1:, TS:} } ``` -------------------------------- ### Initialize NetBooter_Control via Serial Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_2bm.md Instantiate the NetBooter_Control class for serial communication. Specify the serial port to use. ```python NetBooter = NetBooter_Control(mode='serial',serial_port='COM1') ``` -------------------------------- ### Control Outlets via Serial Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_2bm.md Demonstrates powering outlets on/off and checking their status using the NetBooter_Control class over a serial connection. Note that rebooting an outlet has no return value. ```python NetBooter.power_on(1) #Return (True,'') for set Outlet 1 ON success ``` ```python NetBooter.power_off(5) #Return (True,'') for set Outlet 5 OFF success ``` ```python NetBooter.reboot(3) #No return, use NetBooter internal reboot function, don’t suggest to use it ``` ```python Outlet3_Status = NetBooter.check_outlet_status(3) #Return (True,'') for Outlet 3 is ON | (False,'') for OFF ``` -------------------------------- ### TomoScan PSO Substitution Configuration Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan.substitutions.md Configures parameters related to the PSO (Position Sensitive Output) model for tomoScan, including model, port, axis name, and encoder input. This is specifically for setups requiring PSO integration. ```default file "$(TOP)/db/tomoScan_PSO.template" { pattern { P, R, PSO_MODEL, PSO_PORT, PSO_AXIS_NAME, PSO_ENC_INPUT, PSO_ENC_PER_ROTATION} {13BMDPG1:, TS:, 1, PSO_PORT, THETA, 2, 0} } ``` -------------------------------- ### Configure Minimal SynApps Build Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Edit the assemble_synApps.sh script to include only ASYN, AUTOSAVE, and BUSY modules for a minimal synApps build. ```default $modules{'ASYN'} = 'R4-44-2'; $modules{'AUTOSAVE'} = 'R5-11'; $modules{'BUSY'} = 'R1-7-4'; ``` -------------------------------- ### Rotation Axis Configuration Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan.template.md Configure the rotation axis parameters including start angle, step, number of angles, and stop angle calculation. Uses analog output (ao), calculation (calc), long output (longout), and multi-button output (mbbo) records. ```default record(ao, "$(P)$(R)RotationStart") { field(PREC, "3") } ``` ```default record(ao, "$(P)$(R)RotationStep") { field(PREC, "3") } ``` ```default record(calc, "$(P)$(R)RotationStop") { field(INPA, "$(P)$(R)RotationStart CP") field(INPB, "$(P)$(R)RotationStep CP") field(INPC, "$(P)$(R)NumAngles CP") field(CALC, "A+B*(C-1)") field(PREC, "3") } ``` ```default record(longout, "$(P)$(R)NumAngles") { } ``` ```default record(mbbo, "$(P)$(R)ReturnRotation") { field(ZRVL, "0") field(ZRST, "No") field(ONVL, "1") field(ONST, "Yes") field(TWVL, "2") field(TWST, "Home") } ``` -------------------------------- ### Dark Field Control PVs Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan.template.md Configure parameters for dark field acquisition, including the number of dark fields, mode of acquisition (start, end, both, none), and the value to set for dark fields. Uses long output (longout), multi-button output (mbbo), and analog output (ao) records. ```default record(longout, "$(P)$(R)NumDarkFields") { } ``` ```default record(mbbo, "$(P)$(R)DarkFieldMode") { field(ZRVL, "0") field(ZRST, "Start") field(ONVL, "1") field(ONST, "End") field(TWVL, "2") field(TWST, "Both") field(THVL, "3") field(THST, "None") } ``` ```default record(ao, "$(P)$(R)DarkFieldValue") { field(PREC, "0") } ``` -------------------------------- ### Verify SynApps Support RELEASE Settings Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Verify that the EPICS_BASE and SUPPORT directories in synApps/support/tomoscan/configure/RELEASE are set correctly and that the versions for BUSY, AUTOSAVE, and ASYN are specified. ```default EPICS_BASE=/home/beams/FAST/epics-ts/epics-base SUPPORT=/home/beams/FAST/epics-ts/synApps/support ``` -------------------------------- ### TomoScan2BM Class Initialization Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_2bm.md Initializes the TomoScan2BM class with PV files and macro definitions. ```APIDOC ## class tomoscan.tomoscan_2bm.TomoScan2BM(pv_files, macros) ### Description Derived class used for tomography scanning 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 ``` -------------------------------- ### TomoScan2BM.begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Initiates a new scan sequence with the TomoScan2BM device. This prepares the system for data acquisition. ```APIDOC ## TomoScan2BM.begin_scan() ### Description Initiates a new scan sequence. ### Method Not specified (likely a method call within a Python class) ### Endpoint Not applicable (Python method) ### Parameters Parameters are not detailed in the source. ### Request Example Not specified. ### Response Response details are not specified. ``` -------------------------------- ### Sample Information PVs Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan_13BM.template.md Configures PVs to store sample metadata, including name and up to three description fields. ```EPICS record(stringout, "$(P)$(R)SampleName") { field(VAL, "Unknown") } record(stringout, "$(P)$(R)SampleDescription1") { field(VAL, "Unknown") } record(stringout, "$(P)$(R)SampleDescription2") { field(VAL, "Unknown") } record(stringout, "$(P)$(R)SampleDescription3") { field(VAL, "Unknown") } ``` -------------------------------- ### NetBooter_Control.login() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Logs into the NetBooter_Control system. This is typically required before performing other control operations. ```APIDOC ## NetBooter_Control.login() ### Description Logs into the NetBooter_Control system. ### Method Not specified (likely a method call within a Python class) ### Endpoint Not applicable (Python method) ### Parameters Parameters are not detailed in the source. ### Request Example Not specified. ### Response Response details are not specified. ``` -------------------------------- ### TomoScan2BMSTEP.wait_frontend_shutter_open() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Waits until the front-end shutter of the TomoScan2BMSTEP is confirmed to be open. This is useful for synchronizing operations. ```APIDOC ## TomoScan2BMSTEP.wait_frontend_shutter_open() ### Description Waits until the front-end shutter is confirmed to be open. ### Method Not specified (likely a method call within a Python class) ### Endpoint Not applicable (Python method) ### Parameters Parameters are not detailed in the source. ### Request Example Not specified. ### Response Response details are not specified. ``` -------------------------------- ### Clone and Build EPICS Base Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Download the EPICS base latest release, initialize and update submodules, clean the build, and compile EPICS base. ```default $ git clone https://github.com/epics-base/epics-base.git $ cd epics-base $ git submodule init $ git submodule update $ make distclean (do this in case there was an OS update) $ make -sj ``` -------------------------------- ### Configure Tomoscan RELEASE File Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Add the TOMOSCAN path to the configure/RELEASE file and verify EPICS_BASE and SUPPORT paths, ensuring ASYN, AUTOSAVE, and BUSY versions are correctly set. ```default TOMOSCAN=$(SUPPORT)/tomoscan ``` -------------------------------- ### NetBooter_Control.power_on() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Powers on a connected device or outlet managed by NetBooter_Control. ```APIDOC ## NetBooter_Control.power_on() ### Description Powers on a connected device or outlet. ### Method Not specified (likely a method call within a Python class) ### Endpoint Not applicable (Python method) ### Parameters Parameters are not detailed in the source. ### Request Example Not specified. ### Response Response details are not specified. ``` -------------------------------- ### File Path and Name Configuration Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan.template.md Configure PVs for file path, file name, and full file name using waveform records. Includes boolean input (bi) records to check file path existence and overwrite warnings. ```default record(waveform, "$(P)$(R)FilePath") { field(FTVL, "UCHAR") field(NELM, "256") } ``` ```default record(waveform, "$(P)$(R)FileName") { field(FTVL, "UCHAR") field(NELM, "256") } ``` ```default record(bi, "$(P)$(R)FilePathExists") { field(ZNAM, "No") field(ZSV, "MAJOR") field(ONAM, "Yes") field(OSV, "NO_ALARM") } ``` ```default record(bi, "$(P)$(R)OverwriteWarning") { field(ZNAM, "No") field(ZSV, "MAJOR") field(ONAM, "Yes") field(OSV, "NO_ALARM") } ``` ```default record(waveform, "$(P)$(R)FullFileName") { field(FTVL, "UCHAR") field(NELM, "256") } ``` -------------------------------- ### TomoScanStreamPSO Constructor Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_pso.md Initializes the TomoScanStreamPSO class, setting up the scanning parameters with EPICS PVs and macros. ```APIDOC ## class tomoscan.tomoscan_stream_pso.TomoScanStreamPSO(pv_files, macros) ### Description Initializes the TomoScanStreamPSO class, which is derived from TomoScan and used for tomography scanning with EPICS using Aerotech controllers and PSO trigger outputs in streaming mode. ### 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 ``` -------------------------------- ### wait_frontend_shutter_open(timeout=-1) Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_2bm.md Waits for the front end shutter to open, with an optional timeout, and handles potential abort signals or timeouts. ```APIDOC ## wait_frontend_shutter_open(timeout=-1) ### Description 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**](tomoscan.md#tomoscan.tomoscan.ScanAbortError) – If `abort_scan()` is called * **ShutterTimeoutError** – If the open shutter has not completed within timeout value. ``` -------------------------------- ### Create TomoScan Object Source: https://github.com/tomography/tomoscan/blob/master/docs/source/usage.md Initializes the TomoScan13BM_PSO object with database request files and macro substitution values. These arguments configure the scan settings and PV prefixes. ```python ts = TomoScan13BM_PSO(["../../db/tomoScan_settings.req", "../../db/tomoScan_PSO_settings.req", "../../db/tomoScan_13BM_settings.req"], {"$(P)":"13BMDPG1:", "$(R)":"TS:"}) ``` -------------------------------- ### Import TomoScan Class Source: https://github.com/tomography/tomoscan/blob/master/docs/source/usage.md Imports the TomoScan13BM_PSO class from the tomoscan_13bm_pso library. This class is used for setting up and running tomography scans. ```python >>> from tomoscan_13bm_pso import TomoScan13BM_PSO ``` -------------------------------- ### open_frontend_shutter() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_32id.md Opens the shutters to collect flat fields or projections, specifically opening the 2-BM-A front-end shutter, with a check for testing mode. ```APIDOC ## open_frontend_shutter() ### Description 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. ``` -------------------------------- ### Create and Activate Conda Environment Source: https://github.com/tomography/tomoscan/blob/master/docs/source/install.md Steps to create a dedicated conda environment for Tomoscan with Python 3.9 and activate it. ```bash $ conda create --name tomoscan python=3.9 $ conda activate tomoscan ``` -------------------------------- ### wait_frontend_shutter_open(timeout=-1) Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_32id.md Waits for the front end shutter to open or for abort_scan() to be called, with an optional timeout. ```APIDOC ## wait_frontend_shutter_open(timeout=-1) ### Description 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**](tomoscan.md#tomoscan.tomoscan.ScanAbortError) – If `abort_scan()` is called * **ShutterTimeoutError** – If the open shutter has not completed within timeout value. ``` -------------------------------- ### TomoScan2BMSTEP.open_frontend_shutter() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Opens the front-end shutter for the TomoScan2BMSTEP. This allows light or radiation to pass through before or during a scan. ```APIDOC ## TomoScan2BMSTEP.open_frontend_shutter() ### Description Opens the front-end shutter. ### Method Not specified (likely a method call within a Python class) ### Endpoint Not applicable (Python method) ### Parameters Parameters are not detailed in the source. ### Request Example Not specified. ### Response Response details are not specified. ``` -------------------------------- ### reinit_camera(camera=None) Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_2bm.md Re-initializes camera PVs based on the selected optics. ```APIDOC ## reinit_camera(camera=None) ### Description Init camera PVs based on the mctOptics selection. ### Parameters **camera** (*int, optional*) – The camera to use. Optique Peter system support 2 cameras ``` -------------------------------- ### TomoScan32IDSTEP.wait_frontend_shutter_open() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Waits for the frontend shutter of the TomoScan32IDSTEP to open. Ensures synchronization before proceeding. ```APIDOC ## TomoScan32IDSTEP.wait_frontend_shutter_open() ### Description Waits for the frontend shutter of the TomoScan32IDSTEP to open. Ensures synchronization before proceeding. ### Method Not specified (likely a Python method call) ### Endpoint Not applicable (Python method) ### Parameters Not specified in the source text. ### Request Example Not specified in the source text. ### Response Not specified in the source text. ``` -------------------------------- ### wait_frontend_shutter_open() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_2bm.md Waits for the front end shutter to open, with a timeout and error handling for ScanAbortError and ShutterTimeoutError. ```APIDOC ## wait_frontend_shutter_open(timeout=-1) ### Description 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**](tomoscan.md#tomoscan.tomoscan.ScanAbortError) – If `abort_scan()` is called * **ShutterTimeoutError** – If the open shutter has not completed within timeout value. ``` -------------------------------- ### Beam Status PV Configuration Source: https://github.com/tomography/tomoscan/blob/master/docs/source/tomoScan_6BM.template.md Sets up PVs to report beam readiness and testing status. Includes string outputs for the beam ready PV name and value, and a boolean output for testing mode. ```EPICS record(stringout, "$(P)$(R)BeamReadyPVName") { field(VAL, "$(BEAM_READY)") } record(stringout, "$(P)$(R)BeamReadyValue") { field(VAL, "$(READY_VALUE)") } record(bo, "$(P)$(R)Testing") { field(ZNAM, "No") field(ONAM, "Yes") } ``` -------------------------------- ### open_shutter Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_7bm.md Opens the front end and 7-BM-B fast shutters for collecting flat fields or projections. ```APIDOC ## open_shutter() ### Description Opens the shutter to collect flat fields or projections. This does the following: - Checks if we are in testing mode. If we are, do nothing. - Opens the front end shutter, waiting for it to indicate it is open. : This is copied from the 2-BM implementation 9/2020 - Opens the 7-BM-B fast shutter. ``` -------------------------------- ### TomoScanPSO Class Initialization Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_pso.md Initializes the TomoScanPSO class, a derived class for tomography scanning with EPICS using Aerotech controllers and PSO trigger outputs. ```APIDOC ## class tomoscan.tomoscan_pso.TomoScanPSO(pv_files, macros) ### Description Derived class used for tomography scanning with EPICS using Aerotech controllers and PSO trigger outputs. ### 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 ``` -------------------------------- ### TomoScan2BM.wait_frontend_shutter_open() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Waits until the front-end shutter of the TomoScan2BM is confirmed to be open. This is useful for synchronizing operations. ```APIDOC ## TomoScan2BM.wait_frontend_shutter_open() ### Description Waits until the front-end shutter is confirmed to be open. ### Method Not specified (likely a method call within a Python class) ### Endpoint Not applicable (Python method) ### Parameters Parameters are not detailed in the source. ### Request Example Not specified. ### Response Response details are not specified. ``` -------------------------------- ### begin_scan Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_7bm.md Performs initial scan operations, including setting motor speeds and programming the rotation motor. ```APIDOC ## begin_scan() ### Description Performs the operations needed at the very start of a scan. This is an override of the begin_scan in TomoScanPSO to account for the extra frames due to saving camera gains. This does the following: - Calls the base class method. - Sets the speed of the rotation motor - Computes the delta theta, start and stop motor positions for the scan - Programs the Aerotech driver to provide pulses at the right positions ``` -------------------------------- ### TomoScanStream7BM.open_shutter() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Opens the shutter for the TomoScanStream7BM. ```APIDOC ## TomoScanStream7BM.open_shutter() ### Description Opens the shutter for the TomoScanStream7BM. ### Method (Not specified in source, assumed to be a method call) ### Endpoint (Not applicable, this is an SDK method) ### Parameters (Parameters not specified in source) ### Request Example (Not specified in source) ### Response (Response details not specified in source) ``` -------------------------------- ### TomoScanStream32ID.begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Initiates a new scan sequence for the TomoScanStream32ID. ```APIDOC ## TomoScanStream32ID.begin_scan() ### Description Initiates a new scan sequence for the TomoScanStream32ID. ### Method (Not specified in source, assumed to be a method call) ### Endpoint (Not applicable, this is an SDK method) ### Parameters (Parameters not specified in source) ### Request Example (Not specified in source) ### Response (Response details not specified in source) ``` -------------------------------- ### TomoScan32IDSTEP.begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Initiates the tomography scan process using TomoScan32IDSTEP. This method prepares the system for data acquisition. ```APIDOC ## TomoScan32IDSTEP.begin_scan() ### Description Initiates the tomography scan process using TomoScan32IDSTEP. This method prepares the system for data acquisition. ### Method Not specified (likely a Python method call) ### Endpoint Not applicable (Python method) ### Parameters Not specified in the source text. ### Request Example Not specified in the source text. ### Response Not specified in the source text. ``` -------------------------------- ### TomoScan32ID.open_frontend_shutter() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Opens the frontend shutter for the TomoScan32ID. ```APIDOC ## TomoScan32ID.open_frontend_shutter() ### Description Opens the frontend shutter for the TomoScan32ID. ### Method (Not specified in source, assumed to be a method call) ### Endpoint (Not applicable, this is an SDK method) ### Parameters (Parameters not specified in source) ### Request Example (Not specified in source) ### Response (Response details not specified in source) ``` -------------------------------- ### show_pvs() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan.md Prints the current values of all EPICS PVs currently in use by TomoScan. ```APIDOC ## show_pvs() ### Description Prints the current values of all EPICS PVs in use. ### Method This is a method within a class, not an HTTP endpoint. ### Output Sections - `config_pvs`: PVs part of the scan configuration, saved by `save_configuration()`. - `control_pvs`: PVs for EPICS control and status, not saved by `save_configuration()`. - `pv_prefixes`: Prefixes for PVs related to the areaDetector camera, file plugin, etc. ``` -------------------------------- ### Python Script for Tomography Scan Demo Source: https://github.com/tomography/tomoscan/blob/master/docs/source/demo.md This Python function demonstrates collecting tomography datasets while scanning an EPICS PV. It requires the 'epics' library and configures exposure time, file numbering, and auto-increment before initiating scans. ```python import epics def scan_demo(tomo_prefix, exposure_time, scan_pv, start, step, points): """Demonstrates collecting a series of tomography datasets while scanning an EPICS PV. Parameters ---------- tomo_prefix : str The EPICS PV prefix for the tomoScan database exposure_time : float The exposure time per projection for the tomography datasets scan_pv : str The name of the EPICS PV to scan start : float The starting value for the scanned PV step : float The step size for the scanned PV points : int The number of points in the scan """ epics.caput(tomo_prefix + 'ExposureTime', exposure_time, wait=True) file_plugin_prefix = epics.caget(tomo_prefix + 'FilePluginPVPrefix') # Set the initial file number back to 1 and make sure AutoIncrement is enables epics.caput(file_plugin_prefix + 'FileNumber', 1) epics.caput(file_plugin_prefix + 'AutoIncrement', 'Yes') for i in range(1, points+1): epics.caput(scan_pv, start + step*i, wait=True) epics.caput(tomo_prefix + 'StartScan', 1, wait=True, timeout=100) print('Completed dataset %s' % epics.caget(file_plugin_prefix + 'FullFileName_RBV', as_string=True)) ``` -------------------------------- ### TomoScan32ID.begin_scan() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api.md Initiates a new scan sequence for the TomoScan32ID. ```APIDOC ## TomoScan32ID.begin_scan() ### Description Initiates a new scan sequence for the TomoScan32ID. ### Method (Not specified in source, assumed to be a method call) ### Endpoint (Not applicable, this is an SDK method) ### Parameters (Parameters not specified in source) ### Request Example (Not specified in source) ### Response (Response details not specified in source) ``` -------------------------------- ### open_shutter() Source: https://github.com/tomography/tomoscan/blob/master/docs/source/api/tomoscan_stream_32id.md Opens the shutters to collect flat fields or projections by opening the 32-ID-C fast shutter. ```APIDOC ## open_shutter() ### Description Opens the shutters to collect flat fields or projections. This does the following: - Opens the 32-ID-C fast shutter. ```