示例#1
0
    def __init__(self, portName, baud, alphaIds):
        ControlBox.__init__(self, portName, baud)

        # if alphaIds is a single interger, change it to a list
        if isinstance(alphaIds, int):
            alphaIds = self.change_int_to_list(alphaIds)

        self.alphaIds = alphaIds
        self.alphaLims = np.tile([[-90], [0], [90]], len(alphaIds))
        self.musecLims = np.tile([[600], [1500], [2400]], len(alphaIds))
        self.alphaOrient = [-1, 1, 1, -1, 1, -1]
        self.alphaHome = [0, 0, 0, 0, 0, 0]
        self.alphaSleep = [0, 0, 0, 0, 0, 0]

        #interpolation of angles to positions
        self.ticks = [0] * len(self.alphaIds)

        for i in range(len(alphaIds)):
            # creates an object
            self.ticks[i] = interp1d(self.alphaLims[:, i],
                                     self.musecLims[:, i],
                                     fill_value="extrapolate")
示例#2
0
    def __init__(self, portName, baud):
        ControlBox.__init__(self, portName, baud)
        self.alphaIds = [1, 2, 3, 4, 5]
        self.alphaLims = np.array([
            -90, -90, -90, -90, -90, 0.00, 0, 0, 0, 0, 0, 3.0 / 4.0, 90, 90,
            90, 90, 80, 1.125
        ])
        self.alphaLims.shape = (3, 6)

        self.musecLims = np.tile([[1000], [1500], [2000]], len(self.alphaIds))
        self.alphaOrient = [-1, -1, 1, 1, -1]

        #interpolation of angles to positions (alphaLims to musec)
        self.ticks = [0] * len(self.alphaIds)

        for i in range(len(self.alphaIds)):
            # creates an object
            self.ticks[i] = interp1d(self.alphaLims[:, i],
                                     self.musecLims[:, i],
                                     fill_value="extrapolate")

        self.alphaHome = [0, 0, 0, 0, 0]
        self.alphaSleep = [0, 0, 0, 0, 0]