;+ ; Overplots a box from xstart to xend, with uper and lower bounds the ; mean + sigma and mean - sigma of the yarray passed in ; ; @param xstart {in}{required}{type=long} where box starts in yarray ; @param xend {in}{required}{type=long} where box ends in yarray ; @param yarray {in}{required}{type=array} data array for rms box ;- pro rmsbox, xstart, xend, yarray compile_opt idl2 if (n_params() ne 3) then begin message,'Usage: rmsbox, xstart, xend, yarray',/info return endif if xstart gt xend then begin tmp = xend xend = xstart xstart = tmp endif meany = mean(yarray[xstart:xend]) sigmay = sigma(yarray[xstart:xend]) box = [[xstart,meany+sigmay],[xend,meany+sigmay],[xend,meany-sigmay],[xstart,meany-sigmay]] ; plot this box, starting at the top, left-hand corner and going clockwise gbtoplot,[box[0,0],box[0,1]],[box[1,0],box[1,1]],color=!cyan, /chan gbtoplot,[box[0,1],box[0,2]],[box[1,1],box[1,2]],color=!cyan, /chan gbtoplot,[box[0,2],box[0,3]],[box[1,2],box[1,3]],color=!cyan, /chan gbtoplot,[box[0,3],box[0,0]],[box[1,3],box[1,0]],color=!cyan, /chan end