;+ ; NAME: ; RemoteView_FOV ; PURPOSE: ; Calculates image of sky from 3D density matrix for a given viewer location ; and viewing direction. ; CATEGORY: ; RemoteView package: Image construction ; CALLING SEQUENCE: FUNCTION RemoteView_FOV, V3D, M3D, FOVCube, FOVInfo, FOVLoc, $ view_index=view_index, FOVCubeB=FOVCubeB, silent=silent ; INPUTS: ; V3D array[1]; type; structure ; structure array containing information about the views ; to be calculated. ; M3D array[1]; type: structure ; structure containing 3D density matrices and associated ; information; passed to RemoteView_Init_FOV ; OPTIONAL INPUT PARAMETERS: ; view_index=view_index ; scalar; type: integer ; index of a single view to be processed ; /silent suppress informational messages ; OUTPUTS: ; FOVCube array[nDim[0],nDim[1],nDim[2],nView] ; Output matrix with interpolated data values. ; This is the matrix that needs to be integrated along the 3rd ; (line-of-sight) dimension to create the 2D sky image ; FOVInfo array[nView]; type: structure ; structure array combining information about a the 3D density ; matrices for all views. ; FOVLoc array[3,nDim[0],nDim[1],nDim[2]]; type: float ; (only returned when 'view_index' is specified) ; heliographic locations at all of the line of sight segments. ; Always returned in spherical coordinates (even for rectangular ; matrix) i.e. heliographic longitude, latitude in radians; and ; heliocentric distance in AU. ; FOVCubeB = FOVCubeB ; array[nDim[0],nDim[1],nDim[2],nView] ; Output matrix with interpolated data values for magnetic field. ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; TimeGet, TimeSystem, RemoteView_Init_FOV, RemoteView_FOV_Cube, SuperArray, destroyvar ; PROCEDURE: ; The FOVCube matrix is set up as a float array using the sizes of the two input ; structures. ; For each view Sky_Grid_Struct is called, returning a new structure combining ; all the necessary information (3D density matrix and view). ; RemoteView_FOV_Cube does the actual actual calculation; its output is used to fill the ; FOVCube array. ; MODIFICATION HISTORY: ; DEC-2000, Paul Hick (UCSD/CASS) ; OCT-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Added keyword /silent ;- InitVar, silent, 0 nView = V3D.nView ; # View states (including stereo doubling) nDim = V3D.nDim ; Three spatial dimensions of view single_view = IsType(view_index, /defined) i = single_view*view_index IF silent LE 1 THEN message, /info, $ 'View'+strcompress(i+1)+'/'+strcompress(nView,/rem)+ $ ' ('+TimeGet((*V3D.Time)[i],/ymd,upto=TimeUnit(/minute))+' UT)'+ $ ' starts at '+TimeGet(TimeSystem(/silent),/ymd,upto=TimeUnit(/minute)) FOVInfo = RemoteView_Init_FOV(i, V3D, M3D) IF silent LE 0 THEN IF single_view THEN print, $ 'Time : '+TimeGet(FOVInfo.view_time,/ymd,upto=TimeUnit(/minutes)), + $ 'Location : ' + $ 'Lng=' ,FOVInfo.view_loc[0]*!radeg, ' deg; ' + $ 'Lat=' ,FOVInfo.view_loc[1]*!radeg, ' deg; ' + $ 'R=' ,FOVInfo.view_loc[2] , ' AU', $ 'Direction: ' + $ 'Lng=' ,FOVInfo.view_dir[0]*!radeg, ' deg; ' + $ 'Lat=' ,FOVInfo.view_dir[1]*!radeg, ' deg', $ 'FoV/2 : ' + $ 'x-size=',FOVInfo.view_fov[0]*!radeg, ' deg; ' + $ 'y-size=',FOVInfo.view_fov[1]*!radeg, ' deg; ' + $ 'tilt=' ,FOVInfo.view_tilt *!radeg, ' deg', $ format='(8X,A, /, 8X,3(A,F6.2),A, /, 8X,2(A,F6.2),A, /, 8X,2(A,F6.2),A,F7.2,A)' Status = RemoteView_FOV_Cube(FOVInfo, FOVCube, R=FOVLoc, bcube=FOVCubeB) IF NOT single_view AND nView GT 1 THEN BEGIN destroyvar, FOVLoc Status = replicate (Status , nView) FOVInfo = replicate (FOVInfo, nView) FOVCube = SuperArray(FOVCube, nView, /trail) Bpresent = n_elements(FOVCubeB) ne 0 IF Bpresent THEN FOVCubeB = SuperArray(FOVCubeB, nView, /trail) FOR i=1,nView-1 DO BEGIN IF silent LE 1 THEN message,/info, $ 'View #'+strcompress(i)+' ('+TimeGet((*V3D.Time)[i],/ymd)+' UT)'+ $ ' starts at '+TimeGet(TimeSystem(/silent), /ymd, upto=TimeUnit(/minute)) FOVInfo[i] = RemoteView_Init_FOV(i, V3D, M3D) Status [i] = RemoteView_FOV_Cube(FOVInfo[i], tmp, bcube=BCube) IF Status[i] THEN BEGIN FOVCube[*,*,*,i] = tmp IF Bpresent THEN FOVCubeB[*,*,*,i] = BCube ENDIF ENDFOR ENDIF RETURN, Status & END