gondola 0.11.8__tar.gz → 0.12.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 (102) hide show
  1. {gondola-0.11.8 → gondola-0.12.1}/Cargo.lock +2 -1
  2. {gondola-0.11.8 → gondola-0.12.1}/Cargo.toml +7 -3
  3. {gondola-0.11.8 → gondola-0.12.1}/PKG-INFO +1 -1
  4. {gondola-0.11.8 → gondola-0.12.1}/src/calibration/tof.rs +2 -1
  5. {gondola-0.11.8 → gondola-0.12.1}/src/events/rb_waveform.rs +7 -1
  6. {gondola-0.11.8 → gondola-0.12.1}/src/io/parsers.rs +1 -1
  7. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring.rs +2 -1
  8. {gondola-0.11.8 → gondola-0.12.1}/src/packets/tof_packet.rs +6 -0
  9. {gondola-0.11.8 → gondola-0.12.1}/src/python.rs +1 -1
  10. {gondola-0.11.8 → gondola-0.12.1}/src/stats.rs +1 -1
  11. {gondola-0.11.8 → gondola-0.12.1}/src/tof/algorithms.rs +6 -6
  12. {gondola-0.11.8 → gondola-0.12.1}/src/tof/cuts.rs +2 -0
  13. {gondola-0.11.8 → gondola-0.12.1}/src/tof/master_trigger.rs +3 -1
  14. {gondola-0.11.8 → gondola-0.12.1}/src/tof.rs +1 -0
  15. {gondola-0.11.8 → gondola-0.12.1}/.gitignore +0 -0
  16. {gondola-0.11.8 → gondola-0.12.1}/README.md +0 -0
  17. {gondola-0.11.8 → gondola-0.12.1}/alert-manifest-test.toml +0 -0
  18. {gondola-0.11.8 → gondola-0.12.1}/benches/bench.rs +0 -0
  19. {gondola-0.11.8 → gondola-0.12.1}/diesel.toml +0 -0
  20. {gondola-0.11.8 → gondola-0.12.1}/publish_to_bluejay.sh +0 -0
  21. {gondola-0.11.8 → gondola-0.12.1}/pyproject.toml +0 -0
  22. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/__init__.py +0 -0
  23. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/calibration.py +0 -0
  24. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/db.py +0 -0
  25. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/gaps_flight.db +0 -0
  26. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/io/__init__.py +0 -0
  27. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/reconstruction/__init__.py +0 -0
  28. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/tof/__init__.py +0 -0
  29. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/tof/analysis.py +0 -0
  30. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/tracker/__init__.py +0 -0
  31. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/tracker/analysis.py +0 -0
  32. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/visual/__init__.py +0 -0
  33. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/visual/tof.py +0 -0
  34. {gondola-0.11.8 → gondola-0.12.1}/python/gondola/visual/tracker.py +0 -0
  35. {gondola-0.11.8 → gondola-0.12.1}/src/calibration/tracker.rs +0 -0
  36. {gondola-0.11.8 → gondola-0.12.1}/src/calibration.rs +0 -0
  37. {gondola-0.11.8 → gondola-0.12.1}/src/constants.rs +0 -0
  38. {gondola-0.11.8 → gondola-0.12.1}/src/database/schema.rs +0 -0
  39. {gondola-0.11.8 → gondola-0.12.1}/src/database.rs +0 -0
  40. {gondola-0.11.8 → gondola-0.12.1}/src/errors.rs +0 -0
  41. {gondola-0.11.8 → gondola-0.12.1}/src/events/rb_event.rs +0 -0
  42. {gondola-0.11.8 → gondola-0.12.1}/src/events/rb_event_header.rs +0 -0
  43. {gondola-0.11.8 → gondola-0.12.1}/src/events/telemetry_event.rs +0 -0
  44. {gondola-0.11.8 → gondola-0.12.1}/src/events/tof_event.rs +0 -0
  45. {gondola-0.11.8 → gondola-0.12.1}/src/events/tof_hit.rs +0 -0
  46. {gondola-0.11.8 → gondola-0.12.1}/src/events/tracker_hit.rs +0 -0
  47. {gondola-0.11.8 → gondola-0.12.1}/src/events.rs +0 -0
  48. {gondola-0.11.8 → gondola-0.12.1}/src/io/caraspace/frame.rs +0 -0
  49. {gondola-0.11.8 → gondola-0.12.1}/src/io/caraspace/reader.rs +0 -0
  50. {gondola-0.11.8 → gondola-0.12.1}/src/io/caraspace/socket_reader.rs +0 -0
  51. {gondola-0.11.8 → gondola-0.12.1}/src/io/caraspace/writer.rs +0 -0
  52. {gondola-0.11.8 → gondola-0.12.1}/src/io/caraspace.rs +0 -0
  53. {gondola-0.11.8 → gondola-0.12.1}/src/io/data_source.rs +0 -0
  54. {gondola-0.11.8 → gondola-0.12.1}/src/io/ipbus.rs +0 -0
  55. {gondola-0.11.8 → gondola-0.12.1}/src/io/root_reader.rs +0 -0
  56. {gondola-0.11.8 → gondola-0.12.1}/src/io/serialization.rs +0 -0
  57. {gondola-0.11.8 → gondola-0.12.1}/src/io/streamers.rs +0 -0
  58. {gondola-0.11.8 → gondola-0.12.1}/src/io/telemetry_reader.rs +0 -0
  59. {gondola-0.11.8 → gondola-0.12.1}/src/io/tof_reader.rs +0 -0
  60. {gondola-0.11.8 → gondola-0.12.1}/src/io/tof_writer.rs +0 -0
  61. {gondola-0.11.8 → gondola-0.12.1}/src/io.rs +0 -0
  62. {gondola-0.11.8 → gondola-0.12.1}/src/lib.rs +0 -0
  63. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/cpu_moni_data.rs +0 -0
  64. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/heartbeats/data_sink_hb.rs +0 -0
  65. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/heartbeats/event_builder_hb.rs +0 -0
  66. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/heartbeats/master_trigger_hb.rs +0 -0
  67. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/heartbeats.rs +0 -0
  68. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/ltb_moni_data.rs +0 -0
  69. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/mtb_moni_data.rs +0 -0
  70. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/pa_moni_data.rs +0 -0
  71. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/pb_moni_data.rs +0 -0
  72. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/rb_moni_data.rs +0 -0
  73. {gondola-0.11.8 → gondola-0.12.1}/src/monitoring/run_statistics.rs +0 -0
  74. {gondola-0.11.8 → gondola-0.12.1}/src/packets/bfsw_ack_packet.rs +0 -0
  75. {gondola-0.11.8 → gondola-0.12.1}/src/packets/gps_packet.rs +0 -0
  76. {gondola-0.11.8 → gondola-0.12.1}/src/packets/magnetometer.rs +0 -0
  77. {gondola-0.11.8 → gondola-0.12.1}/src/packets/telemetry_packet.rs +0 -0
  78. {gondola-0.11.8 → gondola-0.12.1}/src/packets/telemetry_packet_header.rs +0 -0
  79. {gondola-0.11.8 → gondola-0.12.1}/src/packets/telemetry_packet_type.rs +0 -0
  80. {gondola-0.11.8 → gondola-0.12.1}/src/packets/tof_packet_type.rs +0 -0
  81. {gondola-0.11.8 → gondola-0.12.1}/src/packets/tracker.rs +0 -0
  82. {gondola-0.11.8 → gondola-0.12.1}/src/packets/tracker_header.rs +0 -0
  83. {gondola-0.11.8 → gondola-0.12.1}/src/packets.rs +0 -0
  84. {gondola-0.11.8 → gondola-0.12.1}/src/prelude.rs +0 -0
  85. {gondola-0.11.8 → gondola-0.12.1}/src/random.rs +0 -0
  86. {gondola-0.11.8 → gondola-0.12.1}/src/tof/alerts.rs +0 -0
  87. {gondola-0.11.8 → gondola-0.12.1}/src/tof/analysis.rs +0 -0
  88. {gondola-0.11.8 → gondola-0.12.1}/src/tof/analysis_engine.rs +0 -0
  89. {gondola-0.11.8 → gondola-0.12.1}/src/tof/commands.rs +0 -0
  90. {gondola-0.11.8 → gondola-0.12.1}/src/tof/config.rs +0 -0
  91. {gondola-0.11.8 → gondola-0.12.1}/src/tof/detector_status.rs +0 -0
  92. {gondola-0.11.8 → gondola-0.12.1}/src/tof/master_trigger/control.rs +0 -0
  93. {gondola-0.11.8 → gondola-0.12.1}/src/tof/master_trigger/registers.rs +0 -0
  94. {gondola-0.11.8 → gondola-0.12.1}/src/tof/rb_paddle_id.rs +0 -0
  95. {gondola-0.11.8 → gondola-0.12.1}/src/tof/settings.rs +0 -0
  96. {gondola-0.11.8 → gondola-0.12.1}/src/tof/signal_handler.rs +0 -0
  97. {gondola-0.11.8 → gondola-0.12.1}/src/tof/thread_control.rs +0 -0
  98. {gondola-0.11.8 → gondola-0.12.1}/src/tof/tof_response.rs +0 -0
  99. {gondola-0.11.8 → gondola-0.12.1}/src/tracker/strips.rs +0 -0
  100. {gondola-0.11.8 → gondola-0.12.1}/src/tracker.rs +0 -0
  101. {gondola-0.11.8 → gondola-0.12.1}/src/version.rs +0 -0
  102. {gondola-0.11.8 → gondola-0.12.1}/tests/test.rs +0 -0
