Leaf Thickness Gauge Calibration ================================ .. automodule:: jii_multispeq_protocols.protocols.calibrations.leaf_thickness_gauge_calibration :members: :undoc-members: :show-inheritance: :no-index: :no-title: Basic Usage ----------- .. code-block:: python :caption: *Example:* Import statement for the **leaf_thickness_gauge_calibration** protocol ## Import leaf_thickness_gauge_calibration from jii_multispeq_protocols.protocols.calibrations import leaf_thickness_gauge_calibration as _leaf_thickness_gauge_calibration ---- Sequence -------- .. mermaid:: %%{ init: { "theme": "base", "themeVariables": {"primaryColor": "#49e06d", "primaryTextColor": "#005e5e", "primaryBorderColor": "#005e5e", "lineColor": "#fff381", "secondaryColor": "#afd7f4", "tertiaryColor": "#D7EBF9"} } }%% flowchart TD START((Start)) A0["`**thick** *Sensor:* Hall Effect Sensor`"]:::protocol START ==> A0 A1["`**thick** *Sensor:* Hall Effect Sensor`"]:::protocol A0 ==> A1 A2["`**thick** *Sensor:* Hall Effect Sensor`"]:::protocol A1 ==> A2 A3["`**thick** *Sensor:* Hall Effect Sensor`"]:::protocol A2 ==> A3 A4["`**thick** *Sensor:* Hall Effect Sensor`"]:::protocol A3 ==> A4 A5["`**thick** *Sensor:* Hall Effect Sensor`"]:::protocol A4 ==> A5 A6["`**thick** *Sensor:* Hall Effect Sensor`"]:::protocol A5 ==> A6 A7["`**thick** *Sensor:* Hall Effect Sensor`"]:::protocol A6 ==> A7 A7 ==> END END(( End )) classDef protocol text-align:left,white-space:pre; ---- Details ------- Code ~~~~ .. code-block:: python :caption: Protocol Code [ { '_protocol_set_': [ { 'alert': 'Leave the Leaf Clamp fully closed', 'environmental': [['thickness_raw']], 'label': 'thick'}, { 'environmental': [['thickness_raw']], 'label': 'thick', 'prompt': 'Clamp the ***Red*** Thickness ' 'Calibration Card or enter alternate ' 'value'}, { 'environmental': [['thickness_raw']], 'label': 'thick', 'prompt': 'Clamp the ***Blue*** Thickness ' 'Calibration Card or enter alternate ' 'value'}, { 'environmental': [['thickness_raw']], 'label': 'thick', 'prompt': 'Clamp the ***Translucent*** Thickness ' 'Calibration Card or enter alternate ' 'value'}, { 'environmental': [['thickness_raw']], 'label': 'thick', 'prompt': 'Clamp the ***White*** Thickness ' 'Calibration Card or enter alternate ' 'value'}, { 'environmental': [['thickness_raw']], 'label': 'thick', 'prompt': 'Clamp the ***Clear*** Thickness ' 'Calibration Card or enter alternate ' 'value'}, { 'environmental': [['thickness_raw']], 'label': 'thick', 'prompt': 'Clamp the ***Black*** Thickness ' 'Calibration Card or enter alternate ' 'value'}, { 'alert': 'Leaf Clamp fully open', 'environmental': [['thickness_raw']], 'label': 'thick'}]}] ---- Analysis -------- Usage ~~~~~ .. code-block:: python :caption: Analysis Example (requires ``JII-MultispeQ`` package) from jii_multispeq import measurement as _measurement from jii_multispeq_protocols.protocols.calibrations import leaf_thickness_gauge_calibration as _leaf_thickness_gauge_calibration ## Take a measurement using the MultispeQ data, crc32 = _measurement.measure(port="", protocol=_leaf_thickness_gauge_calibration, filename=None, notes="") ## The analyze function of JII-MultispeQ helps to provide the correct format output = _measurement.analyze( data, _leaf_thickness_gauge_calibration._analyze ) ## View Analysis output (as table) _measurement.view( output ) Function Details ~~~~~~~~~~~~~~~~ .. autofunction:: jii_multispeq_protocols.protocols.calibrations.leaf_thickness_gauge_calibration._analyze :no-index: Example Data ~~~~~~~~~~~~ =============== ================================================================================================ Parameter Value =============== ================================================================================================ device_battery 106 device_firmware 2.191 device_id 32:21:3c:e5 device_name MultispeQ device_version 2 fitArray [[53199, 0], [52839, 80], [52376, 170], [51730, 220], [48480, 650], [47055, 930], [42525, 2400]] r2 0.934 slope -20469996692.079 toDevice set_thickness+47219090569802.88+-1.7229384+0.0+53199+38517+ y_intercept 130481962790.194 mm =============== ================================================================================================ .. plot:: :caption: *Figure:* Recorded or calculated trace for calibrationStandards. import matplotlib.pyplot as plt plt.style.use('default') fig, ax = plt.subplots(figsize=(10, 5)) ax.plot([0, 80, 170, 220, 650, 930, 2400, 11300], linewidth=2, color=(0, 0.37, 0.37), label="calibrationStandards") # Customize the plot ax.grid(True, linestyle='-', axis='y', alpha=0.3) ax.set_xlabel('Pulses', fontdict={"size": 15}) ax.set_ylabel("a.u.", fontdict={"size": 15}) for spine in ['top', 'right']: ax.spines[spine].set_visible(False) fig.patch.set_alpha(0) ax.patch.set_alpha(0) # Show Legend plt.legend() # Use a tight layout plt.tight_layout() # Show the plot plt.show() .. plot:: :caption: *Figure:* Recorded or calculated trace for measuredHallVals. import matplotlib.pyplot as plt plt.style.use('default') fig, ax = plt.subplots(figsize=(10, 5)) ax.plot([53199, 52839, 52376, 51730, 48480, 47055, 42525, 38517], linewidth=2, color=(0, 0.37, 0.37), label="measuredHallVals") # Customize the plot ax.grid(True, linestyle='-', axis='y', alpha=0.3) ax.set_xlabel('Pulses', fontdict={"size": 15}) ax.set_ylabel("a.u.", fontdict={"size": 15}) for spine in ['top', 'right']: ax.spines[spine].set_visible(False) fig.patch.set_alpha(0) ax.patch.set_alpha(0) # Show Legend plt.legend() # Use a tight layout plt.tight_layout() # Show the plot plt.show() .. plot:: :caption: *Figure:* Recorded or calculated trace for predictedThicknessVals. import matplotlib.pyplot as plt plt.style.use('default') fig, ax = plt.subplots(figsize=(10, 5)) ax.plot([np.float64(133636334738603.0), np.float64(131833808285920.0), np.float64(129533551774296.0), np.float64(126357951020122.0), np.float64(110979519561222.0), np.float64(104551236523617.0), np.float64(85389852347831.0)], linewidth=2, color=(0, 0.37, 0.37), label="predictedThicknessVals") # Customize the plot ax.grid(True, linestyle='-', axis='y', alpha=0.3) ax.set_xlabel('Pulses', fontdict={"size": 15}) ax.set_ylabel("a.u.", fontdict={"size": 15}) for spine in ['top', 'right']: ax.spines[spine].set_visible(False) fig.patch.set_alpha(0) ax.patch.set_alpha(0) # Show Legend plt.legend() # Use a tight layout plt.tight_layout() # Show the plot plt.show() .. plot:: :caption: *Figure:* Recorded or calculated trace for residuals. import matplotlib.pyplot as plt plt.style.use('default') fig, ax = plt.subplots(figsize=(10, 5)) ax.plot([np.float64(133636334738603.0), np.float64(131833808285840.0), np.float64(129533551774126.0), np.float64(126357951019902.0), np.float64(110979519560572.0), np.float64(104551236522687.0), np.float64(85389852345431.0)], linewidth=2, color=(0, 0.37, 0.37), label="residuals") # Customize the plot ax.grid(True, linestyle='-', axis='y', alpha=0.3) ax.set_xlabel('Pulses', fontdict={"size": 15}) ax.set_ylabel("a.u.", fontdict={"size": 15}) for spine in ['top', 'right']: ax.spines[spine].set_visible(False) fig.patch.set_alpha(0) ax.patch.set_alpha(0) # Show Legend plt.legend() # Use a tight layout plt.tight_layout() # Show the plot plt.show()