Ejemplo n.º 1
0
    def get_sensitivity(self, unit='V'):
        """
        Get the current sensitivity, in Volts.

        >>> li.get_sensitivity()
        0.1

        If the `unit` kwarg is specified, the value will
        be converted to the desired unit instead.

        >>> li.get_sensitivity(unit='uV')
        100000.

        Using `unit=True` will return a value in a 2-tuple
        along with the most sensible unit (as a string).

        >>> li.get_sensitivity(unit=True)
        (100, 'mV')

        """
        val = self.bus.ask("SEN")
        q, u = self.sensitivities[int(val)]
        if unit in self._V_scales.keys():
            sens = q * self._V_scales[u] / self._V_scales[unit]
            return sciround(sens, 1)
        else:
            return q, u
Ejemplo n.º 2
0
    def get_sensitivity(self, unit='V'):
        """
        Get the current sensitivity, in Volts.

        >>> li.get_sensitivity()
        0.1

        If the `unit` kwarg is specified, the value will
        be converted to the desired unit instead.

        >>> li.get_sensitivity(unit='uV')
        100000.

        Using `unit=True` will return a value in a 2-tuple
        along with the most sensible unit (as a string).

        >>> li.get_sensitivity(unit=True)
        (100, 'mV')

        """
        val = self.bus.ask("SEN")
        q,u = self.sensitivities[int(val)]
        if unit in self._V_scales.keys():
            sens = q * self._V_scales[u] / self._V_scales[unit]
            return sciround(sens, 1)
        else:
            return q,u
Ejemplo n.º 3
0
    def set_timediv(self, to):
        """
        Set time per division, in seconds.

        :param to:  Desired seconds per division.
                    Acceptable values range from 10 seconds to 1, 2, or
                    4ns, depending on model, in a 1-2-4 sequence.
        :type to:   float

        """
        to = sciround(to, 1)
        if to in self._acceptable_timedivs:
            self.bus.write('HOR:MAI:SCA %.0E' % to)
        else:
            raise InstrumentError('Timediv not in %s' %
                                  str(self._acceptable_timedivs))
Ejemplo n.º 4
0
    def set_timediv(self, to):
        """
        Set time per division, in seconds.

        :param to:  Desired seconds per division.
                    Acceptable values range from 10 seconds to 1, 2, or
                    4ns, depending on model, in a 1-2-4 sequence.
        :type to:   float

        """
        to = sciround(to, 1)
        if to in self._acceptable_timedivs:
            self.bus.write('HOR:MAI:SCA %.0E' % to)
        else:
            raise InstrumentError('Timediv not in %s' %
                                  str(self._acceptable_timedivs))