def test_instr_max_height():
    deck = Deck()
    trough = labware.load(trough_name, deck.position_for(1))
    trough2 = labware.load(trough_name, deck.position_for(2))
    deck[1] = trough
    deck[2] = trough2

    # if the highest deck height is between 1 mm and 10 mm below
    # the max instrument achievable height, we use the max instrument
    # height as the safe height
    instr_max_height = trough.wells()[0].top().point.z + 1
    height = safe_height(
        trough.wells()[0].top(), trough2.wells()[0].top(),
        deck, round(instr_max_height, 2), 7.0, 15.0)
    assert height == round(instr_max_height, 2)

    # if the highest deck height is > 10 mm below the max instrument
    # height, we use the lw_z_margin instead
    instr_max_height = trough.wells()[0].top().point.z + 30
    height2 = safe_height(
        trough.wells()[0].top(), trough2.wells()[0].top(),
        deck, round(instr_max_height, 2), 7.0, 15.0)
    assert height2 ==\
        round(trough.wells()[0].top().point.z, 2) + 15.0

    # it fails if the highest deck height is less than 1 mm below
    # the max instr achievable height
    instr_max_height = trough.wells()[0].top().point.z
    with pytest.raises(Exception):
        safe_height(
            trough.wells()[0].top(), trough2.wells()[0].top(),
            deck, round(instr_max_height, 2), 7.0, 15.0)
Beispiel #2
0
    async def _move(self, to_loc: Location):
        from_pt = await self._get_current_point()
        from_loc = Location(from_pt, None)
        cp = self._get_critical_point()

        max_height = self._hardware.get_instrument_max_height(self._mount)

        safe = geometry.safe_height(
            from_loc, to_loc, self._deck, max_height)
        moves = plan_arc(from_pt, to_loc.point, safe,
                         origin_cp=None,
                         dest_cp=cp)
        for move in moves:
            await self._hardware.move_to(mount=self._mount,
                                         abs_position=move[0],
                                         critical_point=move[1])
Beispiel #3
0
    async def _move(self,
                    mount: Mount,
                    to_loc: Location,
                    cp_override: CriticalPoint = None):
        from_pt = await self.hardware.gantry_position(mount)
        from_loc = Location(from_pt, None)
        cp = cp_override or self._pip_info_by_mount[mount].critical_point

        max_height = self.hardware.get_instrument_max_height(mount)
        safe = geometry.safe_height(
            from_loc, to_loc, self._deck, max_height)
        moves = plan_arc(from_pt, to_loc.point, safe,
                         origin_cp=None,
                         dest_cp=cp)
        for move in moves:
            await self.hardware.move_to(
                mount, move[0], critical_point=move[1])