Example #1
0
def test_basic_usage():
    try:
        import metadatastore
    except ImportError:
        raise nose.SkipTest
    from bluesky.global_state import gs
    from bluesky.spec_api import (ct, ascan, a2scan, a3scan, dscan, d2scan,
                                  d3scan, mesh, tscan, dtscan, th2th)
    gs.DETS = [det]
    with assert_raises(TraitError):
        gs.DETS = [det, det]  # no duplicate data keys
    gs.TEMP_CONTROLLER = motor
    gs.TH_MOTOR = motor1
    gs.TTH_MOTOR = motor2
    gs.RE.md['owner'] = 'test'
    gs.RE.md['group'] = 'test'
    gs.RE.md['beamline_id'] = 'test'
    gs.RE.md['config'] = {}
    # without count time specified
    ct()
    ct(num=3)  # passing kwargs through to scan
    ascan(motor, 1, 2, 2)
    a2scan(motor, 1, 2, 2)
    a3scan(motor, 1, 2, 2)
    dscan(motor, 1, 2, 2)
    d2scan(motor, 1, 2, 2)
    d3scan(motor, 1, 2, 2)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3)
    tscan(1, 2, 2)
    dtscan(1, 2, 2)
    th2th(1, 2, 2)
    # with count time specified as positional arg
    ct()
    ascan(motor, 1, 2, 2, 0.1)
    a2scan(motor, 1, 2, 2, 0.1)
    a3scan(motor, 1, 2, 2, 0.1)
    dscan(motor, 1, 2, 2, 0.1)
    d2scan(motor, 1, 2, 2, 0.1)
    d3scan(motor, 1, 2, 2, 0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, 0.1)
    tscan(1, 2, 2, 0.1)
    dtscan(1, 2, 2, 0.1)
    th2th(1, 2, 2, 0.1)
    # with count time specified as keyword arg
    ct()
    ascan(motor, 1, 2, 2, time=0.1)
    a2scan(motor, 1, 2, 2, time=0.1)
    a3scan(motor, 1, 2, 2, time=0.1)
    dscan(motor, 1, 2, 2, time=0.1)
    d2scan(motor, 1, 2, 2, time=0.1)
    d3scan(motor, 1, 2, 2, time=0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, time=0.1)
    tscan(1, 2, 2, time=0.1)
    dtscan(1, 2, 2, time=0.1)
    th2th(1, 2, 2, time=0.1)
    flyer = FlyMagic('wheee', motor, det1, det2)
    gs.FLYERS = [flyer]
    ct()
Example #2
0
def test_basic_usage():
    try:
        import metadatastore
    except ImportError:
        raise nose.SkipTest
    from bluesky.global_state import gs
    from bluesky.spec_api import (ct, ascan, a2scan, a3scan, dscan, d2scan,
                                  d3scan, mesh, tscan, dtscan, th2th)
    gs.DETS = [det]
    with assert_raises(TraitError):
        gs.DETS = [det, det]  # no duplicate data keys
    gs.TEMP_CONTROLLER = motor
    gs.TH_MOTOR = motor1
    gs.TTH_MOTOR = motor2
    gs.RE.md['owner'] = 'test'
    gs.RE.md['group'] = 'test'
    gs.RE.md['beamline_id'] = 'test'
    gs.RE.md['config'] = {}
    # without count time specified
    ct()
    ct(num=3)  # passing kwargs through to scan
    ascan(motor, 1, 2, 2)
    a2scan(motor, 1, 2, 2)
    a3scan(motor, 1, 2, 2)
    dscan(motor, 1, 2, 2)
    d2scan(motor, 1, 2, 2)
    d3scan(motor, 1, 2, 2)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3)
    tscan(1, 2, 2)
    dtscan(1, 2, 2)
    th2th(1, 2, 2)
    # with count time specified as positional arg
    ct()
    ascan(motor, 1, 2, 2, 0.1)
    a2scan(motor, 1, 2, 2, 0.1)
    a3scan(motor, 1, 2, 2, 0.1)
    dscan(motor, 1, 2, 2, 0.1)
    d2scan(motor, 1, 2, 2, 0.1)
    d3scan(motor, 1, 2, 2, 0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, 0.1)
    tscan(1, 2, 2, 0.1)
    dtscan(1, 2, 2, 0.1)
    th2th(1, 2, 2, 0.1)
    # with count time specified as keyword arg
    ct()
    ascan(motor, 1, 2, 2, time=0.1)
    a2scan(motor, 1, 2, 2, time=0.1)
    a3scan(motor, 1, 2, 2, time=0.1)
    dscan(motor, 1, 2, 2, time=0.1)
    d2scan(motor, 1, 2, 2, time=0.1)
    d3scan(motor, 1, 2, 2, time=0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, time=0.1)
    tscan(1, 2, 2, time=0.1)
    dtscan(1, 2, 2, time=0.1)
    th2th(1, 2, 2, time=0.1)
