PRO Applog, msg openw, unit, 'Reko_Log', /append, /get print, msg printf, unit, msg free_lun, unit END ;;; Reconstruct the full series 1 of Oct 21, 1999 @commoninc close, /all first = 1 last = 36 openr, 1, 'jultimes' jultimes = strarr(last-first+1) readf, 1, jultimes close, 1 ;;; special order for putting together the images? f = findfile('queue.save') IF f(0) NE "" THEN restore, f(0) FOR burst=first, last DO BEGIN IF burst EQ 118 THEN BEGIN init_variables, 'allvars.dat' cmd = 'nohup /opt/rsi/idl_5.2/bin/idl dosp &' GOTO, Comp ENDIF ;;; Read chunks from tape IF (burst/10 EQ burst/10.) THEN BEGIN cmd = 'tar xvf /dev/tape -C RAW' spawn, cmd spawn, cmd ;;; twice to skip over filemark ENDIF Noread: ;;; convert input data to integer infile = 'RAW/Mos_18.'+nnumber(burst, 3) openr, 1, infile bild = assoc(1, bytarr(768, 572)) openw, 2, 'raw/rawdata' FOR i=0, 99 DO writeu, 2, fix(bild(i)) close, 2 close, 1 spawn, 'rm '+infile Weiter: ;;; Preprocessing pre_speckle, 'allvars.dat', /inmem ;;; Check ALPHA value. If too bad, clip off the 25 worst images ;;; and redo alpha calculation / STF generation openr, 1, ResDir + 'alpha' alpha = 0. readf, 1, alpha close, 1 IF alpha LT 15 THEN BEGIN N_Image = 75 applog, 'Burst '+strtrim(burst, 2)+': Alpha too low ('+$ strtrim(alpha, 2)+'); Redo with 75 Images' make_stf, /no cmd = 'nohup /opt/rsi/idl_5.2/bin/idl dosp1 &' ENDIF ELSE $ cmd = 'nohup /opt/rsi/idl_5.2/bin/idl dosp &' ;;; spawn a second idl session to do reconstruction in parallel Comp: spawn, cmd testreko, /no ;;; make sure everything is finished WHILE ((f=(findfile('results/teilbild265'))(0) EQ '')) DO wait, 1 WHILE ((f=(findfile('results/teilbild266'))(0) EQ '')) DO wait, 1 Conn: caldat, jultimes(burst-first), month, day, year, hrs, mins, secs tim = nnumber(hrs, 2)+nnumber(mins, 2)+nnumber(fix(secs+.5), 2) name = 'Mosaic_18oct99_'+tim+'.fits' ;;; put together the image ;;; with bad seeing, this fails sometimes. Catch that ;;; In any case, save the reconstructions, maybe connect does ;;; not work correctly. cmd = 'tar cfI '+tim+'.tbz results/schrittweite results/teilbild*'+$ ' results/langzeitbild results/alpha results/referenzbild '+$ ' support/rawsum support/flaeche* support/ruhdimensionen '+$ ' support/basisdimensionen' spawn, cmd catch, Error_Status IF Error_Status NE 0 THEN BEGIN applog, 'Burst '+strtrim(burst, 2)+': An error occured during connect!' ENDIF ELSE BEGIN IF n_elements(queue) EQ S_n THEN $ p=connect('', queue, /no_ini, /int, /safe) $ ELSE $ p=connect(/no_ini, /int, /safe) IF min(p) LE 0 THEN BEGIN applog, 'Burst '+strtrim(burst, 2)+': Min data <= 0!' ENDIF ELSE BEGIN save_result, p, 'FITS/'+name, /no applog, 'Burst '+strtrim(burst, 2)+': Saved as '+name ENDELSE ENDELSE catch, /cancel ;;; clean up disk spawn, 'rm -rf results support raw/rawdata' ENDFOR END