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
@@ -114,7 +114,7 @@ class Element:
114
114
size: Annotated[np.ndarray, OpenLIFUFieldData("Size", "Size of the element in 2D")] =field(default_factory=lambda: np.array([1., 1.]))
115
115
""" Size of the element in 2D as a numpy array [width, length]."""
116
116
117
-
sensitivity: Annotated[float|dict[float, float], OpenLIFUFieldData("Sensitivity", "Sensitivity of the element (Pa/V), scalar or {frequency_hz: sensitivity}")] =1.0
117
+
sensitivity: Annotated[float|dict, OpenLIFUFieldData("Sensitivity", "Sensitivity of the element (Pa/V), scalar or {'freq_Hz':[...], 'values_Pa_per_V':[...]}")] =1.0
118
118
"""Sensitivity of the element (Pa/V)"""
119
119
120
120
pin: Annotated[int, OpenLIFUFieldData("Pin", "Channel pin to which the element is connected")] =-1
@@ -135,16 +135,7 @@ def __post_init__(self):
135
135
raiseValueError("Size must be a 2-element array.")
136
136
ifself.sensitivityisNone:
137
137
self.sensitivity=1.0
138
-
elifisinstance(self.sensitivity, dict):
139
-
iflen(self.sensitivity) ==0:
140
-
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