示例#1
0
    def MakeIntensityMatrix(self,ThetaHwp,D_Sign,ThetaDer,Altitude,UsePolarizer=False,UseSource=False):
        '''
        Summary:     
            Creates the total mueller matrix of the system(No single/double difference).
            This matrix can only be used to measure the intensity of outcoming light for a 
            specific setup.
        Input:
            ThetaHwp: Half-waveplate angle (radians)
            D_Sign: Sign of the P0-90 polarizer matrix, should be either 1 or -1
            ThetaDer: Derotator angle (radians)
            Altitude: Altitude angle (radians). Not used when UseSource is True
            UsePolarizer: Wheter or not the calibration polarizer is used.
            UseSource: Wheter or not the internal light source is used. 
            When used S_In needs to take Mirror 4 into acount.
        Output:
            IntensityMatrix: Use like this --> Intensity = np.dot(IntensityMatrix,S_In)[0]
            where intensity is a float and S_In is the incoming stokes vector.
            Don't take [1],[2] or [3], these are not actually measured.
        '''
        M_CI = 0.5*Mt.ComMatrix(self.d*D_Sign,0) #Polarizer for single difference
        
        T_DerMin = Mt.RotationMatrix(-(ThetaDer+self.DeltaDer)) #Derotator with rotation
        M_Der = Mt.ComMatrix(self.E_Der,self.R_Der)
        T_DerPlus = Mt.RotationMatrix(ThetaDer+self.DeltaDer)
        
        T_HwpMin = Mt.RotationMatrix(-(ThetaHwp+self.DeltaHwp)) #Half-waveplate with rotation
        M_Hwp = Mt.ComMatrix(self.E_Hwp,self.R_Hwp)
        T_HwpPlus = Mt.RotationMatrix(ThetaHwp+self.DeltaHwp)
        
        T_Cal = Mt.RotationMatrix(-self.DeltaCal)#Optional polarizer      
        M_Polarizer = 0.5*Mt.ComMatrix(self.d,0) 
        
        Ta = Mt.RotationMatrix(Altitude) #Telescope mirrors with rotation
        M_UT = Mt.ComMatrix(self.E_UT,self.R_UT)

        IntensityMatrix
        if(UseSource): #If using internal calibration source
 
            if(UsePolarizer):
                IntensityMatrix = np.linalg.multi_dot([M_CI,T_DerMin,M_Der,T_DerPlus,T_HwpMin,M_Hwp,T_HwpPlus,T_Cal,M_Polarizer])
            else:
                IntensityMatrix = np.linalg.multi_dot([M_CI,T_DerMin,M_Der,T_DerPlus,T_HwpMin,M_Hwp,T_HwpPlus])
        else:
            if(UsePolarizer):
                IntensityMatrix = np.linalg.multi_dot([M_CI,T_DerMin,M_Der,T_DerPlus,T_HwpMin,M_Hwp,T_HwpPlus,T_Cal,M_Polarizer,Ta,M_UT])
            else:
                IntensityMatrix = np.linalg.multi_dot([M_CI,T_DerMin,M_Der,T_DerPlus,T_HwpMin,M_Hwp,T_HwpPlus,Ta,M_UT])

        return IntensityMatrix
示例#2
0
def CalcI(Theta_Hwp, PositivePol, Q_IP=0, U_IP=0):

    M_Hwp = Mt.ApplyRotation(Mt.ComMatrix(0, np.pi), Theta_Hwp)
    M_Pol = Mt.Polarizer(PositivePol)
    M_IP = np.zeros((4, 4))
    M_IP[1, 0] = Q_IP
    M_IP[2, 0] = U_IP
    M_IP[0, 0] = 1
    M_IP[1, 1] = 1
    M_IP[2, 2] = 1
    M_IP[3, 3] = 1

    return np.linalg.multi_dot([M_Pol, M_IP, M_Hwp])
示例#3
0
        CalcI(Theta_Hwp_Plus, True, IP_Q, IP_U) -
        CalcI(Theta_Hwp_Plus, False, IP_Q, IP_U))
    X_Min = Round(
        CalcI(Theta_Hwp_Min, True, IP_Q, IP_U) -
        CalcI(Theta_Hwp_Min, False, IP_Q, IP_U))
    Measured_IP_Plus_List.append(X_Plus[0, 0])
    Measured_IP_Min_List.append(X_Min[0, 0])

#print(X_Plus)
#print(X_Min)
#plt.plot(IP_Q_List,Measured_IP_Plus_List)
#plt.plot(IP_Q_List,Measured_IP_Min_List)
#plt.show()

R_HWP = 170 * np.pi / 180
M_HWP_Q1 = Mt.ApplyRotation(Mt.ComMatrix(0, R_HWP), 0 * np.pi / 180)
M_HWP_Q2 = Mt.ApplyRotation(Mt.ComMatrix(0, R_HWP), 45 * np.pi / 180)
M_HWP_U1 = Mt.ApplyRotation(Mt.ComMatrix(0, R_HWP), 22.5 * np.pi / 180)
M_HWP_U2 = Mt.ApplyRotation(Mt.ComMatrix(0, R_HWP), 67.5 * np.pi / 180)

M_HWP_X1 = Mt.ApplyRotation(Mt.ComMatrix(0, R_HWP), 11.25 * np.pi / 180)
M_HWP_X2 = Mt.ApplyRotation(Mt.ComMatrix(0, R_HWP), 56.25 * np.pi / 180)
M_HWP_Y1 = Mt.ApplyRotation(Mt.ComMatrix(0, R_HWP), 33.75 * np.pi / 180)
M_HWP_Y2 = Mt.ApplyRotation(Mt.ComMatrix(0, R_HWP), 78.75 * np.pi / 180)

M_Der1 = Mt.ApplyRotation(Mt.ComMatrix(0, 90 * np.pi / 180), 40 * np.pi / 180)
M_Der2 = Mt.ApplyRotation(Mt.ComMatrix(0, 90 * np.pi / 180), 140 * np.pi / 180)

M_HWP_Q = M_HWP_Q1 - M_HWP_Q2
M_HWP_U = M_HWP_U1 - M_HWP_U2
M_HWP_X = M_HWP_X1 - M_HWP_X2