function fpc1_2img,ref1,img,cref1,cref2,cimg,dz,z=z,model=model,f=f ;+ ; NAME: ; fpc1_2img ; ; PURPOSE: ; To calculate LASCO C1 emission line signal. (Note: the output is in ; the same units as the input images. No photometric correction is ; made.) ; ; CALLING SEQUENCE: ; ee = fpc1_2img(ref1,img,cref1,cref2,cimg) ; ; INPUTS: ; ref1 first open-door off-line image ; img open door on-line image ; cref1 first closed-door off-line image ; cref2 second closed-door off-line image ; cimg closed door on-line image ; dz for the comp1 model, this is a "repair" to f that is a function ; of position. Default value is zero. ; ; OPTIONAL INPUTS: ; none ; ; KEYWORD PARAMETERS ; z this is an array of the form [xmin,ymin,xmax,ymax] which specifies ; the two corners of a particular rectangle in the images. It will be ; assumed that this region contains zero median emission line signal, ; and if any is detected it will be assumed that this is due to an ; exposure error in the on-line image (img). Accordingly, the on-line image ; will be multiplied by a constant such that the median emission ; signal over this region will be exactly zero. If this keyword is ; omitted, all images will be assumed to be correct, and no exposure ; correction will be made. ; ; model - A number of models are available. The default model is 'comp1' ; 'subtract' - a simple subtraction of the offline (ref1) from the online (img) ; 'standard' - assumes no white light background ; 'comp1' - estimates the white light background with the three-gaussian model ; ; OUTPUTS: ; Returns an image consisting of only that part of the signal due to ; the emission line irradiance. Note that this signal will not be proportional ; to the irradiance, but needs to be further corrected by the instrument ; response in order to obtain photometrically correct results. ; ; OPTIONAL OUTPUTS: ; none ; ; METHOD ; ; COMMON BLOCKS: ; None ; ; SIDE EFFECTS: ; None ; ; RESTRICTIONS: ; All five input images must be of the same size and at the same location ; on the CCD. Images ref1 and cref1 form an open and closed door image ; pair and must have the same command wavelength. The same is true ; of the img and cimg image pair. Image ref1 must be off line. ; All images must be corrected for offset bias and exposure. ; ; MODIFICATION HISTORY: ; V 1.00 - Oct 06/98 written by Paul Reiser ; V 1.10 - Jul 15/00 included zeroing box ; ; CONTACT: Paul Reiser reiser@susim.nrl.navy.mil ; Dennis Socker socker@lambda.nrl.navy.mil ; ;- h1 = cref1 q=where(h1 eq 0,count) if(count ne 0)then h1(q)=1.0e-20 phi = ref1/h1 if(n_elements(model) eq 0)then model = 'comp1' if(n_elements(z) ne 0)then begin mask = byte(img)*0 mask(z(0):z(2),z(1):z(3))=1 q = where(mask eq 1) ee = fpc1_2img(ref1(q),img(q),cref1(q),cref2(q),cimg(q),dz,model=model) zimg = img/(1+median(ee)/median(img(q))) end else begin zimg = img end if(n_elements(dz) eq 0)then dz=0 case model of 'subtract': f = 0 'standard': f = phi 'comp1': begin q = where(phi le 0,count) if(count gt 0)then phi(q) = 1.0e-30 x = alog(phi) p = [ 0.08423, -2.39595, 0.03978, $ 0.11093, -1.47551, 0.11540, $ 0.65913, 1.47500, 2.76895] f = p(0)*exp(-(x-p(1))^2/p(2))+$ p(3)*exp(-(x-p(4))^2/p(5))+$ p(6)*exp(-(x-p(7))^2/p(8)) f = phi*exp(f+dz) end else: stop,'no model defined' end ee = (zimg-ref1) - f*(cimg-cref1) return,ee end