Skip to content

Commit

Permalink
final comments iva
Browse files Browse the repository at this point in the history
  • Loading branch information
johanmazoyer authored and ivalaginja committed Jul 18, 2024
1 parent c8a6ee0 commit f95d3c1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ def exposure_time(self, exposure_time: int):
This property can be used to set the exposure time of the spectrometer.
If exposure_time parameter is inferior to the minimum allowed exposure time for this
spectrometer (set by ocean optics), it is set to the minimum allowed exposure time.
If exposure_time is larger to the maximum allowed exposure time, it is set to the
minimum allowed exposure time.
If the `exposure_time` parameter is inferior to the minimum allowed exposure time for this
spectrometer (set by Ocean Optics), it is set to the minimum allowed exposure time.
If the `exposure_time` is larger than the maximum allowed exposure time, it is set to the
maximum allowed exposure time.
Parameters
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

class OceanOpticsSpectrometerSim(Service):
'''
Service for Ocean Optics Spectrometer.
This service is a wrapper around the python seabreeze package.
It provides a simple interface to control the spectrometer and acquire spectra.
Service for simulated Ocean Optics Spectrometer.
Attributes
----------
Expand Down Expand Up @@ -98,16 +95,17 @@ def main(self):
'''
while not self.should_shut_down:
intensities = self.take_one_spectrum(self.pixels_number)
self.is_saturating.submit_data(np.array([0], dtype='int8'))
self.spectra.submit_data(np.array(intensities, dtype='float32'))
self.is_saturating.submit_data(np.array([0], dtype='int8'))

self.sleep(self.interval)

def take_one_spectrum(self):
'''
Measure and return one spectrum.
Simulated service: random numpy array.
'''
return np.random.random(self.pixels_number)
return np.random.random(self.pixels_number) + 1000

@property
def wavelengths(self):
Expand Down Expand Up @@ -143,7 +141,6 @@ def exposure_time(self, exposure_time: int):
----------
exposure_time : int
The exposure time in microseconds.
'''
self._exposure_time = exposure_time

Expand Down
6 changes: 3 additions & 3 deletions docs/services/oceanoptics_spectrometer.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Ocean Optics Spectrometer
====================
=========================

This service controls an Ocean Optics Spectrometer. It is a wrapper around the python-seabreeze package.
The python-seabreeze package needs to be installed first, and the page also explain how to install the
Expand All @@ -19,8 +19,8 @@ Configuration
spectrometer:
service_type: oceanoptics_spectrometer
simulated_service_type: oceanoptics_spectrometer_sim
requires_safety: false
interface: oceanoptics_spectrometer
requires_safety: false
serial_number: USB4C01580 # Serial number of the spectrometer.
exposure_time: 1000 # Exposure time of the spectrometer in microseconds.
Expand All @@ -39,4 +39,4 @@ Datastreams
-----------
``spectra``: Spectra acquired by the camera.

``is_saturating``: If the intensity as reach the maximum value of the spectrometer.
``is_saturating``: If the intensity as reached the maximum value of the spectrometer.
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- conda-forge::pyvisa>=1.10
- conda-forge::pyvisa-py
- conda-forge::nidaqmx-python
- conda-forge::seabreeze
- pyserial
- pysnmp
- requests
Expand Down

0 comments on commit f95d3c1

Please sign in to comment.