; ; NAME: dark_model_s2_dlvs ; ; PURPOSE: create array of dlvs and extra columns dark current for DISR#2 ; ; CATEGORY: Calibration Data Analysis ; ; CALLED BY: absolute responsivity, relative responsivity, and image ; correction programs for DISR#2 dlvs data ; ; SUBPROGRAMS: init_dark_model_dlvs ; ; INPUTS: ccd_temp,exp_time ; ccd_temp is the temperature in degrees Kelvin at which the dark current ; model is desired ; exp_time is the exposure time in milliseconds for which the dark ; current model is desired ; ; OPTIONAL INPUT PARAMETERS: None ; ; OUTPUTS: the function returns an array of 22 by 200 real values for the ; dark current in DN for each pixel. The left hand extra column ; data is in column 0 or the returned array, and the right ; hand extra column is in column 21, with the dlvs pixels in ; columns 1 through 20. ; ; OPTIONAL OUTPUT PARAMETERS: None ; ; KEYWORDS: None ; ; COMMON BLOCKS: dark_model_dlvs_common ; ; SIDE EFFECTS: None ; ; RESTRICTIONS: This program only works for DISR#2. The dark models for other ; sensor heads is too different to combine with the special ; problems of the DISR#2 sensor head dark model. Also, the ; init_dark_model_dlvs must be run once before the dark model ; is run. ; ; EXAMPLE: see below ; init_dark_model_s2_dlvs ; only done once per IDL session ; . ; . ; . ; d_read,'extra columns file',h,pe ; get dlvs extra column data ; d_read,'dlvs file',h,p ; get dlvs data and header data (20x200) ; temp = intarr(22,200) ; make room for extra column data ; temp(0,*) = pe(0,*) ; left extra column data inserted ; temp(1:20,*) = p ; actual dlvs data inserted. ; temp(21,*) = pe(1,*) ; right hand extra column data inserted ; ccd_temp = float(strmid(h(ccdtemp),6,12)) ; exp_time = float(strmid(h(h_exptime),6,12)) ; dark_model=dark_model_s2_dlvs(ccd_temp,exp_time) ; returns dark model array ; net = temp - dark_model ; subtract off dark model ; ; PROCEDURE: The DISR#2 dark model has been broken into two major portions, ; the exposure time invariant part, and the exposure time dependant part. ; The first part uses an exponetial with temperature factor, a linear ; with temperature (cable effect) factor, and a row slope factor. ; The row slope is not linear, like most ccd's, and is modeled as a ; quadratic in row number (+/-100) with the 3 coefficients being ; exponetials of ccd temp. The sum of these three factors is ; then multiplied by a normailzed pixel variation array. There is also a ; twist in the row slope function from one end of the dlvs to the other, ; and this is modeled with a linear in column function multiplied by ; row number, with the coefficients being exponetial in ccd temp. The ; exposure time dependant part also unusual, and modeled with the ; exponetial of a 4th order polynomial in ccd temp. The exposure time ; dependant part is also multiplied by a normalized pixel variation array. ; The resulting array of the sum of the exp invariant part, the row twist, ; and the exposure time dependant part is then returned as the value of ; the function. ; ; MODIFICATION HISTORY: Adapted from ; new 08/27/97 Mike Bushroe ; v1 B. Rizk modified to run on PC ;---------------------------------------------------------------------------- ; DISR CALIBRATION SOFTWARE (c) 1997 by University of Arizona ;----------------------------------------------------------------------------- ;- pro init_dark_model_s2_dlvs common dark_model_s2_dlvs_common,al,ae,b0,bl,bq,twc,twl,ce,a_array,c_array nc = 22 nr = 200 al=fltarr(2) ae=fltarr(2) b0=fltarr(2) bl=fltarr(2) bq=fltarr(2) twc=fltarr(2) twl=fltarr(2) ce=fltarr(4) a_array=fltarr(nc,nr) c_array=fltarr(nc,nr) str='' print,'Opening ~\dark\DLVS_dark_model.' openr,model_lun,'c:\specmap\parameters\reduction\dirs2_DLVS_dark_model',/get_lun readf,model_lun,str ; get cable effect part reads,str,al readf,model_lun,str print,'read in ',strtrim(str,2),' for al.' readf,model_lun,str ; get exp invariant exponetial part reads,str,ae readf,model_lun,str print,'read in ',strtrim(str,2),' for ae.' readf,model_lun,str ; get get exp dependant exponetial part reads,str,ce readf,model_lun,str print,'read in ',strtrim(str,2),' for ce.' readf,model_lun,str ; get row slope constant part reads,str,b0 readf,model_lun,str print,'read in ',strtrim(str,2),' for b0.' readf,model_lun,str ; get row slope linear part reads,str,bl readf,model_lun,str print,'read in ',strtrim(str,2),' for bl.' readf,model_lun,str ; get row slope quadratic part reads,str,bq readf,model_lun,str print,'read in ',strtrim(str,2),' for bq.' readf,model_lun,str ; get row twist constant part reads,str,twc readf,model_lun,str print,'read in ',strtrim(str,2),' for twc.' readf,model_lun,str ; get row twist linear part reads,str,twl readf,model_lun,str print,'read in ',strtrim(str,2),' for twl.' readf,model_lun,str print,'read in ',strtrim(str,2),' for exp time invariant matrix.' readf,model_lun,a_array readf,model_lun,str print,'read in ',strtrim(str,2),' for exp time dependant matrix.' readf,model_lun,c_array free_lun,model_lun ; close file when done with it print,'DLVS Dark Model coefficients successfully loaded.' return end function dark_model_s2_dlvs,temp,exp_time common dark_model_s2_dlvs_common,al,ae,b0,bl,bq,twc,twl,ce,a_array,c_array nc = 22 nr = 200 bc=fltarr(3) ; computed coefs of row slope at requested temp tw=fltarr(2) ; computed coefs of row slope twist dark_model = fltarr(nc,nr) ; output actual model numbers irow = findgen(nr)-(nr-1)/2.0 zrow = findgen(nr) icol=findgen(nc)-(nc-1)/2.0 model = poly(temp,al) + ae(0)*exp(temp/ae(1)) rate = exp_time*exp(poly(temp,ce))/1000.0 bc(0) = exp(poly(temp,b0)) bc(1) = exp(poly(temp,bl)) ; row slope for this temp bc(2) = -exp(poly(temp,bq)) ; quadratic row slope for this temp row = poly(irow,bc) tw(0) = -exp(poly(temp,twc)) ; row slope twist for this temp tw(1) = -exp(poly(temp,twl)) for j=0,nr-1 do begin for k = 0,nc-1 do begin dark_model(k,j) = (model + row(j))*a_array(k,j) + $ rate*c_array(k,j) + poly(zrow(j),tw)*icol(k) endfor endfor return,dark_model end