;this is file 1dcolor_eg_fortex.idl ;READ THE DATAFILE... restore, '2dcolor_eg.sav' ;;;, /ve brtimg= brtimg* 100. ;WE HAVE ALREADY DEFINED: ;ps, equal to 1 for PostScript output and 0 for X window output. ;brtimg, the float intensity image (541 X 470 pixels), in physical units. ;ra_axis (541-element vector), the RA values of the pixels (the x-axis). ;dec_axis (470-element vector), the DEC values of the pixels (the y axis). ;========== THE FOLLOWING SECTION MAKES NECESSARY DEFINNITIONS ======= ;MAKE SURE DECOMOSED COLOR IS OFF (SO THAT WE USE A 256-ENTRY COLOR TABLE) device, decompos=0 ;TAKE CARE OF PS DETAILS... if n_elements( ps) eq 0 then ps=0 ;DEFINE THE PS OUTPUT FILE NAME... psfigname= '1dcolor_egtst.ps' ;DEFINE PLOTTING PARAMS--IMAGE CONTRAST, STRETCH... gamma = 0.75 brtmin = 0.00 brtmax = 128. ;DEFINE LABEL FOR X-DIRECTION OF COLORBAR... cbar_xtitle= textoidl('T \DeltaV') ;----SPECIFY THE WINDOW SIZE AND POSITIONS IN TERMS OF IMAGE SIZE ------------ ;--(SEE DOC FOR 'IMG_CBAR_POSNS' AND/OR IACIDL [ANNOTATED IMAGES HANDOUT])-- w_left=0.16 w_rght=0.05 w_bot=0.16 w_top=0.14 space=0.03 width=0.1 img_cbar_posns, w_left, w_rght, w_bot, w_top, space, width, $ imgposn, cbarposn, f_hor, f_ver ;PREDEFINE LINE WIDTHS, FONTS, ETC. USING SYSTEM VARIABLES... !p.font=ps-1 !p.thick=6 !x.thick=4 !y.thick=4 plotcolor= ps*!black+ (1-ps)*!white ;================ THE FOLLOWING SECTION DOES THE WORK ================== ;FIND THE IMAGE SIZE IN PIXELS.... sz= size( brtimg) countra= sz[1] ;nr pixels in RA, EQUAL TO 541 IN THIS EXAMPLE countdec= sz[2] ;nr pixels in DEC, EQUAL TO 470 IN THIS EXAMPLE ;USE THE POSITIONS TO OPEN AN X WINDOW OR A PS WINDOW DEPENDING ON VALUE OF PS... ;WE FOLLOW THE HANDOUT ``MAKING ANNOTATED IMAGES...'' ;OPEN AN X WINDOW OR A PS WINDOW DEPENDING ON VALUE OF PS... if ps then $ psopen, psfigname, xsize=f_hor*countra/100., ysize=f_ver*countdec/100., $ /inch, /color, /times, /bold, /isolatin1 $ else if wopen(2) eq 0 then window,2, xs= f_hor*countra, ys= f_ver*countdec ;STRETCH AND CONTRAST THE IMAGE... brtimgx= ( ((brtimg > brtmin) < brtmax)- brtmin)/(brtmax-brtmin) brtimgx= brtimgx ^gamma ;LOAD GREYSCALE COLOR TABLE... loadct,0 ;WRITE THE COLORBAR colorbar, pos=cbarposn, crange=[brtmin, brtmax], $ xtit=cbar_xtitle, cgamma=gamma, yticks=2,yminor=1;;, ystyle=9 sharpcorners ;WRITE THE IMAGE BEFORE CALLING SETCOLORS... tv, bytscl(brtimgx), $ imgposn[0], imgposn[1], /norm, xsize=1./f_hor, ysize=1./f_ver ;CALL SETCOLORS FOR THE VECTORIZED PORTION OF PS; THEN ANNOTATE... setcolors, /sys plot, ra_axis, dec_axis, position=imgposn, /nodata, /noerase, $ /xsty, xtit='RA, Hours', xra= reverse( minmax(ra_axis)), $ /ysty, ytit='Dec, Degrees' , color=plotcolor sharpcorners ;RETURN TO X WINDOWS... loadct,0 if ps then begin & psclose & setcolors, /sys ;RETURN EVERYTHING BACK TO NORMAL... !p.font=-1 !p.thick=0 !x.thick=0 !y.thick=0