You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/openlifu/xdc/element.py
+2-11Lines changed: 2 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ class Element:
113
113
size: Annotated[np.ndarray, OpenLIFUFieldData("Size", "Size of the element in 2D")] =field(default_factory=lambda: np.array([1., 1.]))
114
114
""" Size of the element in 2D as a numpy array [width, length]."""
115
115
116
-
sensitivity: Annotated[float|dict[float, float], OpenLIFUFieldData("Sensitivity", "Sensitivity of the element (Pa/V), scalar or {frequency_hz: sensitivity}")] =1.0
116
+
sensitivity: Annotated[float|dict, OpenLIFUFieldData("Sensitivity", "Sensitivity of the element (Pa/V), scalar or {'freq_Hz':[...], 'values_Pa_per_V':[...]}")] =1.0
117
117
"""Sensitivity of the element (Pa/V)"""
118
118
119
119
pin: Annotated[int, OpenLIFUFieldData("Pin", "Channel pin to which the element is connected")] =-1
@@ -134,16 +134,7 @@ def __post_init__(self):
134
134
raiseValueError("Size must be a 2-element array.")
135
135
ifself.sensitivityisNone:
136
136
self.sensitivity=1.0
137
-
elifisinstance(self.sensitivity, dict):
138
-
iflen(self.sensitivity) ==0:
139
-
raiseValueError("Sensitivity dictionary must not be empty.")
The units of this transform are assumed to be the native units of the transducer, the `Transducer.units` field.
79
96
"""
80
97
81
-
sensitivity: Annotated[float|dict[float, float], OpenLIFUFieldData("Sensitivity", "Sensitivity of the element (Pa/V), scalar or {frequency_hz: sensitivity}")] =1.0
98
+
sensitivity: Annotated[float|dict, OpenLIFUFieldData("Sensitivity", "Sensitivity of the transducer (Pa/V), scalar or {'freq_Hz':[...], 'values_Pa_per_V':[...]}")] =1.0
82
99
"""Sensitivity of the transducer (Pa/V), scalar or frequency-dependent dictionary."""
83
100
84
101
crosstalk_frac: Annotated[float, OpenLIFUFieldData("Crosstalk fraction", "Fraction of the signal that leaks into other elements due to crosstalk")] =0.0
@@ -98,16 +115,7 @@ def __post_init__(self):
98
115
element.rescale(self.units)
99
116
ifself.sensitivityisNone:
100
117
self.sensitivity=1.0
101
-
elifisinstance(self.sensitivity, dict):
102
-
iflen(self.sensitivity) ==0:
103
-
raiseValueError("Sensitivity dictionary must not be empty.")
0 commit comments