def _moveback(self): self.logger.info('moving back to previous state') emdat = leginondata.NavigatorScopeEMData() emdat.friendly_update(self.oldstate) try: self.instrument.setData(emdat) except: self.logger.exception('unable to set instrument') return
for moveparam in moveparams: scopeshift = {'moveparam': moveparam, 'x': None, 'y': None} for axis in ('x', 'y'): scopeshift[ axis] = newstate[moveparam][axis] - scope[moveparam][axis] self.logger.info('change in %(moveparam)s: %(x).4e, %(y).4e' % scopeshift) # Avoid changing stage z according to imagedata here since it is handled # before the move stagenow = self.instrument.tem.StagePosition newstate['stage position']['z'] = stagenow['z'] self.oldstate = self.newstate self.newstate = newstate emdat = leginondata.NavigatorScopeEMData() emdat.friendly_update(newstate) try: self.instrument.setData(emdat) except: self.logger.exception(errstr % 'unable to set instrument') return True return False def move_away_move_back(self, label, moves, distance, angle=None): ''' Test reproducibility of the stage from position of a given distance. ''' self.logger.info('start reproducibility test') # initial move