Skip to content
Snippets Groups Projects
Commit 68de74e5 authored by Your Name's avatar Your Name
Browse files

doc string and AD/cams

parent 0aea1e30
No related branches found
No related tags found
1 merge request!11Main merge jmcchesn-main-patch branch with main
......@@ -332,6 +332,19 @@ def ADplugin_ScanSetup(ADplugin, **kwargs):
print("WARNING: you need to need to disable saving and clear the trigger by hand after the scan")
print("\tAD_FreeRun("+ADplugin+"); scan_triggers_clear()")
def AD_attributes_set(ADplugin, filepath):
"""
filepath is the full path to the xml file
filepath = '/xorApps/epics/synApps_6_1/ioc/29idcScienta/iocBoot/ioc29idcScienta/HDF5Attributes.xml'
filepath = '/home/beams/29IDUSER/Documents/User_Macros/Macros_29id/AD_Attributes/DiaGon_Attributes.xml'
"""
current_xml = caget(ADplugin+"NDAttributesFile",as_string=True)
print ('Changed attributes file from ',current_xml)
caput(ADplugin+"NDAttributesFile",filepath)
sleep(1)
print('To: ',caget(ADplugin+"NDAttributesStatus",as_string=True))
def AD_ROI_setup(AD,ROInum,xcenter=500,ycenter=500,xsize=50,ysize=50,binX=1,binY=1):
"""
AD = "29id_ps4"
......
......@@ -294,23 +294,24 @@ def apertures_set(c_2B=1,c_1A=1,verbose=True):
slit2B_set(Size2B[0],Size2B[1],center=(H2_center,V2_center),verbose=verbose)
def mvID(val):
def mvID(energy_eV):
"""
Sets the ID absolute set point (not optimized , mono & apertures stay fixed).
Sets the ID absolute set point in eV
Note: flux is not optimized and mono & apertures stay fixed
to go to most flux use energy
"""
ID_set_eV(val)
ID_set_eV(energy_eV)
def mvID_calibrated(val):
def mvID_calibrated(energy_eV):
"""
Sets the ID peak to val (calibrated).
Sets the ID peak to eV (calibrated).
Note: mono & apertures stay fixed
"""
ID_energy_set_eV(val)
ID_energy_set_eV(energy_eV)
def scan_ID(ID_sp_start,ID_sp_stop,ID_sp_step,**kwargs):
def scanID(ID_sp_start,ID_sp_stop,ID_sp_step,**kwargs):
"""
scan the ID set point
"""
......
import time
from os import join
from epics import caget,caput,PV
import iexcode.instruments.cfg as iex
from iexcode.instruments.AD_utilities import *
from iexcode.instruments.IEX_cameras import cam_pv_dictionary
from iexcode.instruments.scanRecord import mda_fileNum
from iexplot.mda_quick_plot import *
from iexplot.mda_quick_plot import plot_image
##############################################################################################################
......@@ -49,8 +51,11 @@ def cam_scan_setup(cam_num,savePlugin='TIFF1:',**kwargs):
(e.g. filepath="/net/s29data/export/data_29id"+folder+"/"+run+"/"+userName+"/"+df)
dtype = taken from ADplugin
FileTemplate="%s%s_%4.4d."+dtype; format for filename first %s = filepath, second %s = prefix
prefix = dtype by default
prefix = MDAscan+mda_fileNum' with nzeros=4
"""
kwargs.setdefault('nzeros',4)
kwargs.setdefault('prefix',"MDAscan"+str.zfill(str(mda_fileNum()),kwargs["nzeros"]))
ADplugin = cam_pv_dictionary()[cam_num]+savePlugin
ADplugin_ScanSetup(ADplugin,**kwargs)
......@@ -79,6 +84,19 @@ def cam_save_setup(cam_num,savePlugin='TIFF1:',**kwargs):
ADplugin = cam_pv_dictionary()[cam_num]+savePlugin
AD_SaveFileSetup(ADplugin,**kwargs)
def cam_attributes_set(cam_num,filename,savePlugin='TIFF1:',**kwargs):
"""
filename of attributes.xml
**kwargs:
path = '/home/beams/29IDUSER/Documents/User_Macros/Macros_29id/AD_Attributes/'
"""
kwargs.setdefault('path','/home/beams/29IDUSER/Documents/User_Macros/Macros_29id/AD_Attributes/')
filepath = join(kwargs['path'],filename)
savePlugin='TIFF1:'
ADplugin = cam_pv_dictionary()[cam_num]+savePlugin
AD_attributes_set(ADplugin, filepath)
def cam_last_filepath(cam_num,savePlugin='TIFF1:',verbose=True):
"""
returns the full path for the last saved image
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment