def ETMY(DCQPD1,DCQPD2):#ETMY
print("Sensor of ETMY")
print(" factor of QPD1:",(-1*DCQPD2[0]/DCQPD1[0]))#DCQPD1[0]
print(" factor of QPD2:",(1))#DCQPD1[0]
print(" ITMY:",(-1*DCQPD2[0]/DCQPD1[0])*DCQPD1[0]+DCQPD2[0])
print(" ETMY:",(-1*DCQPD2[0]/DCQPD1[0])*DCQPD1[1]+DCQPD2[1])
ETMY_factor=(-1*DCQPD2[0]/DCQPD1[0])*DCQPD1[1]+DCQPD2[1]
print(" factor of QPD1:",(-1*DCQPD2[0]/DCQPD1[0])/ETMY_factor)#DCQPD1[0]
print(" factor of QPD2:",(1)/ETMY_factor)#DCQPD1[0]
print(" ITMY:",((-1*DCQPD2[0]/DCQPD1[0])*DCQPD1[0]+DCQPD2[0])/ETMY_factor)
print(" ETMY:",((-1*DCQPD2[0]/DCQPD1[0])*DCQPD1[1]+DCQPD2[1])/ETMY_factor)
return
def ITMY(DCQPD1,DCQPD2):#ITMY
print("Sensor of ITMY")
print(" factor of QPD1:",(-1*DCQPD2[1]/DCQPD1[1]))#DCQPD1[0]
print(" factor of QPD2:",(1))#DCQPD1[0]
print(" ITMY:",(-1*DCQPD2[1]/DCQPD1[1])*DCQPD1[0]+DCQPD2[0])
print(" ETMY:",(-1*DCQPD2[1]/DCQPD1[1])*DCQPD1[1]+DCQPD2[1])
ITMY_factor=(-1*DCQPD2[1]/DCQPD1[1])*DCQPD1[0]+DCQPD2[0]
print(" factor of QPD1:",(-1*DCQPD2[1]/DCQPD1[1])/ITMY_factor)#DCQPD1[0]
print(" factor of QPD2:",(1)/ITMY_factor)#DCQPD1[0]
print(" ITMY:",((-1*DCQPD2[1]/DCQPD1[1])*DCQPD1[0]+DCQPD2[0])/ITMY_factor)
print(" ETMY:",((-1*DCQPD2[1]/DCQPD1[1])*DCQPD1[1]+DCQPD2[1])/ITMY_factor)
return
##coherence
#ITMY_P,ITMY_Y,ETMY_P,ETMY_Y
#QPD1=[0.99,0.99,0.999,0.99]
#QPD2=[0.91,0.99,0.999,0.88]
#10Hz excitation of each mirrors
#ITMY_P,ITMY_Y,ETMY_P,ETMY_Y
QPD1=[0.0334647,-0.0385575,-0.131931,-0.120568]
QPD2=[0.0376037,0.1278,-0.104595,0.013737]
#QPD2=[0.0376037,0.1278,-0.104595,0]
#PIT
DCQPD1=[QPD1[0],QPD1[2]]
DCQPD2=[QPD2[0],QPD2[2]]
print(" ITMY_PIT,ETMY_PIT")
print("TMSYA1_PIT:",DCQPD1)
print("TMSYA2_PIT:",DCQPD2)
ETMY(DCQPD1,DCQPD2)
ITMY(DCQPD1,DCQPD2)
DCQPD1=[QPD1[1],QPD1[3]]
DCQPD2=[QPD2[1],QPD2[3]]
print(" ITMY_YAW,ETMY_YAW")
print("TMSYA1_PIT:",DCQPD1)
print("TMSYA2_PIT:",DCQPD2)
ETMY(DCQPD1,DCQPD2)
ITMY(DCQPD1,DCQPD2)