epicsdev 3.2.1__tar.gz → 3.2.2__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 (33) hide show
  1. {epicsdev-3.2.1 → epicsdev-3.2.2}/PKG-INFO +1 -1
  2. {epicsdev-3.2.1 → epicsdev-3.2.2}/docs/using_imagegen.md +25 -0
  3. {epicsdev-3.2.1 → epicsdev-3.2.2}/epicsdev/epicsdev.py +2 -2
  4. {epicsdev-3.2.1 → epicsdev-3.2.2}/epicsdev/imagegen.py +7 -3
  5. {epicsdev-3.2.1 → epicsdev-3.2.2}/pyproject.toml +1 -1
  6. {epicsdev-3.2.1 → epicsdev-3.2.2}/.github/copilot-instructions.md +0 -0
  7. {epicsdev-3.2.1 → epicsdev-3.2.2}/LICENSE +0 -0
  8. {epicsdev-3.2.1 → epicsdev-3.2.2}/README.md +0 -0
  9. {epicsdev-3.2.1 → epicsdev-3.2.2}/config/epicsSimscope_pp.py +0 -0
  10. {epicsdev-3.2.1 → epicsdev-3.2.2}/config/epicsdev.bob +0 -0
  11. {epicsdev-3.2.1 → epicsdev-3.2.2}/config/epicsdev_pp.py +0 -0
  12. {epicsdev-3.2.1 → epicsdev-3.2.2}/docs/epicsdev_pvplot.jpg +0 -0
  13. {epicsdev-3.2.1 → epicsdev-3.2.2}/docs/epicsdev_pypet.png +0 -0
  14. {epicsdev-3.2.1 → epicsdev-3.2.2}/docs/imagegen.jpg +0 -0
  15. {epicsdev-3.2.1 → epicsdev-3.2.2}/docs/modules.md +0 -0
  16. {epicsdev-3.2.1 → epicsdev-3.2.2}/docs/phoebus_epicsdev.jpg +0 -0
  17. {epicsdev-3.2.1 → epicsdev-3.2.2}/epicsdev/__init__.py +0 -0
  18. {epicsdev-3.2.1 → epicsdev-3.2.2}/epicsdev/putlog.py +0 -0
  19. {epicsdev-3.2.1 → epicsdev-3.2.2}/examples/ai_imagegen.py +0 -0
  20. {epicsdev-3.2.1 → epicsdev-3.2.2}/examples/ndarray_server.py +0 -0
  21. {epicsdev-3.2.1 → epicsdev-3.2.2}/examples/ntndarray_server.py +0 -0
  22. {epicsdev-3.2.1 → epicsdev-3.2.2}/examples/process_external_waveform.py +0 -0
  23. {epicsdev-3.2.1 → epicsdev-3.2.2}/fallback/epicsdev-300.py +0 -0
  24. {epicsdev-3.2.1 → epicsdev-3.2.2}/fallback/multiadc-v311.py +0 -0
  25. {epicsdev-3.2.1 → epicsdev-3.2.2}/fallback/multiadc.py +0 -0
  26. {epicsdev-3.2.1 → epicsdev-3.2.2}/fallback/multiadc1_pp.py +0 -0
  27. {epicsdev-3.2.1 → epicsdev-3.2.2}/fallback/multiadc_pp.py +0 -0
  28. {epicsdev-3.2.1 → epicsdev-3.2.2}/new/README.md +0 -0
  29. {epicsdev-3.2.1 → epicsdev-3.2.2}/new/epicsdev.py +0 -0
  30. {epicsdev-3.2.1 → epicsdev-3.2.2}/new/multiadc.py +0 -0
  31. {epicsdev-3.2.1 → epicsdev-3.2.2}/new/pyproject.toml +0 -0
  32. {epicsdev-3.2.1 → epicsdev-3.2.2}/prompts/image_initial +0 -0
  33. {epicsdev-3.2.1 → epicsdev-3.2.2}/prompts/prompt_epics_development_with_python +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epicsdev
3
- Version: 3.2.1
3
+ Version: 3.2.2
4
4
  Summary: Helper module for creating EPICS PVAccess servers using p4p
5
5
  Project-URL: Homepage, https://github.com/ASukhanov/epicsdev
6
6
  Project-URL: Bug Tracker, https://github.com/ASukhanov/epicsdev
@@ -22,4 +22,29 @@ iface.put('image0:noiseLevel',100); show()
22
22
  Click ROI and position the region of interest.
