<jupyter_start><jupyter_text>Bluesky-based control development for 2020-2 run Test the OOP-based experiment control for* Tomography* Near field* Far field  Preparation<jupyter_code>import numpy as np
import matplotlib
import bluesky
import ophyd
import apstools
import databroker
from datetime import datetime
scan_cfg = 'seisidd/config/scan_template.yml'<jupyter_output><empty_output><jupyter_text>Tomography<jupyter_code># instantiate the experiment handle
from seisidd.experiment import Tomography

testTomo = Tomography(mode='dryrun')
# summarize plan
testTomo.dryrun(scan_cfg)
testTomo.check(scan_cfg)
testTomo.run(scan_cfg)<jupyter_output>Tomo configuration:
energyfoil = 1 
attenuation = EpicsMotorTuple(user_readback=1.008, user_setpoint=1.0, user_offset=0.0, user_offset_dir=0, offset_freeze_switch=0, set_use_switch=0, velocity=2.1, acceleration=1.0, motor_egu='pos', motor_is_moving=0, motor_done_move=1, high_limit_switch=0, low_limit_switch=0, high_limit_travel=24.5, low_limit_travel=0.5, direction_of_travel=1, motor_stop=0, home_forward=0, home_reverse=0) 
type = step 
n_white = 5 
n_dark = 5 
sample_out_position:
  kx = -1 
  kz = 0 
acquire_time = 0.5 
acquire_period = 0.51 
omega_step = 0.5 
omega_start = 0.0 
omega_end = 20.0 
n_frames = 5 
ROT_STAGE_FAST_SPEED = 1 
accl = 3 
readout_time = 0.001 
n_projections = 41 
total_images = 56 
focus_beam = False 
initial_kx = -2.0 
initial_kz = 0.0 
fronte_white_kx = -3.0 
fronte_white_kz = 0.0 
back_white_kx = -2.9396926207859084 
back_white_kz = 0.3420201433256687 

Output:
filepath = /home/beams/S6HEDM/data/ssd/test_pre2020-2 
fileprefix = test2020_2 
type = hdf 



Tr[...]<jupyter_text>Near-field<jupyter_code># instantiate the experiment handle
from seisidd.experiment import NearField

testNF = NearField(mode='dryrun')
testNF.dryrun(scan_cfg)<jupyter_output>NearField configuration:
energyfoil = 1 
attenuation = 1 
type = fly 
sample_out_position:
  kx = -1 
  kz = 0 
detector_z_position:
  nf_z1 = 7 
  nf_z2 = 10 
volume:
  ky_start = 2.5 
  ky_step = 0.5 
  n_layers = 10 
acquire_time = 0.1 
omega_step = 0.2 
omega_start = 0.0 
omega_end = 360.0 
n_frames = 1 
ROT_STAGE_FAST_SPEED = 1 
accl = 3 
readout_time = 0.001 
n_projections = 1801 
total_images = 1801 
focus_beam = False 
slew_speed = 1.9790985206238558 
initial_kx = 0.0 
initial_kz = 0.0 
fronte_white_kx = -1.0 
fronte_white_kz = 0.0 
back_white_kx = -1.0 
back_white_kz = 0.0 

Output:
filepath = /data 
fileprefix = test 
type = tif 

nfstage_ky -> 2.5
=================================== Open Run ===================================
det_tiff1_file_path -> /data
det_tiff1_file_name -> test_layer000001
det_tiff1_file_write_mode -> 2
det_tiff1_num_capture -> 3602
det_tiff1_file_template -> %s%s_%06d.tif
det_hdf1_file_path -> /data
det_hdf1_file_name -> test_layer000001
det_hdf1_file_[...]<jupyter_text>Far-field<jupyter_code>from seisidd.experiment import FarField

testFF = FarField(mode='dryrun')
testFF.dryrun(scan_cfg)
from epics import caget, caget_many
caget('S:IOC:timeOfDayForm1SI')
caget('OPS:message3')
pvs = [
"1idPG4:cam1:Manufacturer_RBV",   
"1idPG4:cam1:Model_RBV",          
"1idPG4:cam1:SerialNumber_RBV",   
"1idPG4:cam1:FirmwareVersion_RBV",
"1idPG4:cam1:SDKVersion_RBV",     
"1idPG4:cam1:DriverVersion_RBV",  
"1idPG4:cam1:ADCoreVersion_RBV",  
"1idPG4:cam1:AcquireTime",        
"1idPG4:cam1:AcquirePeriod",      
"1idPG4:cam1:FrameRateValAbs",    
"1idPG4:cam1:FrameRateOnOff_RBV", 
"1idPG4:cam1:Gain",               
"1idPG4:cam1:DataType_RBV",       
"1idPG4:cam1:ArrayCounter_RBV",   
"1idPG4:cam1:TemperatureActual",  
"1idPG4:cam1:FrameType",          
"1idPG4:HDF1:FileName",           
"1idPG4:HDF1:FullFileName_RBV",   
"1idPG4:HDF1:FilePath_RBV",       
"1idPG4:HDF1:PluginType_RBV" ,    
"S:IOC:timeOfDayForm1SI",         
"S:IOC:timeOfDayForm1SI" ,        
"S:SRcurrentAI" ,                
"S:TopUpStatus" ,                 
"OPS:message3" , 
"1idPG4:cam1:MaxSizeX_RBV" ,
"1idPG4:cam1:MaxSizeY_RBV" ,
"1idPG4:cam1:MinX"   ,      
"1idPG4:cam1:MinY"    ,     
"1idPG4:cam1:SizeX"    ,    
"1idPG4:cam1:SizeY"     ,   
"1idPG4:cam1:BinX"       ,  
"1idPG4:cam1:BinY"        , 
]
caget_many(pvs)
# expose internal RunEngine
RE = testexp.RE

# setup the Metadata as before
RE.md['beamline_id'] = 'APS 6'
RE.md['versions'] = {}
RE.md['versions']['apstools'] = apstools.__version__
RE.md['versions']['bluesky'] = bluesky.__version__
RE.md['versions']['databroker'] = databroker.__version__
RE.md['versions']['matplotlib'] = matplotlib.__version__
RE.md['versions']['numpy'] = np.__version__
RE.md['versions']['ophyd'] = ophyd.__version__
RE.md['SESSION_STARTED'] = datetime.isoformat(datetime.now(), " ")
scan_cfg = 'seisidd/config/scan_template.yml'
# summarize plan
testexp.dryrun(scan_cfg)
RE(scan_cfg)

det = testexp.tomo_det
det.cam.acquire_time.put(5)
det.cam.acquire_period.put(4)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13178294573643412, 'fraction_numerical': 0.06201550387596899, 'mean_word_length': 4.950242718446602, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '238417', 'license': 'MIT', 'n_tokens_mistral': 2235, 'n_tokens_neox': 2067, 'n_words': 313, 'path': 'test_07_06_2020.ipynb', 'repo_name': 'aps-ht-hedm/jupyter-ht-hedm', 'size': '4902'}