wasatch 2.2.13__tar.gz → 2.2.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. {wasatch-2.2.13 → wasatch-2.2.14}/CHANGELOG.md +13 -0
  2. {wasatch-2.2.13 → wasatch-2.2.14}/PKG-INFO +1 -1
  3. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/AndorDevice.py +16 -16
  4. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/AutoRamanRequest.py +20 -0
  5. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/DeviceFinderUSB.py +3 -3
  6. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/EEPROM.py +218 -118
  7. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/FeatureIdentificationDevice.py +32 -15
  8. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/SPIDevice.py +2 -2
  9. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/SpectrometerSettings.py +34 -188
  10. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/SpectrometerState.py +1 -0
  11. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/WasatchBus.py +2 -2
  12. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/__init__.py +1 -1
  13. {wasatch-2.2.13 → wasatch-2.2.14}/.example_pypirc +0 -0
  14. {wasatch-2.2.13 → wasatch-2.2.14}/.flake8 +0 -0
  15. {wasatch-2.2.13 → wasatch-2.2.14}/.gitignore +0 -0
  16. {wasatch-2.2.13 → wasatch-2.2.14}/.pylintrc +0 -0
  17. {wasatch-2.2.13 → wasatch-2.2.14}/Doxyfile +0 -0
  18. {wasatch-2.2.13 → wasatch-2.2.14}/LICENSE +0 -0
  19. {wasatch-2.2.13 → wasatch-2.2.14}/MANIFEST.in +0 -0
  20. {wasatch-2.2.13 → wasatch-2.2.14}/Makefile +0 -0
  21. {wasatch-2.2.13 → wasatch-2.2.14}/README.md +0 -0
  22. {wasatch-2.2.13 → wasatch-2.2.14}/README_PYPI.md +0 -0
  23. {wasatch-2.2.13 → wasatch-2.2.14}/README_RPI.md +0 -0
  24. {wasatch-2.2.13 → wasatch-2.2.14}/README_SETTINGS.md +0 -0
  25. {wasatch-2.2.13 → wasatch-2.2.14}/README_VIRTUAL.md +0 -0
  26. {wasatch-2.2.13 → wasatch-2.2.14}/WasatchShell/README.md +0 -0
  27. {wasatch-2.2.13 → wasatch-2.2.14}/WasatchShell/laser-test.py +0 -0
  28. {wasatch-2.2.13 → wasatch-2.2.14}/WasatchShell/load-test.py +0 -0
  29. {wasatch-2.2.13 → wasatch-2.2.14}/WasatchShell/one-shot.py +0 -0
  30. {wasatch-2.2.13 → wasatch-2.2.14}/WasatchShell/wasatch-shell.py +0 -0
  31. {wasatch-2.2.13 → wasatch-2.2.14}/demo-auto-raman.py +0 -0
  32. {wasatch-2.2.13 → wasatch-2.2.14}/demo-simple.py +0 -0
  33. {wasatch-2.2.13 → wasatch-2.2.14}/demo-virtual.py +0 -0
  34. {wasatch-2.2.13 → wasatch-2.2.14}/demo-workflow.py +0 -0
  35. {wasatch-2.2.13 → wasatch-2.2.14}/demo.py +0 -0
  36. {wasatch-2.2.13 → wasatch-2.2.14}/environments/conda-linux.yml +0 -0
  37. {wasatch-2.2.13 → wasatch-2.2.14}/environments/conda-macos.yml +0 -0
  38. {wasatch-2.2.13 → wasatch-2.2.14}/environments/conda-rpi.yml +0 -0
  39. {wasatch-2.2.13 → wasatch-2.2.14}/environments/conda-win10.yml +0 -0
  40. {wasatch-2.2.13 → wasatch-2.2.14}/pyproject.toml +0 -0
  41. {wasatch-2.2.13 → wasatch-2.2.14}/requirements.txt +0 -0
  42. {wasatch-2.2.13 → wasatch-2.2.14}/screenshots/multiplatform.png +0 -0
  43. {wasatch-2.2.13 → wasatch-2.2.14}/scripts/dark-vs-integ.py +0 -0
  44. {wasatch-2.2.13 → wasatch-2.2.14}/scripts/deploy +0 -0
  45. {wasatch-2.2.13 → wasatch-2.2.14}/setup.cfg +0 -0
  46. {wasatch-2.2.13 → wasatch-2.2.14}/testSpectrometers/SiG_785/eeprom/EEPROM-EM-9c65d19f4c.json +0 -0
  47. {wasatch-2.2.13 → wasatch-2.2.14}/testSpectrometers/SiG_785/readings/enlighten-20210329-094722-799520-WP-00686.csv +0 -0
  48. {wasatch-2.2.13 → wasatch-2.2.14}/testSpectrometers/SiG_785/readings/enlighten-20210329-094755-288958-WP-00686.csv +0 -0
  49. {wasatch-2.2.13 → wasatch-2.2.14}/testSpectrometers/WP-00887/eeprom/WP-00887-mock.json +0 -0
  50. {wasatch-2.2.13 → wasatch-2.2.14}/testSpectrometers/WP-00904/eeprom/WP-00904-mock.json +0 -0
  51. {wasatch-2.2.13 → wasatch-2.2.14}/testSpectrometers/WP-00913/eeprom/WP-00913-mock.json +0 -0
  52. {wasatch-2.2.13 → wasatch-2.2.14}/tests/existing_implementations.py +0 -0
  53. {wasatch-2.2.13 → wasatch-2.2.14}/tests/noise-by-setpoint.py +0 -0
  54. {wasatch-2.2.13 → wasatch-2.2.14}/tests/queues.py +0 -0
  55. {wasatch-2.2.13 → wasatch-2.2.14}/tests/unit.py +0 -0
  56. {wasatch-2.2.13 → wasatch-2.2.14}/udev/10-wasatch.rules +0 -0
  57. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/AbstractUSBDevice.py +0 -0
  58. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/AutoRaman.py +0 -0
  59. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/BLEDevice.py +0 -0
  60. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/BalanceAcquisition.py +0 -0
  61. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/CSVLoader.py +0 -0
  62. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/CommandSettings.py +0 -0
  63. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/ControlObject.py +0 -0
  64. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/DetectorROI.py +0 -0
  65. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/DetectorRegions.py +0 -0
  66. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/DeviceID.py +0 -0
  67. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/EEPROM_multical.sav +0 -0
  68. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/FPGAOptions.py +0 -0
  69. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/FirmwareRequirements.py +0 -0
  70. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/HardwareInfo.py +0 -0
  71. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/IMX385.py +0 -0
  72. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/InterfaceDevice.py +0 -0
  73. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/MockUSBDevice.py +0 -0
  74. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/OceanDevice.py +0 -0
  75. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/PollStatus.py +0 -0
  76. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/ProcessedReading.py +0 -0
  77. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/ROI.py +0 -0
  78. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/Reading.py +0 -0
  79. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/RealUSBDevice.py +0 -0
  80. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/SpectrometerRequest.py +0 -0
  81. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/SpectrometerResponse.py +0 -0
  82. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/StatusMessage.py +0 -0
  83. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/TakeOneRequest.py +0 -0
  84. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/WasatchDevice.py +0 -0
  85. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/WasatchDeviceWrapper.py +0 -0
  86. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/WrapperWorker.py +0 -0
  87. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/applog.py +0 -0
  88. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/simulation_protocol.py +0 -0
  89. {wasatch-2.2.13 → wasatch-2.2.14}/wasatch/utils.py +0 -0
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ - 2024-11-25 2.2.14
4
+ - EEPROM
5
+ - added subformat 5 (EEPROM.MultiWavelengthCalibration)
6
+ - bumped rev to 17
7
+ - deprecated subformat 4 (regions)
8
+ - SpectrometerSettings
9
+ - deprecated integer excitation_nm
10
+ - moved vertical ROI to wasatch.ROI
11
+ - added calibrations(), select_calibration(n)
12
+ - FeatureInterfaceDevice
13
+ - added set/get_scans_to_average
14
+ - SpectrometerState
15
+ - added onboard_averaging
3
16
  - 2024-11-01 2.2.13
