FUNCTION read_blk_ave_4_data_1024_v2, file_path, data_file, nhead ; Does so for 1024 time bin data after skiping nhead ; records at the top of the data file. Reads only the ; first, or only, data block. ; Intended for reading and block averaging variance ; blocks. ; 11/21/00 ; ; Version 2 is just function. ; ; Author: Robert Kessel ; Electro-Optics Technology Section ; Code 8123 ; Naval Research Laboratory ; Washington, D.C. 20375-5354 ; email: kessel@ncst.nrl.navy.mil ; ; This code was written for Bill Palya's and Don Walter's ; use at JSU. However, anyone else who finds it useful ; should feel free to use it, rewrite it, or whatever else, ; save charging any money, goods or services from any other ; person for the code or use thereof. ; 10/17/03 ; ; Modified to read from a subdirectory. ; 10/23/03 whatever=FLTARR(256) fname = file_path+data_file OPENR, 1, fname ; head_rec = ' ' FOR i=1,nhead DO BEGIN READF, 1, FORMAT='(A0)', head_rec ENDFOR ; FOR i=0,127 DO BEGIN READF, 1, glopo1,glopo2,glopo3,glopo4,glopo5,glopo6,glopo7,glopo8 whatever[2*i]=glopo1+glopo2+glopo3+glopo4 whatever[2*i+1]=glopo5+glopo6+glopo7+glopo8 whatever[2*i]=whatever[2*i]/4. whatever[2*i+1]=whatever[2*i+1]/4. ENDFOR CLOSE, 1 RETURN, whatever END