BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
microscope.lights.sapphire.SapphireLaser Class Reference
Inheritance diagram for microscope.lights.sapphire.SapphireLaser:
microscope._utils.OnlyTriggersBulbOnSoftwareMixin microscope.abc.SerialDeviceMixin microscope.abc.LightSource microscope.abc.TriggerTargetMixin microscope.abc.TriggerTargetMixin microscope.abc.Device

Public Member Functions

def __init__ (self, com=None, baud=19200, timeout=0.5, **kwargs)
 
def send (self, command)
 
def clearFault (self)
 
def flush_buffer (self)
 
def get_status (self)
 
def initialize (self)
 
def disable (self)
 
def get_is_on (self)
 
- Public Member Functions inherited from microscope._utils.OnlyTriggersBulbOnSoftwareMixin
microscope.TriggerType trigger_type (self)
 
microscope.TriggerMode trigger_mode (self)
 
None set_trigger (self, microscope.TriggerType ttype, microscope.TriggerMode tmode)
 
- Public Member Functions inherited from microscope.abc.TriggerTargetMixin
microscope.TriggerMode trigger_mode (self)
 
microscope.TriggerType trigger_type (self)
 
None set_trigger (self, microscope.TriggerType ttype, microscope.TriggerMode tmode)
 
None trigger (self)
 
def __init__ (self, **kwargs)
 
- Public Member Functions inherited from microscope.abc.LightSource
def __init__ (self, **kwargs)
 
typing.List[str] get_status (self)
 
bool get_is_on (self)
 
float power (self)
 
None power (self, float power)
 
float get_set_power (self)
 
- Public Member Functions inherited from microscope.abc.Device
None __init__ (self)
 
None __del__ (self)
 
bool get_is_enabled (self)
 
None disable (self)
 
None enable (self)
 
None initialize (self)
 
None shutdown (self)
 
None add_setting (self, name, dtype, get_func, set_func, values, typing.Optional[typing.Callable[[], bool]] readonly=None)
 
def get_setting (self, str name)
 
def get_all_settings (self)
 
None set_setting (self, str name, value)
 
def describe_setting (self, str name)
 
def describe_settings (self)
 
def update_settings (self, incoming, bool init=False)
 

Public Attributes

 connection
 
- Public Attributes inherited from microscope.abc.SerialDeviceMixin
 connection
 
- Public Attributes inherited from microscope.abc.Device
 enabled
 

Static Public Attributes

dictionary laser_status
 

Additional Inherited Members

- Static Public Member Functions inherited from microscope.abc.SerialDeviceMixin
def lock_comms (func)
 

Detailed Description

Coherent Sapphire laser.

The Sapphire is a diode-pumped solid-state laser and only supports
`TriggerMode.SOFTWARE`.

Definition at line 34 of file sapphire.py.

Constructor & Destructor Documentation

◆ __init__()

def microscope.lights.sapphire.SapphireLaser.__init__ (   self,
  com = None,
  baud = 19200,
  timeout = 0.5,
**  kwargs 
)

Reimplemented from microscope.abc.SerialDeviceMixin.

Definition at line 55 of file sapphire.py.

55 def __init__(self, com=None, baud=19200, timeout=0.5, **kwargs):
56 # laser controller must run at 19200 baud, 8+1 bits,
57 # no parity or flow control
58 # timeout is recomended to be over 0.5
59 super().__init__(**kwargs)
60 self.connection = serial.Serial(
61 port=com,
62 baudrate=baud,
63 timeout=timeout,
64 stopbits=serial.STOPBITS_ONE,
65 bytesize=serial.EIGHTBITS,
66 parity=serial.PARITY_NONE,
67 )
68 # Turning off command prompt
69 self.send(b">=0")
70
71 # The sapphire laser turns on as soon as the key is switched
72 # on. So turn radiation off before we start.
73 self.send(b"L=0")
74
75 # Head ID value is a float point value,
76 # but only the integer part is significant
77 headID = int(float(self.send(b"?hid")))
78 _logger.info("Sapphire laser serial number: [%s]", headID)
79
80 self._max_power_mw = float(self.send(b"?maxlp"))
81 self._min_power = float(self.send(b"?minlp")) / self._max_power_mw
82
83 self.initialize()
84

