pro hafb_get_camera_data, camera_n, camera_data, all=all @compile_opt.pro ;+ ; NAME: ; hafb_get_camera_data ; PURPOSE ; Return camera data structure for given camera number, or array of all ; camera sructures. ; INPUTS ; camera_n = 1-3, 0 for Table Mountain test data, ignored for /all option ; OUTPUTS ; camera_data = Structure or array of structures (/all option) containing ; projection and orientation parameters. With the /all option, the 0-3 array ; elements are the structures for cameras 0-3. ; MODIFICATION HISTORY: ; 21-Feb-2003 DRM adapted from original get_camera_data, changed to polar projection parameters. ; Parameters optimized with polar version of point_refine_test_camera.pro ; PROCEDURE: ; The parameters (camera_data tags) : ; ; number = Camera number ; x_pole = x-coordinate of pole of projection ; y_pole = y-coordinate of pole of projection ; y_ref = y-coord of projection equator (at x = x_pole) ; radius_scale = sky-radians-per-radial-pixel ; orient_quaternion = Quaternion that rotates native coordinates to BODY coordinates ; See get_quaternion_from_euler.pro to get q from initial Euler angles. ; Note that the native coordinate origin (lon=0., lat=0.) is at (x_pole, y_ref) ; version = Parameter version number ;- if (not keyword_set(all)) then begin start_cam = camera_n stop_cam = camera_n endif else begin start_cam = 1 stop_cam = 3 endelse for icam = start_cam,stop_cam do begin case icam of 1: begin camera_data = { $ number : 1, $ x_pole : 631.96653d0, $ y_pole : 1241.6218d0, $ y_ref : 61.6128910d0, $ radius_scale : .00096561615d0, $ orient_quaternion : [ 0.46807739d0, 0.84666176d0, 0.067758569d0, -0.24387742d0], $ version : 1.0, $ date : '21 February 2003' } end 2: begin camera_data = { $ number : 2, $ x_pole : 625.78564d0, $ y_pole : 1241.4524d0, $ y_ref : 61.5792590d0, $ radius_scale : .00096591553d0, $ orient_quaternion : [ 0.017651734d0, 0.96032546d0, 0.045705368d0, -0.27454405d0], $ version : 1.0, $ date : '21 February 2003' } end 3: begin camera_data = { $ number : 3, $ x_pole : 627.96738d0, $ y_pole : 1237.6987d0, $ y_ref : 59.044922d0, $ radius_scale : .00096737833d0, $ orient_quaternion : [-0.43870382d0, 0.86674816d0, 0.10451884d0, -0.21298450d0], $ version : 1.0, $ date : '21 February 2003' } end endcase if (keyword_set(all)) then begin ; Make structure array at first iteration (need a structure first to make the array). if (icam eq start_cam) then camera_array = replicate(camera_data,4) ; Assign the camera data to the array index value. ; Note that assignment of entire structures all at once is not allowed in this situation. camera_array[icam].number = camera_data.number camera_array[icam].x_pole = camera_data.x_pole camera_array[icam].y_pole = camera_data.y_pole camera_array[icam].y_ref = camera_data.y_ref camera_array[icam].radius_scale = camera_data.radius_scale camera_array[icam].orient_quaternion = camera_data.orient_quaternion camera_array[icam].version = camera_data.version camera_array[icam].date = camera_data.date endif endfor ; Reset output variable to camera array if /all is set. if (keyword_set(all)) then camera_data = camera_array return & end