;+ ; NAME: ; PlotPlanarCut ; PURPOSE: ; Plot map of solar disk ; CATEGORY: ; sat/idl/toolbox/graphics ; CALLING SEQUENCE: PRO PlotPlanarCut, zz, ut=ut , $ radius = radius , $ euler_angles= euler_angles , $ degrees = degrees , $ euler_info = euler_info , $ breakval = breakval , $ title = title , $ upto = upto , $ body = body , $ user_position=user_position , $ user_align = user_align , $ user_string = user_string , $ _extra=_extra ; INPUTS: ; zz array[n,n]; type: float ; function value on disk ; ut=ut array[1]; type: time structure ; UT time used for ephemeris calculation ; OPTIONAL INPUT PARAMETERS: ; upto=upto scalar; type: integer; default: none ; return value of href=TimeUnit= function. ; The 'ut' time is plotted in the upper right ; corner using TimeGet. The 'upto' keyword ; determines at which time unit the string ; is terminated. ; radius=radius scalar; type: float; default: 1.0 ; radius of circular planar cut (in AU) ; body=body scalar or array; type: string ; names of bodies to be plotted ; If trailing char is '&' ; then the orbit is also plotted ; euler_angles=euler_angles ; /degrees if set, angles are in degrees ; default is radians ; euler_info=euler_info ; title=title scalar; type: string ; string plotted in lower-left corner ; breakval=breakval ; array; type: integer or float ; contour levels passed to GetColors ; ; user_string=user_string ; scalar or array; type: string ; User specified string(s) to be plotted ; user_position=user_position ; array[2,n]; type: real; default: [[0.05,0.95],[0.80,0.05]] ; Start position(s) of user string(s) in normal ; coordinates. The default allows plotting of two ; user-defined strings in upper-left and lower-right ; corners. ; ; _extra=_extra additional plot keywords ; OUTPUTS: ; (plot) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar, IsType, setup3d, IsType, GetColors, plot3darc, gridgen ; big_eph, big_orbit, EulerRotate, TimeGet ; PROCEDURE: ; The appearance of the map is controlled by specifying ; plot keywords (passed here through the _extra keyword): ; ; Control character size with keyword charsize ; Control character thickness with keyword charthick ; Control size of body symbol with keyword symsize ; Control thickness of orbit with keyword thick ; MODIFICATION HISTORY: ; JUN-2006, Paul Hick (UCSD/CASS) ; OCT-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Replaced jpl_eph and jpl_orbit calls by big_eph ; and big_orbit calls. ;- InitVar, euler_angles, [0.0,0.0,0.0] InitVar, euler_info , 'from heliographic to heliographic' InitVar, radius , 1.0 center = round([0.54,0.48]*[!d.x_size,!d.y_size]); Location of Sun in pixels rdisk = ((size(zz,/dim))[0]-1.0)/2.0 ; Radius of planar cut in pixels corner = center-rdisk ; Lower left pixel of square enclosing planar cut ; Set up 3D transformation for adding grids d0 = center-rdisk ; Square around planar cut in device coordinates d1 = center+rdisk n0 = convert_coord(d0, /device, /to_norm) ; Square around planar cut in normal coordinates n1 = convert_coord(d1, /device, /to_norm) n0[2] = n0[1] ; Normalized range in z-direction same as in y-direction n1[2] = n1[1] d0 = -radius*[1,1,1] ; Square around planar cut in data coordinates (-radius to +radius) d1 = radius*[1,1,1] origin = [0,0,0] ; Unit vectors in data coordinates (1 AU length) xunit = [1,0,0] yunit = [0,1,0] zunit = [0,0,1] ; Set up a coordinate system with x and y-axis in the plane of the display ; x = horizontal to the right, y = vertical up; z = out from the display towards the eye setup3d, d0, d1, n0, n1, /xyplane erase CASE IsType(breakval, /defined) OF 0: zz = bytscl(zz, /nan) 1: zz = GetColors(zz, breakval, /open, /badbackground, /legend, _extra=_extra) ENDCASE tv, zz, corner[0], corner[1] ; Mark position of Sun at origin plots, /t3d, origin, psym=1, _extra=_extra ; Plot Earth symbol at location Earth FOR i=0,n_elements(body)-1 DO BEGIN cbody = body[i] orbit = strpos(cbody,'&') NE -1 ; Need to plot orbit? IF orbit THEN cbody = strmid(cbody,0,strpos(cbody,'&')); Strip '&' char cbody = big_body(cbody) p = big_eph(ut, body=cbody, /to_heliographic, /precess, /silent) p = EulerRotate(-reverse(euler_angles), p, /rectangular, degrees=degrees) cc = gridgen(33, range=[0,2*!pi]) ; For Earth plot a circle with a cross inside; ; For everything else plot a circle CASE 1 OF strpos(strlowcase(cbody),'earth') NE -1 : usersym, [cos(cc),-1,0,0,0], [sin(cc),0,0,1,-1],_extra=_extra strpos(strlowcase(cbody),'stereo') NE -1 : usersym, .5*cos(cc), .5*sin(cc), _extra=_extra ELSE : usersym, cos(cc), sin(cc),_extra=_extra ENDCASE plots, /t3d, p, psym=8, _extra=_extra IF orbit THEN BEGIN p = big_orbit(ut, body=cbody, /to_heliographic, /precess, /silent) p = EulerRotate(-reverse(euler_angles), p, /rectangular, degrees=degrees) plots, p, _extra=_extra ENDIF ENDFOR ; Label UT time xyouts, 0.99, 0.95, /norm, align=1, _extra=_extra, $ TimeGet(ut, /ymd, upto=upto, /roundt)+' UT' ; Label title IF IsType(title, /defined) NE 0 THEN $ xyouts, 0.05, 0.01, /norm, _extra=_extra, title PlotUserstring, user_string, user_position, $ align = user_align , $ charsize= charsize , $ _extra=_extra RETURN & END