4
17
  - support for InGaAs linear pixel calibration
5
18
  - re-enable STM32 serial number
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wasatch
3
- Version: 2.2.13
3
+ Version: 2.2.14
4
4
  Summary: This package is a driver for Wasatch Photonics spectrometers
5
5
  Author-email: Wasatch Photonics <edort@wasatchphotonics.com>
6
6
  Description-Content-Type: text/markdown
@@ -47,7 +47,7 @@ class AndorDevice(InterfaceDevice):
47
47
  SUCCESS = 20002 #!< see load_error_codes()
48
48
  SHUTTER_SPEED_MS = 50 #!< allow time for mechanical shutter to stabilize
49
49
 
50
- def __init__(self, device_id, message_queue=None, alert_queue=None): # -> None
50
+ def __init__(self, device_id, message_queue=None, alert_queue=None):
51
51
  # if passed a string representation of a DeviceID, deserialize it
52
52
  super().__init__()
53
53
  if type(device_id) is str:
@@ -141,7 +141,7 @@ class AndorDevice(InterfaceDevice):
141
141
  # Private Methods
142
142
  ###############################################################
143
143
 
144
- def _init_process_funcs(self): # -> dict[str, Callable[..., Any]]
144
+ def _init_process_funcs(self):
145
145
  process_f = {}
