diff --git a/src/seabreeze/pyseabreeze/devices.py b/src/seabreeze/pyseabreeze/devices.py index a70e1e7..ecfe9b2 100644 --- a/src/seabreeze/pyseabreeze/devices.py +++ b/src/seabreeze/pyseabreeze/devices.py @@ -1362,3 +1362,31 @@ class ST(SeaBreezeDevice): sbf.rawusb.SeaBreezeRawUSBBusAccessFeature, sbf.nonlinearity.NonlinearityCoefficientsFeatureOBP2, ) + + +class FX(SeaBreezeDevice): + + model_name = "FX" + + # communication config + transport = (IPv4Transport,) + + ipv4_protocol = OBPProtocol + + # spectrometer config + dark_pixel_indices = DarkPixelIndices.from_ranges() + integration_time_min = 6000 + integration_time_max = 10000000 + integration_time_base = 1 + spectrum_num_pixel = 2136 + spectrum_raw_length = (2136 * 2) + 64 # XXX: Metadata + spectrum_max_value = 65535 + trigger_modes = TriggerMode.supported( + "OBP_NORMAL", "OBP_LEVEL", "OBP_EDGE", "DISABLED" + ) + + # features + feature_classes = ( + sbf.spectrometer.SeaBreezeSpectrometerFeatureFX, # need to implement this + sbf.rawusb.SeaBreezeRawUSBBusAccessFeature, + ) diff --git a/src/seabreeze/pyseabreeze/features/spectrometer.py b/src/seabreeze/pyseabreeze/features/spectrometer.py index 609a330..037b0ec 100644 --- a/src/seabreeze/pyseabreeze/features/spectrometer.py +++ b/src/seabreeze/pyseabreeze/features/spectrometer.py @@ -742,3 +742,15 @@ def get_wavelengths(self) -> NDArray[np.float_]: class SeaBreezeSpectrometerFeatureHR4(SeaBreezeSpectrometerFeatureOBP2): pass + + +class SeaBreezeSpectrometerFeatureFX(SeaBreezeSpectrometerFeatureOBP): + def _get_spectrum_raw(self) -> NDArray[np.uint8]: + timeout = int( + self._integration_time_max * 1e-3 + + self.protocol.transport.default_timeout_ms + ) + # the message type is different than the default defined in the protocol, + # requires addition of a new message type in protocol to work + datastring = self.protocol.query(0x00101000, timeout_ms=timeout) + return numpy.frombuffer(datastring, dtype=numpy.uint8)