Example #3
0
def test_basic_usage():
    gs.DETS = [det]
    with assert_raises(TraitError):
        gs.DETS = [det, det]  # no duplicate data keys
    gs.TEMP_CONTROLLER = motor
    gs.TH_MOTOR = motor1
    gs.TTH_MOTOR = motor2
    gs.RE.md["group"] = "test"
    gs.RE.md["beamline_id"] = "test"
    gs.RE.md["config"] = {}
    # without count time specified
    ct()
    ascan(motor, 1, 2, 2)
    a2scan(motor, 1, 2, 2)
    a3scan(motor, 1, 2, 2)
    dscan(motor, 1, 2, 2)
    d2scan(motor, 1, 2, 2)
    d3scan(motor, 1, 2, 2)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3)
    tscan(1, 2, 2)
    dtscan(1, 2, 2)
    th2th(1, 2, 2)
    # with count time specified as positional arg
    ct()
    ascan(motor, 1, 2, 2, 0.1)
    a2scan(motor, 1, 2, 2, 0.1)
    a3scan(motor, 1, 2, 2, 0.1)
    dscan(motor, 1, 2, 2, 0.1)
    d2scan(motor, 1, 2, 2, 0.1)
    d3scan(motor, 1, 2, 2, 0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, 0.1)
    tscan(1, 2, 2, 0.1)
    dtscan(1, 2, 2, 0.1)
    th2th(1, 2, 2, 0.1)
    # with count time specified as keyword arg
    ct()
    ascan(motor, 1, 2, 2, time=0.1)
    a2scan(motor, 1, 2, 2, time=0.1)
    a3scan(motor, 1, 2, 2, time=0.1)
    dscan(motor, 1, 2, 2, time=0.1)
    d2scan(motor, 1, 2, 2, time=0.1)
    d3scan(motor, 1, 2, 2, time=0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, time=0.1)
    tscan(1, 2, 2, time=0.1)
    dtscan(1, 2, 2, time=0.1)
    th2th(1, 2, 2, time=0.1)
Example #4
0
def test_basic_usage():
    gs.DETS = [det]
    with assert_raises(TraitError):
        gs.DETS = [det, det]  # no duplicate data keys
    gs.TEMP_CONTROLLER = motor
    gs.TH_MOTOR = motor1
    gs.TTH_MOTOR = motor2
    gs.RE.md['group'] = 'test'
    gs.RE.md['beamline_id'] = 'test'
    gs.RE.md['config'] = {}
    # without count time specified
    ct()
    ascan(motor, 1, 2, 2)
    a2scan(motor, 1, 2, 2)
    a3scan(motor, 1, 2, 2)
    dscan(motor, 1, 2, 2)
    d2scan(motor, 1, 2, 2)
    d3scan(motor, 1, 2, 2)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3)
    tscan(1, 2, 2)
    dtscan(1, 2, 2)
    th2th(1, 2, 2)
    # with count time specified as positional arg
    ct()
    ascan(motor, 1, 2, 2, 0.1)
    a2scan(motor, 1, 2, 2, 0.1)
    a3scan(motor, 1, 2, 2, 0.1)
    dscan(motor, 1, 2, 2, 0.1)
    d2scan(motor, 1, 2, 2, 0.1)
    d3scan(motor, 1, 2, 2, 0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, 0.1)
    tscan(1, 2, 2, 0.1)
    dtscan(1, 2, 2, 0.1)
    th2th(1, 2, 2, 0.1)
    # with count time specified as keyword arg
    ct()
    ascan(motor, 1, 2, 2, time=0.1)
    a2scan(motor, 1, 2, 2, time=0.1)
    a3scan(motor, 1, 2, 2, time=0.1)
    dscan(motor, 1, 2, 2, time=0.1)
    d2scan(motor, 1, 2, 2, time=0.1)
    d3scan(motor, 1, 2, 2, time=0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, time=0.1)
    tscan(1, 2, 2, time=0.1)
    dtscan(1, 2, 2, time=0.1)
    th2th(1, 2, 2, time=0.1)
Example #5
0
def test_basic_usage():
    gs.DETS = [det]
    gs.TEMP_CONTROLLER = motor
    gs.TH_MOTOR = motor1
    gs.TTH_MOTOR = motor2
    gs.RE.md['group'] = 'test'
    gs.RE.md['beamline_id'] = 'test'
    gs.RE.md['config'] = {}
    # without count time specified
    ct()
    ascan(motor, 1, 2, 2)
    a2scan(motor, 1, 2, 2)
    a3scan(motor, 1, 2, 2)
    dscan(motor, 1, 2, 2)
    d2scan(motor, 1, 2, 2)
    d3scan(motor, 1, 2, 2)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3)
    tscan(1, 2, 2)
    dtscan(1, 2, 2)
    th2th(1, 2, 2)
    # with count time specified as positional arg
    ct()
    ascan(motor, 1, 2, 2, 0.1)
    a2scan(motor, 1, 2, 2, 0.1)
    a3scan(motor, 1, 2, 2, 0.1)
    dscan(motor, 1, 2, 2, 0.1)
    d2scan(motor, 1, 2, 2, 0.1)
    d3scan(motor, 1, 2, 2, 0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, 0.1)
    tscan(1, 2, 2, 0.1)
    dtscan(1, 2, 2, 0.1)
    th2th(1, 2, 2, 0.1)
    # with count time specified as keyword arg
    ct()
    ascan(motor, 1, 2, 2, time=0.1)
    a2scan(motor, 1, 2, 2, time=0.1)
    a3scan(motor, 1, 2, 2, time=0.1)
    dscan(motor, 1, 2, 2, time=0.1)
    d2scan(motor, 1, 2, 2, time=0.1)
    d3scan(motor, 1, 2, 2, time=0.1)
    mesh(motor1, 1, 2, 2, motor2, 1, 2, 3, time=0.1)
    tscan(1, 2, 2, time=0.1)
    dtscan(1, 2, 2, time=0.1)
    th2th(1, 2, 2, time=0.1)