146
146
 
147
147
  process_f["connect"] = self.connect
@@ -169,7 +169,7 @@ class AndorDevice(InterfaceDevice):
169
169
 
170
170
  return process_f
171
171
 
172
- def high_gain_mode_enable(self, enabled: bool): # -> SpectrometerResponse
172
+ def high_gain_mode_enable(self, enabled):
173
173
  if enabled:
174
174
  result = self.driver.SetPreAmpGain(self.gain_idx[-1])
175
175
  assert(self.SUCCESS == result), f"unable to set detector gain, got value of {result}"
@@ -182,21 +182,21 @@ class AndorDevice(InterfaceDevice):
182
182
  return
183
183
 
184
184
  # MZ: nothing seems to call this?
185
- def _update_wavelength_coeffs(self, coeffs: list[float]): # -> None
185
+ def _update_wavelength_coeffs(self, coeffs):
186
186
  self.settings.eeprom.wavelength_coeffs = coeffs
187
187
  self.config_values['wavelength_coeffs'] = coeffs
188
188
  self.save_config()
189
189
 
190
- def set_fan_enable(self, x: bool): # -> SpectrometerResponse
190
+ def set_fan_enable(self, x):
191
191
  self.check_result(self.driver.SetFanMode(int(x)), f"Andor Fan On {x}")
192
192
  return SpectrometerResponse()
193
193
 
194
- def _get_default_data_dir(self): # -> str
194
+ def _get_default_data_dir(self):
195
195
  if os.name == "nt":
196
196
  return os.path.join(os.path.expanduser("~"), "Documents", "EnlightenSpectra")
197
197
  return os.path.join(os.environ["HOME"], "EnlightenSpectra")
198
198
 
199
- def _check_config_file(self): # -> bool
199
+ def _check_config_file(self):
200
200
  self.config_dir = os.path.join(self._get_default_data_dir(), 'config')
201
201
  self.config_file = os.path.join(self.config_dir, self.serial + '.json')
202
202
  if not os.path.exists(self.config_dir):
@@ -336,12 +336,12 @@ class AndorDevice(InterfaceDevice):
336
336
  # reading.dump_area_scan()
337
337
  return SpectrometerResponse(data=reading)
338
338
 
339
- def _close_ex_shutter(self): # -> SpectrometerResponse
339
+ def _close_ex_shutter(self):
340
340
  self.check_result(self.driver.SetShutterEx(1, 1, self.SHUTTER_SPEED_MS, self.SHUTTER_SPEED_MS, 2), "SetShutterEx(2)")
341
341
  self.settings.state.shutter_enabled = False
342
342
  return SpectrometerResponse(True)
343
343
 
344
- def _open_ex_shutter(self): # -> SpectrometerResponse
344
+ def _open_ex_shutter(self):
345
345
  self.check_result(self.driver.SetShutterEx(1, 1, self.SHUTTER_SPEED_MS, self.SHUTTER_SPEED_MS, 1), "SetShutterEx(1)")
346
346
  self.settings.state.shutter_enabled = True
347
347
  return SpectrometerResponse(True)
@@ -358,7 +358,7 @@ class AndorDevice(InterfaceDevice):
358
358
  raise RuntimeError(msg)
359
359
  log.debug(f"successfully called {func}")
360
360
 
361
- def connect(self): # -> SpectrometerResponse
361
+ def connect(self):
362
362
  if self.dll_fail:
363
363
  return SpectrometerResponse(False, error_msg="can't find Andor DLL; please confirm Andor Driver Pack 2 installed")
364
364
 
@@ -490,17 +490,17 @@ class AndorDevice(InterfaceDevice):
490
490
  if 'startup_temp_degC' in self.config_values:
491
491
  self.set_tec_setpoint(self.settings.eeprom.startup_temp_degC)
492
492
 
493
- def acquire_data(self): # -> SpectrometerResponse
493
+ def acquire_data(self):
494
494
  reading = self._take_one_averaged_reading()
495
495
  return reading
496
496
 
497
- def set_shutter_enable(self, enable: bool): # -> SpectrometerResponse
497
+ def set_shutter_enable(self, enable):
498
498
  if enable:
499
499
  return self._open_ex_shutter()
500
500
  else:
