;Function LoadCamInfo ; Create a structure describing the orientation and lens distortion ; of the four cameras ; ;Input ; cols - (Optional) 4-element array of pixel columns for each camera ; Defaults to all cameras being 180cols wide ; rows - (Optional) 4-element array of pixel rows for each camera ; Defaults to all cameras being 360rows high ; thfovx - (Optional) 4-element array of tangent of horizontal half-FOV angle ; Defaults to specify a 44deg full horizontal field of view ; thfovy - (Optional) 4-element array of tangent of vertical half-FOV angle ; Defaults to specify a 44deg full vertical field of view ; axis - (Optional) 4-element array of camera rotation axes, 1=x,2=y,3=z ; Defaults to standard CIPS camra positioning ; angle - (Optional) 4-element array of camera rotation angles ; Defaults to standard CIPS camra positioning ; /grid - If not set (default) treats each ray as the center of a pixel. The ; outside rays will be set in from the edge of the FOV by 1/2 pixel. ; If set, treats each ray as a node on a grid covering the entire FOV. ; The outer rays on all four sides will be exactly on the edge of ; the FOV. ;Return ; A structure containing all the above, and the camera pixel vectors ; (lens distortion information) in the format cam_to_lla() expects ;Note ; Camera array indexes go [PX,MX,PY,MY] function loadcaminfo,cols=cols,rows=rows,fovx,fovy,angle1,angle2,angle3,grid=grid,xtk=xtk,atk=atk,xtksign=xtksign,atksign=atksign if n_elements(cols) eq 0 then cols=[1,1,1,1]*170 if n_elements(rows) eq 0 then rows=[1,1,1,1]*340 if n_elements(fovx) eq 0 then fovx=[42.13, 41.88, 42.00, 41.84] if n_elements(fovy) eq 0 then fovy=fovx if n_elements(thfovx) eq 0 then thfovx=[1d,1d,1d,1d]*tan(fovx*!const.dtor/2.0) if n_elements(thfovy) eq 0 then thfovy=[1d,1d,1d,1d]*tan(fovy*!const.dtor/2.0) if n_elements(xtksign) eq 0 then xtksign=-1 ;This is correct, 3.12 and before was equivalent to using +1 if n_elements(atksign) eq 0 then atksign=1 if n_elements(xtk) eq 0 then xtk=[0.43d,-0.14d,-0.11d, 0.50d] ;Crosstrack delta from Bill McClintock if n_elements(atk) eq 0 then atk=[0.46d, 0.27d, 0.14d, 0.46d] ;Alongtrack delta from Bill McClintock if n_elements(angle1) eq 0 then angle1=[0d,0d,-19d,19d]-xtk*xtksign ;Crosstrack rotation around s/c x, v3.12 processed with a - sign if n_elements(angle2) eq 0 then angle2=[39d,-39d,0d,0d]-atk*atksign ;Alongtrack rotation around s/c y, v1.1 processed with a + sign if n_elements(angle3) eq 0 then angle3=[00d,0d,0d,0d] ;barrel twist if n_elements(tlm_rotate) eq 0 then tlm_rotate=[4,6,7,5] caminfo={caminfo, $ rows: ptr_new(rows), $ cols: ptr_new(cols), $ thfovx: ptr_new(thfovx), $ thfovy: ptr_new(thfovy), $ pixelvec: ptr_new(dblarr(n_elements(cols),max(cols),max(rows),3)), $ angle1: ptr_new(angle1*!const.dtor), $ angle2: ptr_new(angle2*!const.dtor), $ angle3: ptr_new(angle3*!const.dtor), $ cam_ref_x: compose_grid([0d,0,0,0],[0d,0,0,0],[1d,1,1,1]) $ } reloadcaminfo,caminfo return, caminfo end