def unmount(segment, puck, sample, force=False): """ """ print "unmount: ", segment, puck, sample, force #Initial checks assertValidAddress(segment, puck, sample) assert_puck_detected(segment, puck) robot.assert_no_task() robot.reset_motion() robot.wait_ready() robot.assert_cleared() #robot.assert_in_known_point() hexiposi.assert_homed() if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == False: raise Exception("No pin detected on gonio") #Enabling enable_motion() set_hexiposi(segment) if not force: visual_check_hexiposi(segment) #location = robot.get_current_point() if not robot.is_gonio(): robot.move_gonio() smart_magnet.set_unmount_current() try: robot.get_gonio() robot.move_dewar() robot.put_dewar(segment, puck, sample) finally: smart_magnet.set_default_current()