AFL.automation.instrument.CDSAXSLabview#

Classes

CDSAXSLabview([overrides])

Driver(name[, defaults, overrides, useful_links])

LabviewConnection([vi])

ScatteringInstrument()

class AFL.automation.instrument.CDSAXSLabview.CDSAXSLabview(overrides=None)[source]#
defaults = {'absolute_calibration_factor': 1.0, 'absolute_pressure_limit': 1, 'beamstop axis': 'Beamstop-z', 'beamstop in': 12.5, 'beamstop out': 3, 'empty transmission': None, 'empty_filename': None, 'nmc_beamstop_in': {'Beamstop-z': 12.5}, 'nmc_beamstop_out': {'Beamstop-z': 3}, 'nmc_sample_in': {'X-stage': 0, 'Z-stage': 26.5}, 'nmc_sample_out': {'X-stage': 18.0, 'Z-stage': 20.0}, 'reduced_data_dir': 'Y:\\\\CDSAXS data\\\\autoreduce\\\\', 'relative_pressure_ratio_limit': 10, 'sample axis': 'Z-stage', 'sample in': 26.5, 'sample out': 25.0, 'sample_thickness': 0.18, 'transmission strategy': 'sum', 'use_new_motion_conventions': False, 'vi': 'C:\\saxs_control\\GIXD controls.vi'}#
axis_name_to_id_lut = {'Beamstop-y': 8, 'Beamstop-z': 7, 'Detector-z': 10, 'None': 12, 'Phi': 3, 'Temperature': 11, 'Theta': 4, 'Tungsten-y': 9, 'X-stage': 0, 'Y-gonio': 5, 'Y-stage': 6, 'Z-gonio': 2, 'Z-stage': 1}#
axis_id_to_name_lut = {0: 'X-stage', 1: 'Z-stage', 2: 'Z-gonio', 3: 'Phi', 4: 'Theta', 5: 'Y-gonio', 6: 'Y-stage', 7: 'Beamstop-z', 8: 'Beamstop-y', 9: 'Tungsten-y', 10: 'Detector-z', 11: 'Temperature', 12: 'None'}#
__init__(overrides=None)[source]#

connect to locally running labview vi with win32com and

Parameters:

vi – (str) the path to the LabView virtual instrument file for the main interface

pre_execute(**kwargs)[source]#

Executed before each call to execute

All of the kwargs passed to execute are also pass to this method. It is expected that this method be overridden by subclasses.

setReducedDataDir(path)[source]#
measureTransmission(exp=5, fn='trans', set_empty_transmission=False, return_full=False, update_beam_center=True, lv=None)[source]#

Perform a transmission measurement on the currently loaded sample.

Parameters:
  • exp (float, default=5) – exposure time

  • fn (string, default='trans') – file name to save the measurement in

  • set_empty_transmission (bool, default=False) – set the currently-held empty transmission to the outcome of this measurement

  • return_full (bool, default=False) – return more data. breaks some old API parts.

  • update_beam_center (bool, default=True) – fit and update the beam center based on this measurement

  • lv (LabViewConnection, default=None) – use this labview connection rather than making a new one if given

measureTransmissionQuick(exp=1, fn='trans', setup=False, restore=False, lv=None)[source]#
getExposure(lv=None)[source]#

get the currently set exposure time

getFilename(lv=None)[source]#

get the currently set file name

setExposure(exposure, lv=None)[source]#
setFilename(name, lv=None)[source]#
getData(lv=None, **kwargs)[source]#
setPath(path, lv=None)[source]#
getStatus(lv=None)[source]#
getNScans(lv=None)[source]#
setNScans(nscans, lv=None)[source]#
getSweepAxis(lv=None)[source]#
setSweepAxis(axis, lv=None)[source]#
getYStagePos(lv=None)[source]#
getZStagePos(lv=None)[source]#
getXStagePos(lv=None)[source]#
moveAxis(*, block=True, lv=None)[source]#
nmcMoveAxis(dest, block=True, lv=None)[source]#
setSweepStart(start, lv=None)[source]#
getSweepStart(lv=None)[source]#
setSweepStep(step, lv=None)[source]#
getSweepStep(lv=None)[source]#
getElapsedTime(lv=None)[source]#
expose(name=None, exposure=None, block=True, reduce_data=True, measure_transmission=True, save_nexus=True, sample_position=None, sample_thickness=None, subtract_empty=False, lv=None)[source]#
scan(axis, npts, start, step, name=None, exposure=None, block=False)[source]#
status()[source]#
class AFL.automation.instrument.CDSAXSLabview.LabviewConnection(vi='C:\\saxs_control\\GIXD controls.vi')[source]#
__init__(vi='C:\\saxs_control\\GIXD controls.vi')[source]#

connect to locally running labview vi with win32com and

Parameters:

vi – (str) the path to the LabView virtual instrument file for the main interface