; This procedure converts points on the inside surface ; of the calibration integrating sphere from the coordinate ; referenced to the center of rotation of a specific DISR ; instrument's window to coordinates belonging to the coordinate ; system centered at the physical center of the integrating ; sphere. It returns these both as Cartesian and spherical ; coordinates. pro replot,a,b,c,radius,alph,beta,al0,be0,rho,s,xprime,yprime,zprime,x,y,z,thet,phi pi=3.1415926535 rad=pi/180. newa=-1.*a newb=-1.*b newc=-1.*c alrad=alph*rad berad=beta*rad delta=sqrt(newa^2+newb^2+newc^2) al0rad=acos(newc/delta) if (newa lt 0.) then begin be0rad=(pi+atan(newb/newa)) goto, jump2 endif if (newa eq 0.) and (newb ge 0.) then begin be0rad=pi/2. goto, jump2 endif if (newa eq 0.) and (newb lt 0.) then begin be0rad=-pi/2. goto, jump2 endif be0rad=atan(newb/newa) jump2: if (be0rad lt 0) then begin be0rad=be0rad+2.*pi endif rho=acos(cos(alrad)*cos(al0rad)+sin(alrad)*sin(al0rad)*cos(berad-be0rad)) ;s=sqrt(radius^2-delta^2+2*delta^2*cos(rho)^2 $ ; +2*delta*cos(rho)*sqrt(radius^2-delta^2+delta^2*cos(rho)^2)) s=sqrt(radius^2+delta^2-2*delta^2*sin(rho)^2 $ +2*delta*cos(rho)*sqrt(radius^2-delta^2+delta^2*cos(rho)^2)) xprime=s*sin(alrad)*cos(berad) yprime=s*sin(alrad)*sin(berad) zprime=s*cos(alrad) x=-yprime-b y=xprime+a z=zprime+c thet=acos(z/radius)/rad if (x lt 0.) then begin phi=(pi+atan(y/x))/rad goto, jump1 endif if (x eq 0.) and (y ge 0.) then begin phi=pi/2./rad goto, jump1 endif if (x eq 0.) and (y lt 0.) then begin phi=-pi/2./rad goto, jump1 endif phi=atan(y/x)/rad jump1: if (phi lt 0) then begin phi=phi+360. endif al0=al0rad/rad be0=be0rad/rad rho=rho/rad return end