Exemple #1
0
def Collecting_XRF(lg):
    'Sending main the args and plan to run a grid scan'
    global xstart, xstop, xnum, ystart, ystop, ynum, courseXfly, courseYfly, xrf_dwell
    # print (xstart,xstop,xnum,ystart,ystop, ynum,courseXfly,courseYfly)
    detectors = [noisy_det]
    if flymotor == courseXfly:
        print(" ")
        x_scan = ('RE(scan_and_fly( {} , {}, {}, {}, {}, {}, {} )'.format(
            xstart, xstop, xnum, ystart, ystop, ynum, xrf_dwell))

        # print (x_scan)
        print(x_scan)
        return bpp.subs_decorator([lg
                                   ])(grid_scan), (detectors, motor1, xstart,
                                                   xstop, xnum, motor2, ystart,
                                                   ystop, ynum, False)

    else:

        yscan = ('RE(y_scan_and_fly( {} , {}, {}, {}, {}, {}, {} )'.format(
            ystart, ystop, ynum, xstart, xstop, xnum, xrf_dwell))

        print(yscan)

        return bpp.subs_decorator([lg
                                   ])(grid_scan), (detectors, motor1, xstart,
                                                   xstop, xnum, motor2, ystart,
                                                   ystop, ynum, False)
Exemple #2
0
 def collect_arg_kwargs(self):
     dwell = self.dwell_t.value()
     xstart = self.flyingStart.value()
     xstop = self.flyingStop.value()
     ystart = self.steppingStart.value()
     ystop = self.steppingStop.value()
     xnum = int(self.npts_x.value())
     ynum = int(self.npts_y.value())
     detectors = [det4]
     # return scan, (detectors,motor1, xstart, xstop, xnum)
     self.map_.figure.clf()
     ax = self.map_.figure.add_subplot(111)
     self.lg = lg = DrawingLiveGrid((xnum, ynum), 'det4', ax=ax)
     import bluesky.preprocessors as bpp
     return bpp.subs_decorator([lg
                                ])(grid_scan), (detectors, motor1, xstart,
                                                xstop, xnum, motor2, ystart,
                                                ystop, ynum, False)
Exemple #3
0
def test_subs():

    def cb(name, doc):
        pass

    def plan(*args, **kwargs):
        # check that args to plan are passed through
        yield from [Msg('null', None, *args, **kwargs)]

    processed_plan = list(subs_wrapper(plan('test_arg', test_kwarg='val'),
                                       {'all': cb}))

    expected = [Msg('subscribe', None, cb, 'all'),
                Msg('null', None, 'test_arg', test_kwarg='val'),
                Msg('unsubscribe', token=None)]

    assert processed_plan == expected

    processed_plan = list(subs_decorator({'all': cb})(plan)('test_arg',
                                                            test_kwarg='val'))
    assert processed_plan == expected
Exemple #4
0
def test_subs():

    def cb(name, doc):
        pass

    def plan(*args, **kwargs):
        # check that args to plan are passed through
        yield from [Msg('null', None, *args, **kwargs)]

    processed_plan = list(subs_wrapper(plan('test_arg', test_kwarg='val'),
                                       {'all': cb}))

    expected = [Msg('subscribe', None, cb, 'all'),
                Msg('null', None, 'test_arg', test_kwarg='val'),
                Msg('unsubscribe', token=None)]

    assert processed_plan == expected

    processed_plan = list(subs_decorator({'all': cb})(plan)('test_arg',
                                                            test_kwarg='val'))
    assert processed_plan == expected
Exemple #5
0
def set_up_xrf(lg):
    return bpp.subs_decorator([lg])(grid_scan)