501
501
  return self._close_ex_shutter()
502
502
 
503
- def set_integration_time_ms(self, ms: float): # -> SpectrometerResponse
503
+ def set_integration_time_ms(self, ms):
504
504
  self.integration_time_ms = ms
505
505
  log.debug(f"setting integration time to {self.integration_time_ms}ms")
506
506
 
@@ -566,7 +566,7 @@ class AndorDevice(InterfaceDevice):
566
566
  self.check_result(self.driver.SetTemperature(self.setpoint_deg_c), f"SetTemperature({self.setpoint_deg_c})")
567
567
  return SpectrometerResponse(True)
568
568
 
569
- def init_detector_area(self): # -> SpectrometerResponse
569
+ def init_detector_area(self):
570
570
  xPixels = c_int()
571
571
  yPixels = c_int()
572
572
  self.check_result(self.driver.GetDetector(byref(xPixels), byref(yPixels)), "GetDetector(x, y)")
@@ -592,7 +592,7 @@ class AndorDevice(InterfaceDevice):
592
592
  self.gain_options = self.gain_options[::-1]
593
593
  log.debug(f"obtained gain options for spec, values were {self.gain_options}")
594
594
 
595
- def init_detector_speed(self): # -> SpectrometerResponse
595
+ def init_detector_speed(self):
596
596
  speed = c_float()
597
597
 
598
598
  # for CCDs, set vertical to recommended
@@ -623,7 +623,7 @@ class AndorDevice(InterfaceDevice):
623
623
  log.debug(f"set AD channel {ADnumber} with horizontal speed {HSnumber} ({STemp})")
624
624
  return SpectrometerResponse(True)
625
625
 
626
- def scans_to_average(self, value: int): # -> SpectrometerResponse
626
+ def scans_to_average(self, value):
627
627
  self.sum_count = 0
628
628
  self.settings.state.scans_to_average = int(value)
629
629
  return SpectrometerResponse(True)
@@ -74,3 +74,23 @@ class AutoRamanRequest:
74
74
  buf.extend([self.saturation & 0xff, (self.saturation >> 8) & 0xff])
75
75
  buf.extend([self.max_avg & 0xff ])
76
76
  return buf
77
+
78
+ if __name__ == "__main__":
79
+ aar = AutoRamanRequest(
80
+ max_ms = 10000,
81
+ start_integ_ms = 100,
82
+ start_gain_db = 0,
83
+ max_integ_ms = 2000,
84
+ min_integ_ms = 10,
85
+ max_gain_db = 32,
86
+ min_gain_db = 0,
87
+ target_counts = 45000,
88
+ max_counts = 50000,
89
+ min_counts = 40000,
90
+ max_factor = 5,
91
+ drop_factor = 0.8,
92
+ saturation = 65000,
93
+ max_avg = 100)
94
+
95
+ buf = aar.serialize()
96
+ print("0x" + " ".join([f"{b:02x}" for b in buf]))
@@ -161,14 +161,14 @@ class DeviceFinderUSB:
161
161
  return [DeviceID(device) for device in pyusb_devices]
162
162
 
163
163
  def find_usb_devices(self, poll = False):
164
- log.debug("DeviceFinderUSB.find_usb_devices: starting")
164
+ # log.debug("DeviceFinderUSB.find_usb_devices: starting")
165
165
  device_ids = []
166
166
 
167
167
  # MZ/ED: If USE_MONITORING is True, I had to disable the call to remove_all in enlighten.Controller
168
168
  if self.startup_scan < self.MIN_POLLING_SCANS or not self.USE_MONITORING or poll:
169
169
  # our first few scans should always be a bus poll
170
170
  # this is because no events will be registered
171
- log.debug(f"DeviceFinderUSB.find_usb_devices: just doing a bus poll for startup_scan {self.startup_scan}")
171
+ # log.debug(f"DeviceFinderUSB.find_usb_devices: just doing a bus poll for startup_scan {self.startup_scan}")
172
172
  device_ids = self.bus_polling()
173
173
  self.startup_scan += 1
174
174
  elif platform.system() == "Windows":
@@ -177,7 +177,7 @@ class DeviceFinderUSB:
177
177
  device_ids = self.linux_monitoring()
178
178
  else:
179
179
  device_ids = self.bus_polling()
180
- log.debug(f"DeviceFinderUSB.find_usb_devices: returning {len(device_ids)} devices")
180
+ # log.debug(f"DeviceFinderUSB.find_usb_devices: returning {len(device_ids)} devices")
181
181
  return device_ids
182
182
 
183
183
  def mac_monitoring(self):