pro nis_c_cross, seq_in, seq_out, sourcedir, rad_mode, verbose ; SUB-PROGRAM of nis_proc ; ; ABSTRACT ; Goes through sequence of NIS data spectra and corrects for detector ; crosstalk. Only the first 9 or so Ge detectors have any real ; correction. ; ; INPUTS ; seq_in - dark & gain corrected nis sequence ; sourcedir - source directory for NISCAL programs and data ; verbose - Toggle description of events std output. ; ; OUTPUTS ; seq_out - sequence1 with crosstalk correction ; ; USES ; cross_coef.dat - data file for crosstalk coefficients. 2 by 9 by J. Bell ; eprop_sumdif - for error propagation ; eprop_mult - for error propagation ; eprop_div - for error propagation ; ; HISTORY ; Created 9/23/97 by N. R. Izenberg ; Modified 12/30/95 (NRI) v1.1 directory structure ; 01/19/98 (NRI) v1.2 directory structure ; 07/15/98 (NRI) v2.0 compliant - CNFF ; 08/20/98 (NRI) fixed error probagarion error ; 04/07/99 (NRI) Eliminate Ch 47 correction because Ch 47 is bad and ; correction is very small ; 09/08/99 (NRI) v3.5 Correct for In-space Gain values ; 02/29/00 v4.0 (NRI) add apl crosstalk contingent on rad_mode ; 07/19/01 (NRI) v5.0 Compliant (CNISF changes mostly) ; NOTES ; From NIS sequence data: ; IDL columns 1 and 2 define MET high and low word ; CNISF 5.0 column 9 = shutter in/out (0 = in) ; CNISF 5.0 Data is 131:194 for Calibration ; CNISF 5.0 Data is 195:258 for Noise ; ; - Correction is table given. cross_coef.dat is factor for first 9 Ge channels ; corrseponding to crosstalk froom first 9 InGaAs channels. Correction ; is removed by subtracting factor(x) * InGaAs(x) from Ge(x) where x is ; the detector number. Gain of 1 means 1/10 the correection is applied. ; - The first version of cross_cef.dat is J. Bell's Cornell derived numbers that ; need to be tested against lab mineral spectra and cal target spectra ; for final verification. ; - From Earth swingby and other data, Jim's numbers provide a better correction ; than APL numbers. ;------------------------------------------------------------------------------ ; Main err_in=seq_in(195:258,*) if verbose eq 1 then print, $ " >>>> Cornell-derived default crosstalk coefficients" ; Load in table of coefficients from library. ; second column is error of crosstalk coefficient ;------------------------------------------------ coefs = fltarr(2,7) openr,unit,sourcedir+'lib_tables/nis_xtalk_coefs.dat',/get_lun readf,unit,coefs close,unit coef = reform(coefs(0,*)) ;Crosstalk coefficients coer = reform(coefs(1,*)) ; Crosstalk Error ; if gain is 1, change crosstalk correction to ~1/10th original ;(original figures calculated for gain 10) ; 01/26/98 !!!! nis_c_gain corrects all gain 10 data to gain 1 ; so all crosstalk needs to be at the gain 1 value. ; Crosstalk for Ge channel X is InGaAs channel X* correction factor ; multiply each by the crosstalk correction factor ; only the first sevem Ge detectors have a correction ; correction is applied for Ge gain = 1, which all data is corrected to by ; nis_c_gain. Therefore the xtalk correction, derived at gain=10 needs to be ; 1/10th that in the data table ;-------------------------------------------------------------- coef=coef/9.843 ;********SPACE Gain Values coer=eprop_div(coef,9.843,coer,0.030) ; Go through spectra and subtract crosstalk. ;; ; Subtract Crosstalk of InGaAs order from 1st 9 Ge channels ; Crosstalk for Ge channel X is InGaAs channel X+38* correction factor ;-------------------------------------------------------------------------- sz=size(seq_in) if sz(0) eq 1 then sz(2)=1 seq_out = seq_in for j = 0, sz(2)-1 do begin seq_out(131:137,j)=seq_in(131:137,j)-seq_in(169:175,j)*coef(0:6) tmp1=eprop_mult(seq_in(169:175,j), coef, err_in(38:44,j), coer(0:6)) ; Mult tmp2=eprop_sumdif(err_in(0:6,j), tmp1) ; Subtraction seq_out(195:201,j)=tmp2 endfor if verbose eq 1 then print,' STEP 5: crosstalk corrections applied' end