Electronic Offsets Calibration ============================== .. automodule:: jii_multispeq_protocols.protocols.calibrations.electronic_offsets_calibration :members: :undoc-members: :show-inheritance: :no-index: :no-title: Basic Usage ----------- .. code-block:: python :caption: *Example:* Import statement for the **electronic_offsets_calibration** protocol ## Import electronic_offsets_calibration from jii_multispeq_protocols.protocols.calibrations import electronic_offsets_calibration as _electronic_offsets_calibration ---- Sequence -------- .. mermaid:: %%{ init: { "theme": "base", "themeVariables": {"primaryColor": "#49e06d", "primaryTextColor": "#005e5e", "primaryBorderColor": "#005e5e", "lineColor": "#fff381", "secondaryColor": "#afd7f4", "tertiaryColor": "#D7EBF9"} } }%% flowchart TD START((Start)) A0["`**test**`"]:::protocol START ==> A0 A1["`**test** Runs only during *first* repeat`"]:::protocol A0 ==> A1 A2["`**Protocol**`"]:::protocol A1 ==> A2 A3["`**card_1** *Detector:* • 700nm - 1150nm • 400nm - 700nm (BG18) *Pulsed LEDs:* • 530nm (Main) • 950nm (Clamp) *Non Pulsed LED:* 655nm (Main)`"]:::protocol A2 ==> A3 A4["`**test**`"]:::protocol A3 ==> A4 A5["`**card_9** *Detector:* • 700nm - 1150nm • 400nm - 700nm (BG18) *Pulsed LEDs:* • 530nm (Main) • 950nm (Clamp) *Non Pulsed LED:* 655nm (Main)`"]:::protocol A4 ==> A5 A6["`**test**`"]:::protocol A5 ==> A6 A7["`**cards_1_9** *Detector:* • 700nm - 1150nm • 400nm - 700nm (BG18) *Pulsed LEDs:* • 530nm (Main) • 950nm (Clamp) *Non Pulsed LED:* 655nm (Main)`"]:::protocol A6 ==> A7 A7 ==> END A7 -.-> |1x| A0 linkStyle 9 stroke-width:3px END(( End )) classDef protocol text-align:left,white-space:pre; ---- Details ------- Code ~~~~ .. code-block:: python :caption: Protocol Code [ { '_protocol_set_': [ {'label': 'test'}, { 'alert': 'Clamp panel #1 (white) of the ' 'Chlorophyll calibration cards', 'bleed_correction': 0, 'do_once': 1, 'label': 'test', 'set_detector_offsets': [[1, 0], [3, 0]]}, { 'autogain': [ [1, 6, 1, 10, 10000], [2, 6, 1, 20, 20000], [3, 6, 1, 20, 30000], [4, 6, 1, 40, 40000], [5, 1, 3, 40, 5000], [6, 1, 3, 40, 10000], [7, 1, 3, 40, 15000], [8, 1, 3, 40, 20000]]}, { 'detectors': [[1, 3], [1, 3], [1, 3], [1, 3]], 'label': 'card_1', 'nonpulsed_lights': [[2], [2], [2], [2]], 'nonpulsed_lights_brightness': [ [0], [0], [0], [0]], 'protocol_averages': 1, 'protocol_repeats': 1, 'pulse_distance': [4000, 4000, 4000, 4000], 'pulse_length': [ ['a_d1', 'a_d5'], ['a_d2', 'a_d6'], ['a_d3', 'a_d7'], ['a_d4', 'a_d8']], 'pulsed_lights': [[6, 1], [6, 1], [6, 1], [6, 1]], 'pulsed_lights_brightness': [ ['a_b1', 'a_b5'], ['a_b2', 'a_b6'], ['a_b3', 'a_b7'], ['a_b4', 'a_b8']], 'pulses': [10, 10, 10, 10]}, { 'alert': 'Clamp panel #9 (white) of the ' 'Chlorophyll calibration cards', 'label': 'test'}, { 'detectors': [[1, 3], [1, 3], [1, 3], [1, 3]], 'label': 'card_9', 'nonpulsed_lights': [[2], [2], [2], [2]], 'nonpulsed_lights_brightness': [ [0], [0], [0], [0]], 'protocol_averages': 1, 'protocol_repeats': 1, 'pulse_distance': [4000, 4000, 4000, 4000], 'pulse_length': [ ['a_d1', 'a_d5'], ['a_d2', 'a_d6'], ['a_d3', 'a_d7'], ['a_d4', 'a_d8']], 'pulsed_lights': [[6, 1], [6, 1], [6, 1], [6, 1]], 'pulsed_lights_brightness': [ ['a_b1', 'a_b5'], ['a_b2', 'a_b6'], ['a_b3', 'a_b7'], ['a_b4', 'a_b8']], 'pulses': [10, 10, 10, 10]}, { 'alert': 'Clamp panel #1 (white) and #9 (white) ' 'of BOTH Chlorophyll calibration cards', 'label': 'test'}, { 'detectors': [[1, 3], [1, 3], [1, 3], [1, 3]], 'label': 'cards_1_9', 'nonpulsed_lights': [[2], [2], [2], [2]], 'nonpulsed_lights_brightness': [ [0], [0], [0], [0]], 'protocol_averages': 1, 'protocol_repeats': 1, 'pulse_distance': [4000, 4000, 4000, 4000], 'pulse_length': [ ['a_d1', 'a_d5'], ['a_d2', 'a_d6'], ['a_d3', 'a_d7'], ['a_d4', 'a_d8']], 'pulsed_lights': [[6, 1], [6, 1], [6, 1], [6, 1]], 'pulsed_lights_brightness': [ ['a_b1', 'a_b5'], ['a_b2', 'a_b6'], ['a_b3', 'a_b7'], ['a_b4', 'a_b8']], 'pulses': [10, 10, 10, 10]}], 'set_repeats': 1, 'v_arrays': [ [-120, -150, -180, -200, -300, -400], [-30, -40, -60, -100, -120]]}] ---- 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 electronic_offsets_calibration as _electronic_offsets_calibration ## Take a measurement using the MultispeQ data, crc32 = _measurement.measure(port="", protocol=_electronic_offsets_calibration, filename=None, notes="") ## The analyze function of JII-MultispeQ helps to provide the correct format output = _measurement.analyze( data, _electronic_offsets_calibration._analyze ) ## View Analysis output (as table) _measurement.view( output ) Function Details ~~~~~~~~~~~~~~~~ .. autofunction:: jii_multispeq_protocols.protocols.calibrations.electronic_offsets_calibration._analyze :no-index: Example Data ~~~~~~~~~~~~ ================ ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== Parameter Value ================ ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== det3 [[4991, 4991, 4993, 4991, 4983, 4982, 4989, 4996, 5001, 4989, 9078, 9085, 9075, 9077, 9082, 9081, 9079, 9081, 9081, 9070, 14447, 14445, 14441, 14450, 14461, 14455, 14447, 14451, 14446, 14454, 19610, 19599, 19611, 19615, 19606, 19607, 19614, 19609, 19605, 19616], [883, 879, 883, 880, 883, 877, 879, 885, 880, 879, 1654, 1653, 1655, 1650, 1650, 1652, 1649, 1655, 1651, 1655, 2685, 2682, 2683, 2682, 2681, 2685, 2686, 2682, 2683, 2681, 3685, 3686, 3689, 3685, 3682, 3688, 3685, 3690, 3687, 3687], [271, 274, 270, 271, 275, 273, 270, 275, 270, 271, 539, 544, 538, 541, 542, 538, 539, 543, 538, 539, 899, 903, 905, 903, 899, 898, 900, 899, 902, 900, 1252, 1251, 1251, 1251, 1255, 1249, 1252, 1255, 1251, 1251]] device_battery 100 device_firmware 2.3433 device_id 52:00:06:f0 device_name MultispeQ device_version 2 offset_det_1 33.0 offset_det_3 148.0 r2_det_1_1_v_1_9 0.747668 r2_det_1_1_v_9 0.7302349 r2_det_3_1_v_1_9 0.9999111 r2_det_3_1_v_9 0.9999567 time 1600105494848 toDevice set_detector_offset+1+33.0+set_detector_offset+3+148.0+ ================ ================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== .. plot:: :caption: *Figure:* Recorded or calculated trace for card_1_data_det_1. import matplotlib.pyplot as plt plt.style.use('default') fig, ax = plt.subplots(figsize=(10, 5)) ax.plot([30, 23, 25, 23, 27, 23, 25, 28, 29, 30, 31, 30, 35, 36, 31, 33, 34, 29, 37, 29, 36, 29, 37, 27, 31, 31, 31, 31, 29, 36, 41, 44, 45, 47, 50, 42, 39, 43, 42, 41], linewidth=2, color=(0, 0.37, 0.37), label="card_1_data_det_1") # 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 card_1_data_det_3. import matplotlib.pyplot as plt plt.style.use('default') fig, ax = plt.subplots(figsize=(10, 5)) ax.plot([4991, 4991, 4993, 4991, 4983, 4982, 4989, 4996, 5001, 4989, 9078, 9085, 9075, 9077, 9082, 9081, 9079, 9081, 9081, 9070, 14447, 14445, 14441, 14450, 14461, 14455, 14447, 14451, 14446, 14454, 19610, 19599, 19611, 19615, 19606, 19607, 19614, 19609, 19605, 19616], linewidth=2, color=(0, 0.37, 0.37), label="card_1_data_det_3") # 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 card_9_data_det_1. import matplotlib.pyplot as plt plt.style.use('default') fig, ax = plt.subplots(figsize=(10, 5)) ax.plot([31, 25, 29, 25, 28, 31, 25, 26, 30, 21, 31, 30, 32, 31, 31, 33, 34, 33, 35, 30, 35, 35, 31, 34, 29, 29, 31, 29, 31, 31, 47, 44, 43, 42, 46, 42, 46, 43, 45, 41], linewidth=2, color=(0, 0.37, 0.37), label="card_9_data_det_1") # 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()