예제 #1
0
 def _per_step(detectors, step, pos_cache, take_reading=my_take_reading):
     yield from bps.sleep(delay)
     sts = yield from bps.one_nd_step(detectors,
                                      step,
                                      pos_cache,
                                      take_reading=take_reading)
     return sts
예제 #2
0
파일: plans.py 프로젝트: pcdshub/amo
 def per_step(detectors, motor, step):
     for m, pos in motor.items():
         print("Moving '{0}' to {1}".format(m.name, pos))
     yield from one_nd_step([], motor, step)
     if wait is not None:
         print("Step complete! Waiting for {0} second(s)...\n".format(wait))
         time.sleep(wait)
예제 #3
0
 def __call__(self, detectors, step, pos_cache):
     """
     has signature of bps.one_and_step, but with added logic of skipping 
     a point if it is outside of provided radius
     """
     if self.cnt < self.skip: # if not enough skipped
         self.cnt += 1
         pass
     else:
         yield from bps.one_nd_step(detectors, step, pos_cache)
예제 #4
0
파일: plans.py 프로젝트: pcdshub/amo
 def per_step(detectors, motor, step):
     for m, pos in motor.items():
         print("Moving '{0}' to {1}".format(m.name, pos))
     yield from one_nd_step([], motor, step)
     if wait is not None:
         print("Step complete! Waiting for {0} second(s)...\n".format(wait))
         time.sleep(wait)
     # Take daq events
     daq.begin(events=events, controls=controls)
     print('Waiting for {} events ...\n'.format(events))
     daq.wait()
예제 #5
0
    def per_step(detectors, step, pos_cache):
        """
        Override default per_step to start the sequencer on each row.

        The first move is not a fly scan move: it moves us into the start
        position. The second move is, as is the fourth, sixth...
        """
        nonlocal is_seq_step
        if is_seq_step:
            yield from trigger(seq)
            is_seq_step = False
        else:
            is_seq_step = True
        yield from one_nd_step(detectors, step, pos_cache)
예제 #6
0
def xpdacq_per_step(
    detectors: list,
    step: dict,
    pos_cache: dict,
    take_reading: typing.Callable = xpdacq_trigger_and_read
) -> typing.Generator:
    """
    Inner loop of an N-dimensional step scan

    This is the default function for ``per_step`` param`` in ND plans.

    Parameters
    ----------
    detectors : iterable
        devices to read

    step : dict
        mapping motors to positions in this step

    pos_cache : dict
        mapping motors to their last-set positions

    take_reading : plan, optional
        function to do the actual acquisition ::

           def take_reading(dets, name='primary'):
                yield from ...

        Callable[List[OphydObj], Optional[str]] -> Generator[Msg], optional

        Defaults to `xpdacq_trigger_and_read`
    """
    yield from bps.one_nd_step(detectors,
                               step,
                               pos_cache,
                               take_reading=take_reading)