pro mk_sfc_log, file, noappend=noappend, qstop=qstop ;+ ; NAME: ; mk_sfc_log ; PURPOSE: ; Create a sda-like file of sfc indexes. The data section ; contains only the pointing coordinates. ; ; CALL SEQUENCE: ; mk_sfc_log ; mk_sfc_log, file ; mk_sfc_log, file, /noappend ; ; METHOD: ; ; INPUTS: ; file - sfc log file. Defaults to: ; /0p/sxt_co/terminator/analysis/sda_sfc95mmdd.hhmm ; /noappend - Default is to append to an existing file. ; Set /noappend to force the creation of a new file. ; HISTORY: ; 5-Feb-96, J. R. Lemen, ;- t0 = systime(1) start_date0= '16-AUG-95 08:21:02' start_date = get_yo_dates(/entrance) start_date = start_date(n_elements(start_date)-1) if n_elements(file) ne 0 then ifile = file else $ ifile = '/0p/sxt_co/terminator/analysis/sda_sfc950816.0854' if fmt_tim(start_date) ne fmt_tim(start_date0) then begin message,'Error: start date = '+start_date,/info message,'Expected start date= '+start_date0 endif files_sfc = findfile(concat_dir('DIR_SXT_SFC','sfc*')) rd_roadmap,files_sfc,rmap times = int2secarr(rmap,start_date) ij = where(times gt 0, nc) if nc eq 0 then begin message,'Error: No SFC times since: '+start_date endif nc0 = 0 if not keyword_set(noappend) then begin ; Force a new generation of the entire database if file_exist(ifile) then begin message,'Reading existing sfc database: '+ifile,/info rd_roadmap,ifile,rmap1 times0 = int2secarr(rmap1,start_date) ij0 = where(times0 gt 0, nc0) endif else message,'sfc database does not exist: '+ifile,/info endif if nc0 gt 0 then begin ; Remove the cases that are already jj = rem_elem(times(ij),times0(ij0),ncount) ;- in the database endif else begin ncount = n_elements(times(ij)) ; We are starting from scratch jj = indgen(ncount) endelse ;;jj = jj([0,1,2]) & ncount = n_elements(jj) ;*** message,string('Will add',ncount,' new terminators to database',format='(a,i4,a)'),/info if ncount gt 0 then begin rd_sda, files_sfc, ij(jj), index, /nodata ; Read the indexes coord0 = sxt_cen(index) ; Coordinates in full-res CCD pixels endif nz = n_elements(coord0(0,*)) sav_sda,ifile,index,reform(coord0,1,2,nz),append=1-keyword_set(noappend) message,'Finished writing: '+ifile,/info message,string('took',(systime(1)-t0)/60.,' min',format='(a, f4.1,a)'),/info if keyword_set(qstop) then stop end