PRO position,cam,filt,az,za,cl,rw,small=small,RL=RL ;procedure to convert azimuth and zenith angles to row and collumn ;coordinates on a 512*512 image meanf = STRING(cam,filt,FORMAT='("/wesson/user/steele/schee/dat/c",I1,"f",I1,".meanparms")') ;files '*.meanparms' contain factors to fit azimuth and zenith angle numbers ;to row and collumn numbers on an image fl=findfile(meanf) IF fl(0) EQ '' THEN BEGIN ;in case no .meanparms exists for this camera/filter. meanf=STRING(cam,FORM='("/wesson/user/steele/schee/dat/c",I1,"f*.meanparms")') fl=findfile(meanf) meanf=fl(0) ENDIF OPENR,u,meanf,/GET_LUN READF,u,ccol,crow,stretch,warp,camaz ;fitting factors camaz = camaz*!RADEG IF NOT KEYWORD_SET(RL) THEN camaz=0. CLOSE,u & FREE_LUN,u numst=N_ELEMENTS(az) polrec3d,REPLICATE(1.,numst),za,az,x,y,z,/degrees ;jhuapl - convert polar ;coordinates to rectangular rot_3d,3,x,y,z,camaz,xp,yp,zp,/degrees ;rotation along the z-axis rho=stretch*SIN(warp*za*!DTOR) phi=+ATAN(yp,xp) xp=0 & yp=0 & zp=0 & x=0 & y=0 & z=0 ;variables to be returned cl=2.*(ccol-rho*SIN(phi)) rw=2.*(crow-rho*COS(phi)) IF KEYWORD_SET(small) THEN BEGIN & cl=cl/2. & rw=rw/2. & ENDIF phi=0 & rho=0 ;saving space RETURN END