# self._vab_pulse(vab=vab, duration=pulse_duration, sampling_rate=sampling_rate) # TODO: use a square wave pulse?
# vmn = np.mean(self.readings[:, 4])
# iab = np.mean(self.readings[:, 3])
# # if np.abs(vmn) is too small (smaller than voltage_min), strategy is not constant and vab < vab_max ,
# # then we could call _compute_tx_volt with a tx_volt increased to np.min([vab_max, tx_volt*2.]) for example
# if strategy == 'vmax':
# # implement different strategies
# if vab < vab_max and iab < current_max:
# vab = vab * np.min([0.9 * vab_max / vab, 0.9 * current_max / iab]) # TODO: check if setting at 90% of max as a safety margin is OK
# self.tx.exec_logger.debug(f'vmax strategy: setting VAB to {vab} V.')
# elif strategy == 'vmin':
# if vab <= vab_max and iab < current_max:
# vab = vab * np.min([0.9 * vab_max / vab, vmn_min / np.abs(vmn), 0.9 * current_max / iab]) # TODO: check if setting at 90% of max as a safety margin is OK
# elif strategy != 'constant':
# self.tx.exec_logger.warning(f'Unknown strategy {strategy} for setting VAB! Using {vab} V')
# else:
# self.tx.exec_logger.debug(f'Constant strategy for setting VAB, using {vab} V')
# # self.tx.turn_off()
# if switch_pwr_off:
# self.tx.pwr.pwr_state = 'off'
# if switch_tx_pwr_off:
# self.tx.pwr_state = 'off'
# rab = (np.abs(vab) * 1000.) / iab
# self.exec_logger.debug(f'RAB = {rab:.2f} Ohms')
# if vmn < 0:
# polarity = -1 # TODO: check if we really need to return polarity