Member Function Documentation

◆ clearFault()

def microscope.lights.sapphire.SapphireLaser.clearFault (   self)

Definition at line 99 of file sapphire.py.

99 def clearFault(self):
100 self.flush_buffer()
101 return self.get_status()
102

◆ disable()

def microscope.lights.sapphire.SapphireLaser.disable (   self)

◆ flush_buffer()

def microscope.lights.sapphire.SapphireLaser.flush_buffer (   self)

Definition at line 103 of file sapphire.py.

103 def flush_buffer(self):
104 line = b" "
105 while len(line) > 0:
106 line = self._readline()
107

Referenced by microscope.lights.sapphire.SapphireLaser.get_status(), microscope.lights.sapphire.SapphireLaser.initialize(), and microscope.lights.sapphire.SapphireLaser.send().

◆ get_is_on()

◆ get_status()

def microscope.lights.sapphire.SapphireLaser.get_status (   self)
Query and return the light source status.

Reimplemented from microscope.abc.LightSource.

Definition at line 109 of file sapphire.py.

109 def get_status(self):
110 result = []
111
112 status_code = self.send(b"?sta")
113 result.append(
114 (
115 "Laser status: "
116 + self.laser_status.get(status_code, "Undefined")
117 )
118 )
119
120 for cmd, stat in [
121 (b"?l", "Ligh Emission on?"),
122 (b"?t", "TEC Servo on?"),
123 (b"?k", "Key Switch on?"),
124 (b"?sp", "Target power:"),
125 (b"?p", "Measured power:"),
126 (b"?hh", "Head operating hours:"),
127 ]:
128 result.append(stat + " " + self.send(cmd).decode())
129
130 self._write(b"?fl")
131 faults = self._readline()
132 response = self._readline()
133 while response:
134 faults += b" " + response
135 response = self._readline()
136
137 result.append(faults.decode())
138 return result
139

References microscope.abc.SerialDeviceMixin._readline(), microscope.filterwheels.thorlabs.ThorlabsFilterWheel._readline(), microscope.lights.obis.ObisLaser._readline(), microscope.abc.SerialDeviceMixin._write(), microscope.lights.deepstar.DeepstarLaser._write(), microscope.lights.obis.ObisLaser._write(), microscope.lights.sapphire.SapphireLaser._write(), microscope.lights.sapphire.SapphireLaser.flush_buffer(), microscope.lights.sapphire.SapphireLaser.laser_status, microscope.lights.cobolt.CoboltLaser.send(), and microscope.lights.sapphire.SapphireLaser.send().

Referenced by microscope.lights.obis.ObisLaser.get_status(), microscope.lights.cobolt.CoboltLaser.initialize(), microscope.lights.obis.ObisLaser.initialize(), microscope.lights.sapphire.SapphireLaser.initialize(), microscope.lights.cobolt.CoboltLaser.send(), and microscope.lights.sapphire.SapphireLaser.send().

◆ initialize()

def microscope.lights.sapphire.SapphireLaser.initialize (   self)
Initialize the device.

