Skip to content

Commit

Permalink
created FBEYE APIMPORT module
Browse files Browse the repository at this point in the history
  • Loading branch information
jradavenport committed Oct 5, 2015
1 parent 0f80c49 commit d765f3e
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 10 deletions.
37 changes: 27 additions & 10 deletions fbeye/fbeye.pro
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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


Expand All @@ -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'
Expand Down Expand Up @@ -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'

Expand Down Expand Up @@ -223,6 +239,7 @@ if keyword_set(recalculate) then begin

print,'> '
goto,theend

; RETURN ;<<<< done with program
endif

Expand Down
49 changes: 49 additions & 0 deletions fbeye/fbeye_apimport.pro
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d765f3e

Please sign in to comment.