diff --git a/fbeye/fbeye.pro b/fbeye/fbeye.pro index 4244df6..01abbf2 100644 --- a/fbeye/fbeye.pro +++ b/fbeye/fbeye.pro @@ -1,6 +1,7 @@ pro fbeye,lightcurve,debug=debug,recalculate=recalculate,$ keyboard=keyboard,auto=auto,noauto=noauto,$ - smooth=smooth,boxcar=boxcar + smooth=smooth,boxcar=boxcar,$ + apimport=apimport ;----------------- ; Flares By EYE @@ -12,13 +13,15 @@ pro fbeye,lightcurve,debug=debug,recalculate=recalculate,$ print,'> Welcome to FBeye...' print,' Setting /auto will disable the interactive GUI.' -print,' Setting /noauto will disable the auto-finding.' +print,' Setting /noauto will disable the auto-finding of flares.' print,' Setting /recalculate will use previous start/stop times ' print,' and recompute the Equiv. Durations, peaks, etc.' print,' NOTE: requires the .out file, not .fbeye file!' +print,' Setting /ApImport will generate a .out file from the .flare' +print,' file generated by project codenamed "appaloosa".' print," Set smooth='boxcar' to use simple boxcar smoothing for the " print," auto-finding, and boxcar=# to adjust the window length." -print," Setting /keyboard will enable they keyboard+mouse mode." +print," Setting /keyboard will enable the keyboard+mouse mode." print,' ' device, retain = 2 @@ -61,7 +64,7 @@ device, retain = 2 device, true_color = 2 device, decomposed = 0 -VERSION = 'v1.3.5' +VERSION = 'v1.3.6' print," You are currently running FBEYE "+VERSION @@ -88,6 +91,19 @@ readcol,lightcurve,/silent,f='(D,D,D)',time,flux,error tlastviewed = -9d9 ; a time value that shouldn't exist dtlast = -9d9 ; a time bin that shouldn't exist + + +; read in the output from the Python project codename "appaloosa" +if keyword_set(apimport) then begin + FBEYE_APIMPORT, lightcurve ; generates a new output save file + + print, '> FBEYE_RECALC will now run automatically to make the import complete.' + print, ' To see the results, rerun FBEYE with no flags.' + recalculate = 1 ; the output file needs to re-run to match FBEYE + AUTO = 1 ; do things automatically now +endif + + ;1) if keyword_set(debug) then print,'Debug: 3' doover = 'y' @@ -158,12 +174,12 @@ if already_done eq 0 then begin ; where the mult-peak is marked multpos = fltarr(n_elements(fevent)) -tstart= fltarr(n_elements(fevent)) -tstop= fltarr(n_elements(fevent)) -trise= fltarr(n_elements(fevent)) -tdecay= fltarr(n_elements(fevent)) -s2n = fltarr(n_elements(fevent)) -quies = fltarr(n_elements(fevent)) + tstart= fltarr(n_elements(fevent)) + tstop= fltarr(n_elements(fevent)) + trise= fltarr(n_elements(fevent)) + tdecay= fltarr(n_elements(fevent)) + s2n = fltarr(n_elements(fevent)) + quies = fltarr(n_elements(fevent)) save,fevent,fstartpos,fstoppos,tpeak,tstart,tstop,trise,tdecay,lpeak,ed,cplx_flg,mltpk_flg,mltpk_num,tmltpk,lmltpk,multpos,s2n,quies,filename=lightcurve+'.out' @@ -223,6 +239,7 @@ if keyword_set(recalculate) then begin print,'> ' goto,theend + ; RETURN ;<<<< done with program endif diff --git a/fbeye/fbeye_apimport.pro b/fbeye/fbeye_apimport.pro new file mode 100644 index 0000000..27db1fc --- /dev/null +++ b/fbeye/fbeye_apimport.pro @@ -0,0 +1,49 @@ +pro fbeye_apimport, lightcurve + +compile_opt defint32, strictarr, strictarrsubs +compile_opt HIDDEN + +print,'>> running FBEYE_APIMPORT' + +; read the columnated text file from "appaloosa" + +readcol, strmid(lightcurve, 0, strpos(lightcurve, '.dat')) + '.flare', $ + f='(F)', /silent, $ + tstart, tstop, tpeak, lpeak, $ + FWHM, duration, t_peak_aflare1, t_FWHM_aflare1, amplitude_aflare1, $ + flare_chisq, KS_d_model, KS_p_model, KS_d_cont, KS_p_cont, ed + + +trise = tpeak - tstart +tdecay = tstop - tpeak + +fevent = findgen(n_elements(tstart)) +fstartpos = fltarr(n_elements(tstart)) - 99. +fstoppos = fltarr(n_elements(tstart)) - 99. + +cplx_flg = fltarr(n_elements(tstart)) * 0. + +mltpk_flg = fltarr(n_elements(tstart)) - 99. +mltpk_num = fltarr(n_elements(tstart)) - 99. +tmltpk = fltarr(n_elements(tstart)) - 99. +lmltpk = fltarr(n_elements(tstart)) - 99. +multpos = fltarr(n_elements(tstart)) - 99. +s2n = fltarr(n_elements(tstart)) - 99. +quies = fltarr(n_elements(tstart)) - 99. + +tlastviewed = -9d9 +dtlast = -9d9 + + +outfilename = lightcurve + ".out" + +; make a save file +save,fevent,fstartpos,fstoppos,$ + tpeak,tstart,tstop,trise,tdecay,lpeak,ed,$ + cplx_flg,mltpk_flg,mltpk_num,tmltpk,lmltpk,multpos,$ + s2n,quies,tlastviewed,dtlast,$ + filename=outfilename + +print, '> Generating file '+outfilename +return +end