function den2int, file, exposure, red=red, day=day, plot=plot, new=new, $ reset=reset, logt=logt, noback=noback, eclipse=eclipse @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; DEN2INT ; PURPOSE: ; Conversion of photographic intensity to relative intensity ; (used for the Hilltop data from the SYNOP campaign (10-24 Oct., 1994) ; CATEGORY: ; CALLING SEQUENCE: ; result = den2int(file_or_array,exposure, $ ; [/red,day=day,/plot,/new,/reset,/logt,/noback]) ; INPUTS: ; file_or_array either: file name containing photographic image ; or: 2D image array ; (the file name extension is ignored; see PROCEDURE) ; exposure exposure time (seconds) ; OPTIONAL INPUT PARAMETERS: ; /red specify Fe X (red) or Fe XIV (green) data ; (only used if `file_or_array' is an array; if it' a ; file name this info is extracted from the file name) ; day=day select the calibration day. Calibrations are available ; for two days: 1994, DOY 285 and DOY 294 ; If `day' not set then the value is extracted from the ; file name (if file_or_array is a file name) or the ; day=285 is used (if file_or_array is an array). ; ; The remaining keywords are past unmodified to DEN2STANDARD: ; /plot, /new controls plotting of result and window control ; /logt fits log(exposure) rather then the exposure time as a ; function of the film density ; /noback controls background subtraction ; OUTPUTS: ; result photographic image in relative intensity ; CALLS: ; bin_read, DEN2STANDARD, DO_PARSE ; PROCEDURE: ; > file_or_array is a file name: ; two files need to be present in the same directory: a *.fts file and a ; *.bin file. The array size for the image are extracted from the *.fts ; file. The image itself is read from the *.bin file. ; MODIFICATION HISTORY: ; APR-1995, Paul Hick (UCSD) ;- unix = 1-keyword_set(eclipse) a = size(file) case a(a(0)+1) of ; Check for string type 7: begin ; Check for standard 's' files SetFileSpec, file fname = GetFileSpec(part='name') c = strmid(fname,0,1) pos = strlowcase(c) eq 's' or strlowcase(c) eq 'b' c = strmid(fname,pos,1) red = strlowcase(c) eq 'r' ; 'r': red , 'g': green if n_elements(day) eq 0 then day = fix( strmid(fname,pos+1,3) ) f = GetFileSpec(upto='name') case flt_read(f+'.fts',a,nx=2) of 0: begin nx = 726 & echo, '1st dimension, nx', nx ny = 713 & echo, '2nd dimension, ny', ny end 1: begin nx = fix(a[1,2]) ny = fix(a[1,3]) end endcase stat = bin_read(f+'.bin', aden, nx=nx, unix=unix) sa = size(aden) if sa[0] ne 2 then message, 'not a 2D array' if sa[2] ne ny then message, 'funny input file : '+file end else: begin ; Not a string: assumed to be 2D image array red = keyword_set(red) if n_elements(day) eq 0 then day = 285 aden = file end endcase standards = [285,294] a = min(abs(day-standards), pos) & day = standards(pos) return, den2standard(aden,red=red,day=day,plot=plot,reset=reset,new=new, $ logt=logt,noback=noback)/exposure end