If devices have this method (not required, and many don't),
then they should call it as part of the initialisation, i.e.,
they should call it on their `__init__` method.

Reimplemented from microscope.abc.Device.

Definition at line 148 of file sapphire.py.

148 def initialize(self):
149 self.flush_buffer()
150

References microscope.abc.SerialDeviceMixin.connection, microscope.filterwheels.thorlabs.ThorlabsFilterWheel.connection, microscope.lights.cobolt.CoboltLaser.connection, microscope.lights.deepstar.DeepstarLaser.connection, microscope.lights.obis.ObisLaser.connection, microscope.lights.sapphire.SapphireLaser.connection, microscope.lights.sapphire.SapphireLaser.flush_buffer(), microscope.abc.LightSource.get_is_on(), microscope.controllers.coolled._CoolLEDChannel.get_is_on(), microscope.controllers.lumencor._SpectraIIILightChannel.get_is_on(), microscope.controllers.toptica._iChromeLaser.get_is_on(), microscope.controllers.zaber._ZaberLED.get_is_on(), microscope.lights.cobolt.CoboltLaser.get_is_on(), microscope.lights.deepstar.DeepstarLaser.get_is_on(), microscope.lights.obis.ObisLaser.get_is_on(), microscope.lights.sapphire.SapphireLaser.get_is_on(), microscope.lights.toptica.TopticaiBeam.get_is_on(), microscope.simulators.SimulatedLightSource.get_is_on(), microscope.abc.LightSource.get_status(), microscope.controllers.coolled._CoolLEDChannel.get_status(), microscope.controllers.lumencor._SpectraIIILightChannel.get_status(), microscope.controllers.toptica._iChromeLaser.get_status(), microscope.controllers.zaber._ZaberLED.get_status(), microscope.filterwheels.aurox.Clarity.get_status(), microscope.lights.cobolt.CoboltLaser.get_status(), microscope.lights.deepstar.DeepstarLaser.get_status(), microscope.lights.obis.ObisLaser.get_status(), microscope.lights.sapphire.SapphireLaser.get_status(), microscope.lights.toptica.TopticaiBeam.get_status(), microscope.simulators.SimulatedLightSource.get_status(), microscope.stages.linkam._LinkamBase.get_status(), microscope.stages.linkam._LinkamMDSMixin.get_status(), microscope.stages.linkam.LinkamCMS.get_status(), microscope.lights.cobolt.CoboltLaser.send(), and microscope.lights.sapphire.SapphireLaser.send().

Referenced by microscope.cameras.picam.PiCamera.__init__(), microscope.cameras.ximea.XimeaCamera.__init__(), and microscope.cameras.picam.PiCamera.initialize().

◆ send()

def microscope.lights.sapphire.SapphireLaser.send (   self,
  command 
)
Send command and retrieve response.

Definition at line 93 of file sapphire.py.

93 def send(self, command):
94 """Send command and retrieve response."""
95 self._write(command)
96 return self._readline()
97

References microscope.abc.SerialDeviceMixin._readline(), microscope.filterwheels.thorlabs.ThorlabsFilterWheel._readline(), microscope.lights.obis.ObisLaser._readline(), microscope.abc.SerialDeviceMixin._write(), microscope.lights.deepstar.DeepstarLaser._write(), microscope.lights.obis.ObisLaser._write(), microscope.lights.sapphire.SapphireLaser._write(), microscope.lights.sapphire.SapphireLaser.flush_buffer(), microscope.abc.LightSource.get_status(), microscope.controllers.coolled._CoolLEDChannel.get_status(), microscope.controllers.lumencor._SpectraIIILightChannel.get_status(), microscope.controllers.toptica._iChromeLaser.get_status(), microscope.controllers.zaber._ZaberLED.get_status(), microscope.filterwheels.aurox.Clarity.get_status(), microscope.lights.cobolt.CoboltLaser.get_status(), microscope.lights.deepstar.DeepstarLaser.get_status(), microscope.lights.obis.ObisLaser.get_status(), microscope.lights.sapphire.SapphireLaser.get_status(), microscope.lights.toptica.TopticaiBeam.get_status(), microscope.simulators.SimulatedLightSource.get_status(), microscope.stages.linkam._LinkamBase.get_status(), microscope.stages.linkam._LinkamMDSMixin.get_status(), and microscope.stages.linkam.LinkamCMS.get_status().

Referenced by microscope.lights.cobolt.CoboltLaser.disable(), microscope.lights.cobolt.CoboltLaser.get_is_on(), microscope.lights.sapphire.SapphireLaser.get_is_on(), microscope.lights.cobolt.CoboltLaser.get_status(), microscope.lights.sapphire.SapphireLaser.get_status(), microscope.lights.cobolt.CoboltLaser.initialize(), microscope.lights.sapphire.SapphireLaser.initialize(), and microscope.lights.cobolt.CoboltLaser.send().

Member Data Documentation

◆ connection

◆ laser_status

dictionary microscope.lights.sapphire.SapphireLaser.laser_status
static
Initial value:
= {
b"1": "Start up",
b"2": "Warmup",
b"3": "Standby",
b"4": "Laser on",
b"5": "Laser ready",
b"6": "Error",
}

Definition at line 46 of file sapphire.py.

Referenced by microscope.lights.sapphire.SapphireLaser.get_status().


The documentation for this class was generated from the following file: