;+ ; NAME: ; den2temp ; PURPOSE: ; Calculate temperature from the ratio of Hilltop density data in Fe X ; and Fe XIV ; CATEGORY: ; CALLING SEQUENCE: function den2temp, gfile,rfile, $ redovergreen=redovergreen, $ day=day,plot=plot,reset=reset, $ ratio=ratio, logt=logt, noback=noback ; INPUTS: ; gfile,rfile ; names of files containing green and red line densities, or ; arrays of green and red line densities ; gexposure, rexposure ; exposure times for the green and red densities (seconds) ; day selects the day for which calibration data should be used ; (available are 1994, DOY 285 and 294; default = 285) ; If day is a scalar (285 or 294) then the corresponding ; calibration is used for both red and green. ; If day is a two-elements array then the first day is used ; for green and the second for red. ; OPTIONAL INPUT PARAMETERS: ; redovergreen=redovergreen ; ratio of red and green intensity in the continuum (default: ; 0.825) ; /ratio calculate intensity ratios, but do not convert ratio to ; temperature ; ; All other keywords are passed unmodified to DEN2INT: ; /plot ; /reset ; /ratio ; /logt ; /noback ; OUTPUTS: ; OPTIONAL OUTPUT PARAMETERS: ; INCLUDE: @compile_opt.pro ; On error, retur to caller ; CALLS: ; den2int, fe_temperature ; COMMON BLOCKS: ; SIDE EFFECTS: ; RESTRICTIONS: ; PROCEDURE: ; MODIFICATION HISTORY: ; APR-1995, Paul Hick (UCSD) ;- ratio = keyword_set(ratio) if n_elements(redovergreen) eq 0 then redovergreen = 0.825 message, /info, 'Using sky brightness ratio: red/green ='+string(redovergreen) case n_elements(day) of 0: begin gday = 285 & rday = 285 & end 1: begin gday = day & rday = day & end 2: begin gday = day(0) & rday = day(1) & end else: begin help, day message, 'keyword DAY should be 1 or 2 element array' end endcase stat = flt_read('x$aux:synop.txt',ac,crumbs=sc,/silent) files = strupcase(sc(0,*))+strcompress(round(ac(0,*)),/rem) SetFileSpec, gfile fname = GetFileSpec(part='name') rcg = where(files eq fname) if rcg(0) eq -1 then message, 'file not listed : '+fname rcg = rcg(0) & gexposure = ac(1,rcg) xcg = ac(2,rcg) & ycg = ac(3,rcg) & rcg = ac(4,rcg) print, gexposure,xcg,ycg,rcg SetFileSpec, rfile fname = GetFileSpec(part='name') rcr = where(files eq fname) if rcr(0) eq -1 then message, 'file not listed : '+fname rcr = rcr(0) & rexposure = ac(1,rcr) xcr = ac(2,rcr) & ycr = ac(3,rcr) & rcr = ac(4,rcr) print, rexposure,xcr,ycr,rcr xcg = round(xcg) & ycg = round(ycg) xcr = round(xcr) & ycr = round(ycr) g = den2int(gfile,gexposure,day=gday,plot=plot,logt=logt,noback=noback,reset=reset) r = den2int(rfile,rexposure,day=rday,plot=plot,logt=logt,noback=noback,/red,/new) ac = size(g) & nx = ac(1) & ny = ac(2) n = min( [xcg,nx-1-xcg,ycg,ny-1-ycg, xcr,nx-1-xcr,ycr,ny-1-ycr] ) g = g(xcg-n:xcg+n,ycg-n:ycg+n) r = r(xcr-n:xcr+n,ycr-n:ycr+n) ; Red image has slightly different scale then green image: use poly_2d to ; rescale red image. NOT IMPLEMENTED YET. case ratio of 0: r = fe_temperature(g/redovergreen,r) 1: r = (g/r)/redovergreen endcase return, r & end