cleaner.pro

InfoInfo
Search:    

; Comments added by Erik Johnson 7/3/07
; cleaner.pro, compiles and runs with idl
; needs strip.pro to run
; input must be raw MACCS data file(s)
; output is a cleaned binary version of the raw data with filetype .s2
; example: if input file is CD05.4, output file is CD05004.s2
; to compile & run: cleaner, "path_and_name_of_raw_data_file(s)" (you can use * and ?)
; default output directory is e:\
; to set output directory: out_dir="output_directory"
; to display a window with a graph: view="view"
; to create summary text file(s) containg the command line output: summary="summary"
; to save the .s2 file(s) in a subdirectory folder (which must already exist): month_str="sub_dir_name"
; to move the raw file(s) after creating the clean file(s): move="path" (if you used the month_str parameter, the file(s) will be moved to the subdirectory within the folder you specified for the move directory) Ex: if parameters are month_str="Jan05/", move="/Volumes/MACCS_DATA/" then raw file(s) will be moved to /Volumes/MACCS_DATA/Jan05/
; the click parameter should not be used unless changes are made to the program
; Example: cleaner, "/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2005/CD05.4", out_dir="/Users/johnson8/maccs/", summary="summary", month_str="Jan05/", move="/Users/johnson8/Desktop/", view="view"

pro cleaner,search,view=view,summary=summary,month_str=month_str,$

!p.multi=[0,0,4]
if not keyword_set(month_str) then month_str =
flagged_record = byte([32767000L,32767000L,32767000L,32767000L,32767000L,32767000L],0,1,24)
x = 35 ;bytes
clean_data = bytarr(28,86400)
raw_files = findfile(search,count=num_raw)

for i = 0, n_elements(raw_files)-1 do begin ; Loop over number of files to be processed

; Open "summary" text file is summary keyword is selected

; Open and read raw data file

; Read data into arrays

; Plot if keyword "view" is selected

; window,1,xsize=600,ysize=600

; if (keyword_set(click) and count gt 0) then cursor,cx,cy,/wait,/up,/norm
; print,cx,cy
; if cy lt .5 then goto,skip
; print,'noskip',cy

; Check day

; for jk=0,count-1 do begin
; print,same_day(jk)
; for kk = same_day(jk)-2, same_day(jk)+2 do $
; print,header(kk),dd(kk),hh(kk),mm(kk),ss(kk),tf1(kk),tf2(kk),block(kk)
; endfor

; Find Gaps

; flagged = where((tf1 ne 49) or (tf2 ne 57),n_flagged)
; good = where((tf1 eq 49) and (tf2 eq 57),n_good)

; if n_good eq 0 then begin
; print,'n_good',n_good
; goto,skip
; endif

; Find first good record

; Write good data into clean_data

; Fix Gaps

; for kk = gap_start, gap_stop do begin
; print,dd(kk),hh(kk),mm(kk),ss(kk),bz1(kk),block(kk),tf1(kk),tf2(kk)
; endfor

; clean_data(0,seconds(gap_start):seconds(gap_stop-1)) = 2b

; Switch from bx1,by1,bz1,bx2,by2,bz2 to bx1,bx2,by1,by2,bz1,bz2

; Write clean data to file

; wait,5

; Close "summary" text file

; skip:

endfor

!p.multi=0
end

This is a Wiki Spot wiki. Wiki Spot is a non-profit organization that helps communities collaborate via wikis.