@@ -1352,7 +1352,7 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
1352
1352
 
1353
1353
  [[package]]
1354
1354
  name = "gondola-core"
1355
- version = "0.11.8"
1355
+ version = "0.12.1"
1356
1356
  dependencies = [
1357
1357
  "cfg-if 1.0.0",
1358
1358
  "chrono",
@@ -4813,6 +4813,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
4813
4813
  [[package]]
4814
4814
  name = "tof-control"
4815
4815
  version = "0.9.5"
4816
+ source = "git+https://github.com/GAPS-Collab/tof-control.git?branch=minimal#23ab243acf48c4c71a994964dee0b612b8cb6132"
4816
4817
  dependencies = [
4817
4818
  "bindgen",
4818
4819
  "cc",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "gondola-core"
3
- version = "0.11.8"
3
+ version = "0.12.1"
4
4
  edition = "2024"
5
5
  readme = "README.md"
6
6
 
@@ -44,6 +44,12 @@ root = ["oxyroot", "root-io"]
44
44
  # will be required for the build of liftof
45
45
  tof-liftof = ["signal-hook"]
46
46
 
47
+ [dependencies.tof-control]
48
+ version = "0.9"
49
+ optional = true
50
+ git = "https://github.com/GAPS-Collab/tof-control.git"
51
+ branch = "minimal"
52
+
47
53
  [dependencies.pyo3]
48
54
  version = "0.25"
49
55
  features = ["extension-module", "multiple-pymethods", "abi3-py311", "chrono"]
@@ -109,5 +115,3 @@ libsqlite3-sys = { version = "0.35", features = ["bundled"] }
109
115
 
110
116
  # for testing / features
111
117
  rand = { version = "0.9", optional = true}
112
- # Takeru's tof-control
113
- tof-control = {path = "../../../resources/extern/tof-control", optional = true, version = "0.9", features=[] }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gondola
3
- Version: 0.11.8
3
+ Version: 0.12.1
4
4
  Requires-Dist: tqdm>=4.0
5
5
  Requires-Dist: numpy>=2.3
6
6
  Requires-Dist: matplotlib>=3.10
@@ -9,7 +9,7 @@ use crate::prelude::*;
9
9
  /// to the beginning by a given offset.
10
10
  ///
11
11
  /// This is similar to
12
- /// https://numpy.org/doc/2.2/reference/generated/numpy.roll.html
12
+ /// <https://numpy.org/doc/2.2/reference/generated/numpy.roll.html>
13
13
  ///
14
14
  /// # Arguments:
15
15
  /// * `vec` : The vector to be rolled over. It will
@@ -1782,6 +1782,7 @@ impl RBCalibrations {
1782
1782
  }
1783
1783
  }
1784
1784
 
1785
+ #[cfg(feature = "pybindings")]
1785
1786
  pythonize_packable_no_new!(RBCalibrations);
1786
1787
 
1787
1788
  #[cfg(feature = "random")]
@@ -13,13 +13,16 @@ use crate::prelude::*;
13
13
  pub struct RBWaveform {
14
14
  pub event_id : u32,
15
15
  pub rb_id : u8,
16
- /// FIXME - this is form 0-8, but should it be from 1-9?
16
+ ///// FIXME - this is form 0-8, but should it be from 1-9?
17
17
  pub rb_channel_a : u8,
18
18
  pub rb_channel_b : u8,
19
19
  /// DRS4 stop cell
20
20
  pub stop_cell : u16,
21
21
  pub adc_a : Vec<u16>,
22
22
  pub adc_b : Vec<u16>,
23
+ // FIXME - to be compatible with Antarctica data from
24
+ // 2024/25, we do not serialize the paddle id in this version
25
+ // HOWEVER, let's change that in v0.12
23
26
  pub paddle_id : u8,
24
27
  pub voltages_a : Vec<f32>,
25
28
  pub nanoseconds_a : Vec<f32>,
@@ -237,6 +240,9 @@ impl Serialization for RBWaveform {
237
240
  let data_a = &stream[*pos..*pos+2*NWORDS];
238
241
  wf.adc_a = u8_to_u16(data_a);
239
242
  *pos += 2*NWORDS;
243
+ if stream.len() < *pos+2*NWORDS {
244
+ return Err(SerializationError::StreamTooShort);
245
+ }
240
246
  let data_b = &stream[*pos..*pos+2*NWORDS];
241
247
  wf.adc_b = u8_to_u16(data_b);
242
248
  *pos += 2*NWORDS;
@@ -134,7 +134,7 @@ pub fn parse_string<T: AsRef<[u8]>>(stream : &T, pos : &mut usize) -> String {
134
134
  /// representation of u32 (neither le or be, but
135
135
  /// shuffled)
136
136
  ///
137
- /// <div class="warning>
137
+ /// <div class="warning">
138
138
  /// This assumes an underlying representation of
139
139
  /// an atomic unit of 16bit instead of 8.
140
140
  /// This is a non-convetional byte respresentation
@@ -475,7 +475,8 @@ macro_rules! moniseries {
475
475
  // return self.max_size;
476
476
  //}
477
477
  }
478
-
478
+
479
+ #[cfg(feature="pybindings")]
479
480
  pythonize_display!($name);
480
481
  }
481
482
  }
@@ -304,6 +304,12 @@ impl TofPacket {
304
304
  }
305
305
  }
306
306
 
307
+ #[getter]
308
+ #[pyo3(name="payload")]
309
+ fn get_payload_py(&self) -> Vec<u8> {
310
+ self.payload.clone()
311
+ }
312
+
307
313
  #[pyo3(name="unpack")]
308
314
  fn unpack_py(&self,py: Python) -> PyResult<Py<PyAny>> {
309
315
  match self.packet_type {
@@ -68,7 +68,7 @@ macro_rules! pythonize_telemetry {
68
68
  fn from_telemetrypacket(packet : TelemetryPacket) -> PyResult<Self> {
69
69
  //if packet.telemetry_header.packet_type !=
70
70
  match Self::from_bytestream(&packet.payload, &mut 0) {
71
- Ok(mut tl) => {
71
+ Ok(tl) => {
72
72
  return Ok(tl);
73
73
  }
74
74
  Err(err) => {
@@ -20,7 +20,7 @@ use numpy::{
20
20
 
21
21
  /// Calculates the standard deviation of a vector.
22
22
  ///
23
- /// This function returns an Option<f32> because the standard deviation is
23
+ /// This function returns an `Option<f32>` because the standard deviation is
24
24
  /// undefined for an empty vector or a vector with a single element.
25
25
  pub fn standard_deviation(data: &Vec<f32>) -> Option<f32> {
26
26
  // The standard deviation is not defined for vectors with less than 2 elements.
@@ -66,10 +66,10 @@ pub fn get_max_value_idx_py<'_py>(value : Bound<'_py,PyArray1<f32>>,
66
66
  /// within the bin
67
67
  /// * idx : Together with size define a range for the search for
68
68
  /// the bin which should have the implementation applied
69
- /// to [voltages[idx], voltages[idx + size]]
69
+ /// to \[voltages\[idx\], voltages\[idx + size\]\]
70
70
  /// * size : Together with idx define a range for the search for
71
71
  /// the bin which should have the implementation applied
72
- /// to [voltages[idx], voltages[idx + size]]
72
+ /// to \[voltages\[idx\], voltages\[idx + size\]\]
73
73
  pub fn interpolate_time<T : AsRef<[f32]>> (volts : &T,
74
74
  times : &T,
75
75
  mut threshold : f32,
@@ -105,6 +105,7 @@ pub fn interpolate_time<T : AsRef<[f32]>> (volts : &T,
105
105
  }
106
106
 
107
107
 
108
+ #[cfg(feature = "pybindings")]
108
109
  #[pyfunction]
109
110
  #[pyo3(name="interpolate_time")]
110
111
  /// Linear interpolation of the time within a single bin of a TOF waveform
@@ -116,10 +117,10 @@ pub fn interpolate_time<T : AsRef<[f32]>> (volts : &T,
116
117
  /// within the bin
117
118
  /// * idx : Together with size define a range for the search for
118
119
  /// the bin which should have the implementation applied
119
- /// to [voltages[idx], voltages[idx + size]]
120
+ /// to \[voltages\[idx\], voltages\[idx + size\]\]
120
121
  /// * size : Together with idx define a range for the search for
121
122
  /// the bin which should have the implementation applied
122
- /// to [voltages[idx], voltages[idx + size]]
123
+ /// to \[voltages\[idx\], voltages\[idx + size\]\]
123
124
  pub fn interpolate_time_py(voltages : PyReadonlyArray1<f32>,
124
125
  nanoseconds : PyReadonlyArray1<f32>,
125
126
  threshold : f32,
@@ -280,8 +281,7 @@ pub fn cfd_simple(voltages : &Vec<f32>,
280
281
  /// * max_peaks : stop algorithm after max_peaks are
281
282
  /// found, the rest will be ignored
282
283
  /// #Returns:
283
- ///
284
- /// Vec<(peak_begin_bin, peak_end_bin)>
284
+ /// `Vec<(peak_begin_bin, peak_end_bin)>`
285
285
  ///
286
286
  pub fn find_peaks(voltages : &Vec<f32>,
287
287
  nanoseconds : &Vec<f32>,
@@ -394,6 +394,7 @@ impl TofCuts {
394
394
  /// and update the counters.
395
395
  /// If cleanings are enabled, this will
396
396
  /// change the event in-place!
397
+ #[cfg(feature="database")]
397
398
  pub fn accept(&mut self, ev : &mut TofEvent) -> bool {
398
399
  if self.is_void() {
399
400
  return true;
@@ -696,6 +697,7 @@ impl TofCuts {
696
697
  self.clear_stats();
697
698
  }
698
699
 
700
+ #[cfg(feature="database")]
699
701
  #[pyo3(name="accept")]
700
702
  fn accept_py(&mut self, event : &mut TofEvent) -> bool {
701
703
  self.accept(event)
@@ -849,7 +849,7 @@ pub fn master_trigger(mt_address : &str,
849
849
  }
850
850
  }
851
851
 
852
-
852
+ #[cfg(feature = "pybindings")]
853
853
  #[pyfunction]
854
854
  #[pyo3(name="prescale_to_u32")]
855
855
  /// Convert a prescale value in range from 0-1.0 to
@@ -863,12 +863,14 @@ pub fn wrap_prescale_to_u32(prescale : f32) -> u32 {
863
863
  //---------------------------------------
864
864
  // PORT from pybidings/master_trigger.rs
865
865
 
866
+ #[cfg(feature="pybindings")]
866
867
  #[pyclass]
867
868
  #[pyo3(name = "MasterTrigger")]
868
869
  pub struct PyMasterTrigger {
869
870
  ipbus : IPBus,
870
871
  }
871
872
 
873
+ #[cfg(feature="pybindings")]
872
874
  #[pymethods]
873
875
  impl PyMasterTrigger {
874
876
  #[new]
@@ -28,6 +28,7 @@ pub mod thread_control;
28
28
  pub use thread_control::ThreadControl;
29
29
  #[cfg(feature="tof-liftof")]
30
30
  pub mod master_trigger;
31
+ #[cfg(feature="tof-liftof")]
31
32
  pub use master_trigger::*;
32
33
  #[cfg(feature="tof-liftof")]
33
34
  pub use master_trigger::control::*;
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
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