;This is very simple program that will make a total ;linear polarization map out of Q and U maps. All ;you need to do is change the file names. ;To call the program in IDL, type .com fracpol.pro, ;then type fracpol and the program will make the file ;P.fits in the directory that you opened IDL in. Be ;sure that you have this text file saved in the ;directory you are working in as fracpol.pro pro fracpol xx=mrdfits('if1ch2xx.fits') ;put the xx map file name yy=mrdfits('if1ch2yy.fits') ;put the yy map file name xy=mrdfits('if1ch2xy.fits') ;put the xy map file name yx=mrdfits('if1ch2yx.fits') ;put the yx map file name i=(xx + yy)/2 q=(xx - yy)/2 u=(xy + yx)/2 p=sqrt(q^2 + u^2) writefits, 'I.fits', i ;put the I map file name writefits, 'Q.fits', q writefits, 'U.fits', u writefits, 'P.fits', p end