23
23
  Click Color gradient and select 'flame'.
24
24
 
25
+ Monitoring example:
26
+ ```python
27
+ def cb(value):
28
+ #print(f'value: {type(value),value}')
29
+ imageView.setImage(value.T, scale=(10,1))
30
+
31
+ subscribtion = iface.monitor('image0:image',cb)
32
+
33
+ # Now the image will be redrawn if its parameters gets changed
34
+ iface.put('image0:gridScaleX', .5)
35
+ iface.put('image0:gridScaleX', 1)
36
+ ```
37
+ # animation, controlled from separate process
38
+ In another terminal start python interpreter with following code:
39
+ ```python
40
+ import time, numpy as np
41
+ from p4p.client.thread import Context
42
+ iface = Context('pva')
43
+
44
+ oneTo0 = 1 - np.linspace(0,1,11)
45
+ scales = np.append(oneTo0[:-1], np.flip(oneTo0)[2:])
46
+ for scale in scales:
47
+ iface.put('image0:gridScaleX',scale)
48
+ time.sleep(.1)
49
+ ```
25
50
  ![imageView](./imagegen.jpg)
@@ -1,6 +1,6 @@
1
1
  """Helper functions for creating EPICS PVAccess server"""
2
2
  # pylint: disable=invalid-name
3
- __version__= 'v3.2.1 26-03-28'# Env. variable OPERATIONS is used for default autosave directory
3
+ __version__= 'v3.2.2 26-04-11'# Notification about autosave permission.
4
4
  #TODO: Add CBOR-encoded PVs representing arbitrary Python objects, that can be used for storing complex data structures, such as dictionaries, numpy arrays. That will be more efficient than using multiple PVs for each parameter, and more flexible than using JSON-encoded strings.
5
5
 
6
6
  import sys
@@ -450,7 +450,7 @@ def init_epicsdev(prefix:str, pvDefs:list, verbose=0, serverStateChanged=None,
450
450
  try:
451
451
  os.makedirs(autosaveDir, exist_ok=True)
452
452
  except PermissionError:
453
- printe(f'Permission denied to create {autosaveDir}. Use --autosave option.')
453
+ printe(f'Permission denied to create {autosaveDir}. You can define the root directory in OPERATIONS environment variable or disable autosaving.')
454
454
  sys.exit(1)
455
455
  autosaveFile = os.path.join(autosaveDir, f'{prefix[:-1]}.cache')
456
456
  C_.cachefd = open(autosaveFile, 'w')
@@ -7,13 +7,14 @@ the underlying blob pattern.
7
7
  PVs representing image rows and statistics PVs are updated periodically.
8
8
  """
9
9
  # pylint: disable=invalid-name
10
- __version__= 'v0.1.0 26-04-07'# added plobSigmaX and Y.
11
- import argparse
10
+ __version__= 'v0.1.1 26-04-11'# gridCsalex sclales image with respect to the center of the image
11
+
12
12
  from time import perf_counter as timer
13
+ import argparse
13
14
  import numpy as np
14
- from p4p.server import Server
15
15
 
16
16
  from epicsdev.epicsdev import (
17
+ Server,
17
18
  init_epicsdev,
18
19
  printi,
19
20
  publish,
@@ -62,6 +63,9 @@ def _gaussian_blob_grid_image() -> np.ndarray:
62
63
  dy = n_rows / (n_blobs_y)/2 if n_blobs_y > 0 else n_rows
63
64
  if n_blobs_x > 0 and n_blobs_y > 0 and blob_max > 0:
64
65
  x_centers = pvv('gridScaleX') * np.linspace(dx, n_cols - dx, n_blobs_x, dtype=np.float32)
66
+ print(f"Blob centers X before scaling: {x_centers}")
67
+ x_centers += n_cols/2. * (1 - pvv('gridScaleX')) # Scale centers with respect to the center of the image
68
+ print(f"Blob centers X after scaling: {x_centers}")
65
69
  y_centers = np.linspace(dy, n_rows - dy, n_blobs_y, dtype=np.float32)
66
70
  print(f"Blob centers X: {x_centers}, Y: {y_centers}")
67
71
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "epicsdev"
7
- version = "3.2.1"
7
+ version = "3.2.2"
8
8
  authors = [
9
9
  { name="Andrey Sukhanov", email="sukhanov@bnl.gov" },
10
10
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes