PRO vu_get_page, hdr, module, $ destination = destination , $ device = device , $ use_image = use_image , $ png = png , $ gif = gif , $ bmp = bmp , $ title = title , $ ut = ut , $ upto = upto , $ silent = silent , $ new = new , $ logo = logo , $ notwin = notwin @compile_opt.pro ; On error, return to caller InitVar, silent, 0 InitVar, gif, /key InitVar, png, /key InitVar, bmp, /key IF NOT gif+bmp THEN png = 1 ; If keyword use_image is used, then the order of the following two statements ; filling imgtype is important. E.g. for remote views the order must be the ; same as in remoteview_display3d (first png, then gif) IF png THEN boost, imgtype, '.png' IF gif THEN boost, imgtype, '.gif' IF bmp THEN boost, imgtype, '.bmp' dump_image = IsType(destination,/defined) IF dump_image THEN BEGIN is_dir = CheckDir(destination[0],/silent) CASE is_dir OF 1: is_file = 0 0: BEGIN i = strpos(destination[0],'') IF i NE -1 THEN destination[0] = strmid(destination[0],0,i)+module+strmid(destination[0],i+strlen('')) SetFileSpec, destination[0], /parse, status=is_file END ENDCASE dump_image = is_dir OR is_file ENDIF IF IsType(title, /undefined) THEN BEGIN CASE IsType(hdr, /structure) OF 0: SetFileSpec, hdr[0] ; hdr is file name 1: SetFileSpec, hdr[0].file ; hdr is header structure ENDCASE title = GetFileSpec(from='name', upto='type') ENDIF IF strlen(title) NE 0 THEN title += '_' IF IsType(ut, /defined) THEN BEGIN InitVar, upto, TimeUnit(/second) title += TimeGet(Carrington(ut[0],/get_time),ymd=1-dump_image,_ydoy=dump_image,upto=upto)+'_' ENDIF title += module IF dump_image THEN BEGIN ; If one directory is specified a single file is written to this directory. ; If a second directory is specified an additional backup copy is written ; to subdirectory 'module' of the 2nd directory. ; The first directory receives the file for the web page. The image file ; is created by reading/writing the content of the Z-buffer, or by moving ; an existing image file (specified in 'use_image'). FOR i=0,n_elements(imgtype)-1 DO BEGIN CASE 1 OF is_dir : img = filepath(root=destination[0], module+imgtype[i]) is_file: img = GetFileSpec(destination[0],upto='name')+imgtype[i] ENDCASE CASE IsType(use_image, /defined) OF 0: BEGIN catch, ierr CASE ierr OF 0 : get_page, img, /zbuffer, /freeze, silent=silent, logo=logo ELSE: IF silent LE 0 THEN message, /info, 'error writing '+hide_env(img) ENDCASE catch, /cancel END 1: ok = do_file(/move, use_image[i], img, silent=silent) ENDCASE ; The second directory is the backup directory (e.g ; $dat/nagoya/slow/image). Unless 'title' is set, the name of the ; backup image starts with 'file' (the name of the nv3d file used ; to create the plot). An identifier is appended for the time 'ut' ; at which the plot was created. IF n_elements(destination) EQ 2 THEN $ ok = do_file(/copy, silent=silent, img, $ filepath(root=destination[1], subdir=module, title+imgtype[i])) ENDFOR stretch IF IsType(device,/defined) THEN set_plot, device flip_colors ENDIF ELSE IF IsType(device,/defined) THEN BEGIN get_page, silent=silent, new=new, logo=logo, notwin=notwin ENDIF RETURN & END