def map_mass_to_dac(self, mass, detname): detname = get_detector_name(detname) d = self.mftable.get_table() _, xs, ys, p = d[detname] dac = mass_cal_func(p, mass) self.debug('map mass to dac {} >> {}'.format(mass, dac)) return dac
def map_mass_to_dac(self, mass, detname): """ convert a mass value from amu to dac for a given detector :param mass: float, amu :param detname: std, name of a detector, e.g. H1 :return: float, dac voltage """ from pychron.spectrometer.mftable import get_detector_name, mass_cal_func detname = get_detector_name(detname) d = self.mftable.get_table() _, xs, ys, p = d[detname] dac = mass_cal_func(p, mass) self.debug('map mass to dac {} >> {}'.format(mass, dac)) return dac
def func(x, *args): c = list(p) c[-1] -= dac return mass_cal_func(c, x)