;+ ; Procedure BCS_LOCATE to suggest a location of a flare (north or south of ; projected sun centre) based on the BCS lines positions and the old ; calibration of bin number versus flare position ; NB this does not take account of any pointing offsets. ; ; Use: ; must have used GS, GS_CUR and GS_SP first, then... ; ; IDL> .run bcs_locate ; ; use cursor to define region of resonance lines in succession ; ; ; CDP June 92 ; ;- !p.multi=[0,0,3] pos = fltarr(3) loc = fltarr(3) ; ; fits from old data, could be updated ; coff = [[-3140.88,-1151.79,-1593.16],[21.32,25.927,47.17]] tit = ['Mean FeXXV spectrum','Mean CaXIX spectrum','Mean SXV spectrum'] print,'Use cursor to define resonance line window' for kk = 0,2 do begin if kk eq 0 then f = gsp(256:511) if kk eq 1 then f = gsp(512:638) if kk eq 2 then f = gsp(639:766) !mtitle = tit(kk) plot,f,psym=10,charsize=2 nfit = 0 cursor,s1,qq,3,/data oplot,[s1,s1],[0,1000] cursor,s2,qq,3,/data oplot,[s2,s2],[0,1000] if s1 gt s2 then begin temp = s1 s1 = s2 s2 = temp endif nfit = [fix(s1),fix(s2)] x = findgen(nfit(1)-nfit(0)+1) + nfit(0) yfit = findgen(nfit(1)-nfit(0)+1) a = fltarr(6) y = f(nfit(0):nfit(1)) a(0) = max(y) p = where(y eq a(0)) a(1) = p(0) a(2) = 3.0 a(3) = y(n_elements(y)-1) a(4) = 0.0 a(5) = 0.0 yfit = gaussfit(x,y,a) oplot,x,yfit,psym=-3,thick=2 pos(kk) = a(1) !linetype = 2 oplot,[pos(kk),pos(kk)],[0,1000] !linetype = 0 loc(kk) = (coff(kk,0) + coff(kk,1)*pos(kk))/60. if loc(kk) gt 0.0 then begin print,'Likely location is ',loc(kk),' North of sun centre',$ format='(a,f5.1,a)' endif else begin print,'Likely location is ',abs(loc(kk)),' South of sun centre',$ format='(a,f5.1,a)' endelse endfor print,' ' meanloc = total(loc)/3.0 if meanloc gt 0.0 then begin print,'Mean location is ',meanloc,' North of sun centre',$ format='(a,f5.1,a)' endif else begin print,'Mean location is ',abs(meanloc),' South of sun centre',$ format='(a,f5.1,a)' endelse !p.multi = 0 !mtitle = ' ' end