amor-eos 3.3.0__tar.gz → 3.3.1__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. {amor_eos-3.3.0 → amor_eos-3.3.1}/PKG-INFO +1 -1
  2. {amor_eos-3.3.0 → amor_eos-3.3.1}/amor_eos.egg-info/PKG-INFO +1 -1
  3. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/__init__.py +1 -1
  4. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/event_handling.py +16 -15
  5. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/file_reader.py +1 -1
  6. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/options.py +2 -2
  7. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/reduction_e2h.py +1 -8
  8. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/reduction_reflectivity.py +6 -6
  9. {amor_eos-3.3.0 → amor_eos-3.3.1}/LICENSE +0 -0
  10. {amor_eos-3.3.0 → amor_eos-3.3.1}/README.rst +0 -0
  11. {amor_eos-3.3.0 → amor_eos-3.3.1}/amor_eos.egg-info/SOURCES.txt +0 -0
  12. {amor_eos-3.3.0 → amor_eos-3.3.1}/amor_eos.egg-info/dependency_links.txt +0 -0
  13. {amor_eos-3.3.0 → amor_eos-3.3.1}/amor_eos.egg-info/entry_points.txt +0 -0
  14. {amor_eos-3.3.0 → amor_eos-3.3.1}/amor_eos.egg-info/requires.txt +0 -0
  15. {amor_eos-3.3.0 → amor_eos-3.3.1}/amor_eos.egg-info/top_level.txt +0 -0
  16. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/__main__.py +0 -0
  17. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/command_line.py +0 -0
  18. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/compat.py +0 -0
  19. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/const.py +0 -0
  20. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/e2h.py +0 -0
  21. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/event_analysis.py +0 -0
  22. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/event_data_types.py +0 -0
  23. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/header.py +0 -0
  24. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/helpers.py +0 -0
  25. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/helpers_fallback.py +0 -0
  26. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/helpers_numba.py +0 -0
  27. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/instrument.py +0 -0
  28. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/kafka_events.py +0 -0
  29. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/kafka_serializer.py +0 -0
  30. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/logconfig.py +0 -0
  31. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/ls.py +0 -0
  32. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/nicos.py +0 -0
  33. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/nicos_interface.py +0 -0
  34. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/normalization.py +0 -0
  35. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/path_handling.py +0 -0
  36. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/projection.py +0 -0
  37. {amor_eos-3.3.0 → amor_eos-3.3.1}/eos/reduction_kafka.py +0 -0
  38. {amor_eos-3.3.0 → amor_eos-3.3.1}/pyproject.toml +0 -0
  39. {amor_eos-3.3.0 → amor_eos-3.3.1}/setup.cfg +0 -0
  40. {amor_eos-3.3.0 → amor_eos-3.3.1}/tests/test_event_handling.py +0 -0
  41. {amor_eos-3.3.0 → amor_eos-3.3.1}/tests/test_full_analysis.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amor_eos
3
- Version: 3.3.0
3
+ Version: 3.3.1
4
4
  Summary: EOS reflectometry reduction for AMOR instrument
5
5
  Author: Jochen Stahn - Paul Scherrer Institut
6
6
  Author-email: jochen.stahn@psi.ch
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amor_eos
3
- Version: 3.3.0
3
+ Version: 3.3.1
4
4
  Summary: EOS reflectometry reduction for AMOR instrument
5
5
  Author: Jochen Stahn - Paul Scherrer Institut
6
6
  Author-email: jochen.stahn@psi.ch
@@ -2,5 +2,5 @@
2
2
  Package to handle data redction at AMOR instrument to be used by __main__.py script.
