skutils 0.3.4__tar.gz → 0.4.0__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 (41) hide show
  1. {skutils-0.3.4 → skutils-0.4.0}/PKG-INFO +1 -1
  2. {skutils-0.3.4 → skutils-0.4.0}/pyproject.toml +1 -1
  3. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/ChickadeeController.py +43 -1
  4. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/FemtoDAQController.py +30 -0
  5. {skutils-0.3.4 → skutils-0.4.0}/src/skutils.egg-info/PKG-INFO +1 -1
  6. {skutils-0.3.4 → skutils-0.4.0}/LICENSE +0 -0
  7. {skutils-0.3.4 → skutils-0.4.0}/README.md +0 -0
  8. {skutils-0.3.4 → skutils-0.4.0}/requirements-dev.txt +0 -0
  9. {skutils-0.3.4 → skutils-0.4.0}/requirements.txt +0 -0
  10. {skutils-0.3.4 → skutils-0.4.0}/setup.cfg +0 -0
  11. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/CollectorNodeController.py +0 -0
  12. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/GretinaFileWriter.py +0 -0
  13. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/GretinaMmapWriter.py +0 -0
  14. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/GretinaUdpWriter.py +0 -0
  15. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/BaseLoader.py +0 -0
  16. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/EventCSVLoader.py +0 -0
  17. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/GretaLoader.py +0 -0
  18. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/GretinaLoader.py +0 -0
  19. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/IGORPulseHeightLoader.py +0 -0
  20. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/IGORWaveLoader.py +0 -0
  21. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/LegacyGretinaLoader.py +0 -0
  22. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/__init__.py +0 -0
  23. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/Loaders/quickLoad.py +0 -0
  24. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/SolidagoController.py +0 -0
  25. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/__init__.py +0 -0
  26. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/cli/old/a.py +0 -0
  27. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/cli/old/common.py +0 -0
  28. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/cli/old/femtodaq_remote_update.py +0 -0
  29. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/cli/old/femtodaq_remote_update_gui.py +0 -0
  30. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/constants.py +0 -0
  31. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/helpers/HitPatternBuilder.py +0 -0
  32. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/helpers/__init__.py +0 -0
  33. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/helpers/internal_solidago_helpers.py +0 -0
  34. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/helpers/parallel.py +0 -0
  35. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/py.typed +0 -0
  36. {skutils-0.3.4 → skutils-0.4.0}/src/skutils/quickPlotEvent.py +0 -0
  37. {skutils-0.3.4 → skutils-0.4.0}/src/skutils.egg-info/SOURCES.txt +0 -0
  38. {skutils-0.3.4 → skutils-0.4.0}/src/skutils.egg-info/dependency_links.txt +0 -0
  39. {skutils-0.3.4 → skutils-0.4.0}/src/skutils.egg-info/entry_points.txt +0 -0
  40. {skutils-0.3.4 → skutils-0.4.0}/src/skutils.egg-info/requires.txt +0 -0
  41. {skutils-0.3.4 → skutils-0.4.0}/src/skutils.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skutils
3
- Version: 0.3.4
3
+ Version: 0.4.0
4
4
  Summary: SkuTek Instrumentation utilities for control, orchestration, and data analysis using SkuTek products
5
5
  Author-email: SkuTek Instrumentation <support@skutek.com>
6
6
  Maintainer-email: Hugh Gallo <hugh@skutek.com>, Jeff Maggio <jeff@skutek.com>, SkuTek Instrumentation <support@skutek.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
  [project]
5
5
  license = "BSD-3-Clause"
6
6
  name = "skutils"
7
- version = "0.3.4"
7
+ version = "0.4.0"
8
8
  requires-python = ">=3.9"
9
9
  authors = [{ name = "SkuTek Instrumentation", email = "support@skutek.com" }]
10
10
  maintainers = [
@@ -251,7 +251,8 @@ class ChickadeeDspRemote(Namespace):
251
251
  #: url for setting/reading DSP signals
252
252
  self.control_url = hostname_or_ip + '/dsp/control'
253
253
  #: url for grabbing waveforms
254
- self.wave_url = hostname_or_ip + '/dsp/wavedata'
254
+ self.wave_url = hostname_or_ip + '/dsp/wavedata'
255
+ self.spy_wave_url = hostname_or_ip + '/dsp/spy_wavedata'
255
256
  #: whether or not to automatically write to registers when
256
257
  # :py:meth:`.close` is callsed
257
258
  self.auto_write_on_close = auto_write_on_close
@@ -330,6 +331,27 @@ class ChickadeeDspRemote(Namespace):
330
331
  wavedata = np.asarray(resp_data['wavedata'])
331
332
  return wavedata
332
333
 
334
+ # _________________________________________________________________________
335
+ def read_spy_wave(self, channel:Union[int,Literal['all']], as_binary=True):
336
+ """Reads the SPY waveform for the specified channel as a numpy array
337
+
338
+ This returns the waveform "as is" currently in the FPGA buffer. User
339
+ is responsible for checking if event capture is ongoing. Check your Chickadee
340
+ manual for details.
341
+
342
+ :param channel: desired channel waveform
343
+ :param as_binary: True to read the wavedata as b64 encoded string, False to use a json list
344
+ """
345
+ url = self.spy_wave_url + f'/{channel}'
346
+ payload = {'waveform_as_base64':as_binary}
347
+ resp = requests.get(url, json=payload)
348
+ resp_data = resp.json()
349
+ if resp_data['waveform_as_base64']:
350
+ wavedata = pickle.loads( base64.standard_b64decode(resp_data['wavedata'].encode('utf-8')) )
351
+ else:
352
+ wavedata = np.asarray(resp_data['wavedata'])
353
+ return wavedata
354
+
333
355
  # _________________________________________________________________________
334
356
  def read_all_waves(self, num_waveform_samples:Optional[int]=None, as_binary=True):
335
357
  """Reads the waveforms for all channels as 2D numpy array.
@@ -565,6 +587,26 @@ class ChickadeeController:
565
587
  raise RuntimeError("The server failed to return a bool for adc_firmware_invert!")
566
588
  return bool_val
567
589
 
590
+ # _________________________________________________________________________
591
+ def arbitrary_reg_read(self, reg_address: int) -> int:
592
+ req = requests.post(self.address + "/sw_api/arbitrary_reg_read", json={"reg_address": reg_address})
593
+ self.__report_json_error(req)
594
+ json_block = req.json()
595
+ int_val = json_block["read_value"]
596
+ if not isinstance(int_val, int):
597
+ raise RuntimeError("The server failed to return an int for read_value!")
598
+ return int_val
599
+
600
+ # _________________________________________________________________________
601
+ def arbitrary_reg_write_with_readback(self, reg_address: int, value: int) -> int:
602
+ req = requests.post(self.address + "/sw_api/arbitrary_reg_write_with_readback", json={"reg_address": reg_address, "value": value})
603
+ self.__report_json_error(req)
604
+ json_block = req.json()
605
+ int_val = json_block["readback_value"]
606
+ if not isinstance(int_val, int):
607
+ raise RuntimeError("The server failed to return an int for readback_value!")
608
+ return int_val
609
+
568
610
  # _________________________________________________________________________
569
611
  @property
570
612
  def address(self) -> str:
@@ -293,6 +293,36 @@ class FemtoDAQController:
293
293
  data = {f"enable": enable, "force": force}
294
294
  self.__post(route, data)
295
295
 
296
+ # _________________________________________________________________________
297
+ # TriggerType
298
+ def getTriggerType(self) -> str:
299
+ """
300
+ Get what type of trigger is currently set for the digitizer.
301
+ "diff_smooth" is the default trigger for Vireo: a differential trigger that can be (optionally) smoothed by Trigger Averaging
302
+ "simple" is a threshold trigger on the digitally-offset ADC samples only.
303
+ """
304
+ route = self.__config_url("global", "TriggerType")
305
+ resp = self.__get(route)
306
+ return str(resp["data"])
307
+
308
+ def setTriggerType(
309
+ self,
310
+ trg_type: Union[Union[Literal["diff_smooth"], Literal["simple"]], int],
311
+ force: bool = False,
312
+ ):
313
+ """
314
+ Set what type of trigger is currently used on the digitizer.
315
+
316
+ :param trg_type: "diff_smooth" is the default trigger for Vireo: a differential trigger that can be (optionally) smoothed by Trigger Averaging. "simple" is a threshold trigger on the digitally-offset ADC samples only.
317
+ :param force: apply change even if data collection is ongoing.
318
+ """
319
+ route = self.__config_url("global", "TriggerType")
320
+ data: Dict[str, Any] = {
321
+ f"trg_type": trg_type,
322
+ "force": force,
323
+ }
324
+ self.__post(route, data)
325
+
296
326
  # _________________________________________________________________________
297
327
  # TriggerEdge
298
328
  def getTriggerEdge(self, channel: int) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skutils
3
- Version: 0.3.4
3
+ Version: 0.4.0
4
4
  Summary: SkuTek Instrumentation utilities for control, orchestration, and data analysis using SkuTek products
5
5
  Author-email: SkuTek Instrumentation <support@skutek.com>
6
6
  Maintainer-email: Hugh Gallo <hugh@skutek.com>, Jeff Maggio <jeff@skutek.com>, SkuTek Instrumentation <support@skutek.com>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes