def test_moving_from_grid2_to_grid1_in_fm_imaging_Area(self): f = cryoSwitchSamplePosition(LOADING) f.result() # move to the fm imaging area f = cryoSwitchSamplePosition(FM_IMAGING) f.result() current_imaging_mode = getCurrentPositionLabel( self.stage.position.value, self.stage) self.assertEqual(FM_IMAGING, current_imaging_mode) # move to the grid2 f = cryoSwitchSamplePosition(GRID_2) f.result() current_grid = getCurrentGridLabel(self.stage.position.value, self.stage) self.assertEqual(GRID_2, current_grid) # move back to the grid1 f = cryoSwitchSamplePosition(GRID_1) f.result() current_grid = getCurrentGridLabel(self.stage.position.value, self.stage) self.assertEqual(GRID_1, current_grid) # make sure we are still in fm imaging area current_imaging_mode = getCurrentPositionLabel( self.stage.position.value, self.stage) self.assertEqual(FM_IMAGING, current_imaging_mode)
def test_unknown_label_at_initialization(self): arbitrary_position = {"x": 0.0, "y": 0.0, "z":-3.0e-3} self.stage.moveAbs(arbitrary_position).result() current_imaging_mode = getCurrentPositionLabel(self.stage.position.value, self.stage) self.assertEqual(UNKNOWN, current_imaging_mode) current_grid = getCurrentGridLabel(self.stage.position.value, self.stage) self.assertEqual(current_grid, None)
def test_moving_to_grid2_in_sem_imaging_area_after_loading(self): # move the stage to the loading position f = cryoSwitchSamplePosition(LOADING) f.result() # move the stage to grid2 f = cryoSwitchSamplePosition(GRID_2) f.result() position_label = getCurrentPositionLabel(self.stage.position.value, self.stage) grid_label = getCurrentGridLabel(self.stage.position.value, self.stage) self.assertEqual(position_label, SEM_IMAGING) self.assertEqual(grid_label, GRID_2)
def test_moving_from_grid1_to_grid2_in_sem_imaging_area(self): # move to loading position f = cryoSwitchSamplePosition(LOADING) f.result() # move the stage to the sem imaging area f = cryoSwitchSamplePosition(SEM_IMAGING) f.result() current_imaging_mode = getCurrentPositionLabel(self.stage.position.value, self.stage) self.assertEqual(SEM_IMAGING, current_imaging_mode) # now the selected grid is already the grid1 current_grid = getCurrentGridLabel(self.stage.position.value, self.stage) self.assertEqual(GRID_1, current_grid) # move the stage to grid2 f = cryoSwitchSamplePosition(GRID_2) f.result() current_grid = getCurrentGridLabel(self.stage.position.value, self.stage) self.assertEqual(GRID_2, current_grid) # make sure we are still in sem imaging area current_imaging_mode = getCurrentPositionLabel(self.stage.position.value, self.stage) self.assertEqual(SEM_IMAGING, current_imaging_mode)
def test_moving_to_grid1_in_fm_imaging_area_after_loading(self): # move the stage to the loading position f = cryoSwitchSamplePosition(LOADING) f.result() # move the stage to the fm imaging area, and grid1 will be chosen by default f = cryoSwitchSamplePosition(FM_IMAGING) f.result() position_label = getCurrentPositionLabel(self.stage.position.value, self.stage) grid_label = getCurrentGridLabel(self.stage.position.value, self.stage) self.assertEqual(position_label, FM_IMAGING) self.assertEqual(grid_label, GRID_1)