3
3
  """
4
4
 
5
- __version__ = '3.3.0'
5
+ __version__ = '3.3.1'
6
6
  __date__ = '2026-07-09'
@@ -197,18 +197,19 @@ class ApplyMask(EventDataAction):
197
197
  logging.info(f' number of events: total = {pre_filter:7d}, after filtering = {post_filter:7d}')
198
198
  if d.device_logs == {} or not hasattr(dataset, 'update_info_from_logs'):
199
199
  return
200
- # filter pulses and logs to allow update of header information
201
- from .helpers import add_log_to_pulses
202
- times = np.unique(d.events.wallTime)
203
- # make sure all log variables are associated with pulses
204
- for key, log in d.device_logs.items():
205
- if not key in d.pulses.dtype.names:
206
- # interpolate the parameter values for all existing pulses
207
- add_log_to_pulses(key, dataset)
208
- # remove all pulses that have no more events
209
- d.pulses = d.pulses[np.isin(d.pulses.time, times)]
210
- for key, log in d.device_logs.items():
211
- d.device_logs[key] = np.recarray(d.pulses.shape, dtype = log.dtype)
212
- d.device_logs[key].time = d.pulses.time
213
- d.device_logs[key].value = d.pulses[key]
214
- dataset.update_info_from_logs()
200
+ if 'wallTime' in d.events.dtype.names:
201
+ # filter pulses and logs to allow update of header information
202
+ from .helpers import add_log_to_pulses
203
+ times = np.unique(d.events.wallTime)
204
+ # make sure all log variables are associated with pulses
205
+ for key, log in d.device_logs.items():
206
+ if not key in d.pulses.dtype.names:
207
+ # interpolate the parameter values for all existing pulses
208
+ add_log_to_pulses(key, dataset)
209
+ # remove all pulses that have no more events
210
+ d.pulses = d.pulses[np.isin(d.pulses.time, times)]
211
+ for key, log in d.device_logs.items():
212
+ d.device_logs[key] = np.recarray(d.pulses.shape, dtype = log.dtype)
213
+ d.device_logs[key].time = d.pulses.time
214
+ d.device_logs[key].value = d.pulses[key]
215
+ dataset.update_info_from_logs()
@@ -63,7 +63,7 @@ class AmorHeader:
63
63
  nu=('entry1/measurement_configuration/nu', float, 'nu'),
64
64
  kap=('entry1/measurement_configuration/kappa', float, 'kappa'),
65
65
  kad=('entry1/measurement_configuration/kappa_offset', float, 'kappa_offset'),
66
- div=('entry1/measurement_configuration/div', float, 'div'),
66
+ div=('entry1/measurement_configuration/divergence', float, 'div'),
67
67
  virtual_source_horizontal=('entry1/Amor/virtual_source/horizontal', float),
68
68
  virtual_source_vertical=('entry1/Amor/virtual_source/vertical', float),
69
69
  ch1_trigger_phase=('entry1/Amor/chopper/ch1_trigger_phase', float, 'ch1_trigger_phase'),
@@ -433,8 +433,8 @@ class ReflectivityReductionConfig(ArgParsable):
433
433
  metadata={
434
434
  'group': 'input data',
435
435
  'help': 'apply convolution on lambda axes to smooth the normalization data, useful for low statistics'})
436
- scale: List[float] = field(
437
- default_factory=lambda: [],
436
+ scale: Optional[List[float]] = field(
437
+ default=None,
438
438
  metadata={
439
439
  'short': 's',
440
440
  'group': 'data manicure',
@@ -131,11 +131,7 @@ class E2HReduction:
131
131
  # safe to image file if not auto-updating graph
132
132
  plt.savefig(f'e2h_{self.config.reduction.plot}.png', dpi=300)
133
133
  if self.config.reduction.kafka:
134
- from .kafka_serializer import ESSSerializer
135
- self.serializer = ESSSerializer()
136
- self.fig.canvas.mpl_connect('close_event', self.serializer.end_command_thread)
137
- self.serializer.start_command_thread()
138
- self.serializer.send(self.projection)
134
+ raise RuntimeError("--kafka not implemented for events2histogram, use eos nicos script")
139
135
  if self.config.reduction.update:
140
136
  self.timer = self.fig.canvas.new_timer(1000)
141
137
  self.timer.add_callback(self.update)
@@ -313,6 +309,3 @@ class E2HReduction:
313
309
  self.projection.update_plot()
314
310
  plt.suptitle(self.create_title())
315
311
  plt.draw()
316
-
317
- if self.config.reduction.kafka:
318
- self.serializer.send(self.projection)
@@ -310,12 +310,12 @@ class ReflectivityReduction:
310
310
  logging.info(f' {ti:<4d} {time:6.0f} {self.monitor:7.2f} {MONITOR_UNITS[self.config.experiment.monitorType]}')
311
311
 
312
312
  proj: LZProjection = self.project_on_lz(slice)
313
- try:
314
- scale = self.config.reduction.scale[i]
315
- except IndexError:
316
- scale = self.config.reduction.scale[-1]
317
- # TODO: causes error if no '-s' argumnet is given
318
- proj.scale(scale)
313
+ if not self.config.reduction.is_default('scale'):
314
+ try:
315
+ scale = self.config.reduction.scale[i]
316
+ except IndexError:
317
+ scale = self.config.reduction.scale[-1]
318
+ proj.scale(scale)
319
319
 
320
320
  # projection on qz-grid
321
321
  result = proj.project_on_qz()
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes