Scanner control

class hs.control.StageController(address, fps=None, velocity=None, distance=None, scanner='auto')

A stage controller interface for the buteo to control conveyor movement and lights in conjunction with a hyperspectral camera. It is only possible to have either framerate or velocity set at a time. One will be computed from the other based on the field of view (fov) and oversampling ratio.

classmethod __new__(*args, **kwargs)
get_fps()

Get framerate.

Returns:

Framerate in frames/s.

Return type:

float

move_direction(velocity)
set_fps(fps)

Set framerate in frames/s.

set_lights_with_timer(time_ms)

Toggle lights with a timer. The lights will be on for the duration of time given in ms.

stop()
to_hs_image()

Convert to Image.

Returns:

Hyperspectral image.

Return type:

Image

toggle_lights(on)

Toggle lights on/off

__module__ = 'builtins'
distance

Get distance.

Returns:

Distance in mm.

Return type:

float

focal_length

Get the lens focal length in mm.

hs_camera

Get the HSCamera.

Returns:

Hyper spectral camera.

Return type:

Camera

object_distance

Get the lens-to-object distance in mm.

oversampling

Get the oversampling ratio for the buteo’s stage controller.

Returns:

Oversampling ratio or None if not set.

Return type:

Optional[float]

pixel_fov

Get the along-track pixel FOV at the object plane, in mm.

pixel_pitch

Get the sensor pixel pitch in µm.

slit_fov

Get the cross-track slit FOV at the object plane, in mm.

slit_width

Get the entrance slit width in µm.

stage_machine

Get the stage machine

Returns:

Stage machine controller

Return type:

StageMachine

velocity

Get Velocity.

Returns:

Velocity in mm/s.

Return type:

float

class hs.control.SimulatedStageController(image, fps=None, velocity=None, distance=None)

A stage-controller-compatible simulation backed by an image camera.

Motion and light commands are accepted as no-ops so Python code can swap this type with StageController by duck typing.

classmethod __new__(*args, **kwargs)
get_fps()

Get framerate.

Returns:

Framerate in frames/s.

Return type:

float

move_direction(velocity)

Move the simulated stage continuously in a direction.

set_fps(fps)

Set framerate in frames/s.

set_lights_with_timer(time_ms)

Toggle lights with a timer. The simulated lights will be on for the duration of time given in ms.

stop()

Stop simulated stage motion.

to_hs_image()

Convert to Image.

Returns:

Hyperspectral image.

Return type:

Image

toggle_lights(on)

Toggle simulated lights on/off.

__module__ = 'builtins'
distance

Get distance.

Returns:

Distance in mm.

Return type:

float

focal_length

Get the lens focal length in mm.

hs_camera

Get the HSCamera.

Returns:

Hyper spectral camera.

Return type:

Camera

object_distance

Get the lens-to-object distance in mm.

oversampling

Get the oversampling ratio for the simulated stage controller.

Returns:

Oversampling ratio or None if not set.

Return type:

Optional[float]

pixel_fov

Get the along-track pixel FOV at the object plane, in mm.

pixel_pitch

Get the sensor pixel pitch in µm.

slit_fov

Get the cross-track slit FOV at the object plane, in mm.

slit_width

Get the entrance slit width in µm.

velocity

Get Velocity.

Returns:

Velocity in mm/s.

Return type:

float

class hs.control.StageMachine(address)

The stage/scanner interface type.

This type can represent different scanning machines behind a single dynamic interface.

classmethod __new__(*args, **kwargs)
move_direction(velocity)

Move the stage continuously in a direction.

Parameters:

velocity (float) – Velocity in mm/s. Sign determines direction.

move_distance(dist, velocity)

Move the stage a fixed distance at the given velocity.

Parameters:
  • dist (float) – Distance to move in mm.

  • velocity (float) – Velocity in mm/s.

set_lights_with_timer(delay_ms)

Toggle lights with a timer. The lights will be on for the given duration.

Parameters:

delay_ms (int) – Duration in milliseconds.

stop()

Stop stage motion.

toggle_lights(on)

Toggle lights on or off.

Parameters:

on (bool) – True to turn lights on, False to turn them off.

__module__ = 'builtins'
name

Get the device name.

Returns:

Name of the stage machine.

Return type:

str