Exemplo n.º 1
0
    def __init__(self, *args):
        """
        Construct calculator.

        Calls the superclass constructor and then initializes a
        Heterodyne ITC object.
        """

        super(HeterodyneCalculator, self).__init__(*args)

        self.itc = HeterodyneITC()

        # Determine which combinations of mapping and switching modes
        # are allowed.
        valid_modes = self.itc.get_valid_modes()
        self.map_modes = OrderedDict(
            ((map_code,
              map_mode._replace(sw_modes=[
                  sw_code for (sw_code, sw_mode) in self.switch_modes.items()
                  if (map_mode.id, sw_mode.id) in valid_modes
              ])) for (map_code, map_mode) in self._map_modes.items()))