pro polarization_fraction_maps45, p0in, p45in, p90in, p_fraction, Iu, Ip ; this program will calculate the polarization fraction three ; different ways. ; INPUTS: ; po, p45, p90 : two dimensional images through each polarizer ; OUTPUTS: ; p_fract : three dimensional array, p_fract[*,*,0] is the ; polarization fraction calculated with the first formula, ; p_fract[*,*,1] with the second, etc. ; Iu, Ip : three dimensional arrays with the upolarized and polarized ; intensities p0 = double(p0in) p45 = double(p45in) p90 = double(p90in) p_angle = atan( ((2.0D*p45) - p0 - p90)/(p0-p90) ) / 2D imsize = size(p0, /dimensions) Ip = dblarr(imsize[0], imsize[1], 3, /nozero) Iu = Ip p_fraction = Ip ; first formula Ip[*, *, 0] = (p0 - p90) / ( cos(p_angle)^2D - sin(p_angle)^2D ) Iu[*, *, 0] = p0 + p90 - Ip[*, *, 0] p_fraction[*, *, 0] = Ip[*, *, 0]/(p0+p90) ; second formula Ip[*, *, 1] = (p45 - p90) / ( (1D + sin(2D * p_angle))/2D - sin(p_angle)^2D ) Iu[*, *, 1] = p0 + p90 - Ip[*, *, 1] p_fraction[*, *, 1] = Ip[*, *, 1]/(p0+p90) ; third formula Ip[*, *, 2] = (p45 - p0 ) / ( (1D + sin(2D * p_angle))/2D - cos(p_angle)^2D ) Iu[*, *, 2] = p0 + p90 - Ip[*, *, 2] p_fraction[*, *, 2] = Ip[*, *, 2]/(p0+p90) end