go # # Create sample plots for analysis of exoplanetary data, for 47 UMa # macro read fgs01_img.mac readme p1 printme # # Create set of postscript files on disk with exoplanetary figures # readme # # Plot of rms valuse versus period, with a range of rms shown for each period # value (reflecting the the effect of varying phase from 0 to 2 pi). The best # rms value for each period is drawn in red. # dev postencap :SY :OFjnk.eps p1 dev x11 !sed -e 's/gBox: 18 144 592 718/gBox: 36 165 567 693/ig' /tmp/jnk.eps > rms_period.eps # # Plot of rms valuse versus phase, with a range of rms shown for each phase # value (reflecting the the effect of varying the period). The best rms value # for each period (not each phase!) is drawn in red. # dev postencap :SY :OFjnk.eps p2 dev x11 !sed -e 's/gBox: 18 144 592 718/gBox: 36 165 567 693/ig' /tmp/jnk.eps > rms_phase.eps # # Superimpose fitted sine wave over time and velocity data, with all data compressed to # a single period-length. Two full periods are shown, with all data points being drawn # twice. # dev postencap :SY :OFjnk.eps p3 dev x11 !sed -e 's/gBox: 18 144 592 718/gBox: 36 165 567 693/ig' /tmp/jnk.eps > sine_wave.eps # # Show contour distribution for period versus phase map of rms values. # Use colors to show valleys and peaks. # dev postencap :SY :OFjnk.eps p4 dev x11 !sed -e 's/gBox: 18 144 592 718/gBox: 30 165 567 693/ig' /tmp/jnk.eps > contours.eps # # Show surface plot of rms values as a function of period and phase. # dev postencap :SY :OFjnk.eps p5 dev x11 !sed -e 's/gBox: 18 144 592 718/gBox: 52 209 545 669/ig' /tmp/jnk.eps > surface.eps # # Convert all five figures into GIF format (smaller, web-friendly) # !convert rms_period.eps img_demo/rms_period.gif !convert rms_phase.eps img_demo/rms_phase.gif !convert sine_wave.eps img_demo/sine_wave.gif !convert contours.eps img_demo/contours.gif !convert surface.eps img_demo/surface.gif !rm rms_period.eps rms_phase.eps sine_wave.eps contours.eps surface.eps readme # # Read in data for fgs_f.dat (HD 95128 = 47 UMa) # cd img_demo # Read in 44 data points (times, velocities, and velocity errors) data fgs_f.dat read {t 1 v 2 ve 3} # # Read in 200 (period) by 200 (phase) grid of rms values data fgs_f.fit read {bst_period 1 bst_phase 2 bst_rms 3} data fgs_f.out read {all_period 1 all_phase 2 all_rms 3} # # Fill top_period, top_phase, and top_phase with: # # - top_period : single set of period values # - top_phase : phase with best rms for each period # - top_rms : best rms for each period # set r0 = all_period concat 0 set r1 = 0 concat all_period set top_period = r0 if ((r0 != r1) && (r0 != 0)) set top_phase = top_period * 0 set top_rms = top_period * 0 do i = 0, dimen(top_period)-1 { set r0 = all_phase if (all_period == top_period[$i]) set r1 = all_rms if (all_period == top_period[$i]) sort {r1 r0} set top_phase[$i] = r0[0] set top_rms [$i] = r1[0] } # # Fill period by phase image with rms values # set npr = dimen(top_period) set nph = dimen(r0) image($(npr),$(nph)) do i = 0, $(npr)-1 { do j = 0, $(nph)-1 { set n = $j + ($(npr)*$i) set image[$i,$j] = all_rms[n] } } cd .. # load surfaces ctype black ptype 20 3 expand 1.01 p1 # # Plot rms values versus period, for all phase values # # - Highlight best rms for each period value (red) # era set r0 = top_period sort {r0} set r1 = r0[dimen(r0)-1] lim 0 $(r1) all_rms points all_period all_rms ctype red lweight 3 connect top_period top_rms ctype black lweight 1 box xlabel Period (days) ylabel rms p2 # # Plot rms values versus phase, for all period values # # - Highlight best rms for each period value (red) # era lim 0 $(2*pi) all_rms points all_phase all_rms ctype red lweight 3 points top_phase top_rms ctype black lweight 1 box xlabel Phase (radians) ylabel rms p3 # # Plot data upon two cycles of fitted sine wave # era set x = 0, 2.0*bst_period, 1 set y = sin(bst_phase + (2*pi)*(x/bst_period)) lim x -1.2 1.2 connect x y set t2 = t - bst_period * (int(t/bst_period)) set r0 = t2 + bst_period set _t = t2 concat r0 set _v = v concat v set _e = ve concat ve points _t _v error_y _t _v _e box xlabel Time (days) ylabel Velocity (normalized units) # lim 0 1 0 1 relocate 0.05 0.95 set s0 = sprintf('%6.1f',bst_period) putlabel 6 P = $(s0) relocate 0.05 0.91 set s0 = sprintf('%6.2f',bst_phase) putlabel 6 \phi = $(s0) relocate 0.05 0.87 set s0 = sprintf('%6.4f',bst_rms) putlabel 6 rms = $(s0) p4 # # Create contour plot of rms distribution # # - use five colors to show peaks through valleys # - mark best-fit position with a magenta x # era lim 0 $(nph-1) 0 $(nph-1) # set levs = 0.14, 0.44, 0.05 LEVELS levs ctype magenta contour set levs = 0.44, 0.74, 0.05 LEVELS levs ctype blue contour set levs = 0.74, 1.04, 0.05 LEVELS levs ctype green contour set levs = 1.04, 1.30, 0.05 LEVELS levs ctype yellow contour set levs = 1.30, 1.50, 0.05 LEVELS levs ctype red contour ctype black # set r0 = top_phase sort {r0} lim $(top_period[0]) $(top_period[dimen(top_period)-1]) \ $(r0 [0]) $(r0 [dimen(r0) -1]) box xlabel Period (days) ylabel Phase (radians) ctype magenta lweight 3 ptype 4 1 relocate $(bst_period) $(bst_phase) dot ctype black lweight 1 ptype 20 3 p5 # # Create surface plot of rms distribution # era set r0 = all_rms sort {r0} set rms_lo = r0[0] set rms_hi = r0[dimen(r0)-1] viewpoint 20 15 -1 surface 3 $(rms_lo) $(rms_hi) set r0 = top_period sort {r0} define Lo_x $(r0[0]) define Hi_x $(r0[dimen(r0)-1]) set r0 = top_phase sort {r0} define Lo_y $(r0[0]) define Hi_y $(r0[dimen(r0)-1]) #set r0 = top_rms sort {r0} define Lo_z $(r0[0]) define Hi_z $(r0[dimen(r0)-1]) box3 label3 x Period (days) label3 y Phase (radians) label3 z rms