pylabrobot.bmg_labtech.vantastar.driver.features.fluorescence.Fluorescence.adjust_gain_and_focus#

async Fluorescence.adjust_gain_and_focus(fluorescence_channel: FluorescenceChannel, *, wells: Sequence[Well], focal_height: float | None = None, adjust_focus: bool = True, adjust_gain: bool = True, target_percent: float = 88.0, monochromator: MonochromatorSettings | None = None, plate: Plate | None = None, measurement_settings: MeasurementSettings | None = None, timeout: float = 300.0) → GainFocus#

Find the gain and the focal height, or either, for a top fluorescence read on reference wells.

The reader scans the focal height from 16 mm down in 0.2 mm steps and sets the gain so the brightest reference well reads at target_percent of the detector range, as Voyager’s automatic gain and focus does. Voyager’s autofocus adjusts the focus once more on every well of the read, without the gain (adjust_gain=False), and reads at the height found. measure_z_profile returns the whole scan of one well.

Parameters:
  • fluorescence_channel (FluorescenceChannel) – the read’s FluorescenceChannel, as in measure.

  • wells (Sequence[Well]) – the reference wells.

  • focal_height (float | None) – mm; the gain is adjusted at this height when adjust_focus is False; None takes the default, as in measure.

  • adjust_focus (bool) – find the focal height.

  • adjust_gain (bool) – find the gain.

  • target_percent (float) – the gain’s target, percent of the detector range (1-100).

  • monochromator (MonochromatorSettings | None) – band edges, dichroic and slits instead of the computed ones.

  • plate (Plate | None) – the plate; None uses the plate on the plate holder.

  • measurement_settings (MeasurementSettings | None) – the read’s settings: its well_scan and scan_diameter adjust over the orbit or spiral the read uses, with its flashes; the others do not apply.

  • timeout (float) – seconds the adjustment may take.

Returns:

The gain found (0 when not adjusted), the focal height found (None when not adjusted) and the well the reader fitted the gain on; pass the gain and the focal height to measure.

Raises:
  • RuntimeError – if no plate is on the plate holder.

  • ValueError – if neither is adjusted, or an argument is out of range (_get_optics).

Return type:

GainFocus