;+ ; This procedure does a simple (s-r)/r on two rows from the ; opened data file. This is a very rough first version used just ; so we can start to develop other routines which come downstream. ; ; This currently assumes line mode. It uses getrec to fetch each index. The first index is ; then copied to location 1, the second is copied to location 2 and ; the result is placed in location 0. ; ; @param index1 {in}{required}{type=integer} index 1 points to sig ; @param index2 {in}{required}{type=integer} index 2 points to ref ; ; @examples ; srr,1,65 ; accum ; srr,2,66 ; accum ; ave ; show ; ; @version $Id: srr.pro,v 1.5 2005/05/30 04:03:43 bgarwood Exp $ ;- pro srr,index1,index2 getrec,index1 if (data_valid(!g.s[0]) le 0) then begin message,'No valid data found at index1',/info return endif copy,0,1 dsig = *!g.s[1].data_ptr getrec,index2 if (data_valid(!g.s[0]) le 0) then begin message,'No valid data found at index2',/info return endif copy,0,2 dref = *!g.s[2].data_ptr dcal = (dsig - dref) / dref *!g.s[0].data_ptr = dcal show end