pro metcal ; 6th September 1998 ; Program to calibrate MET data taken during EDL. ; ; ____________________________________________________________________ ; ; 3rd September 1998. ; Reads and calibrates raw housekeeping data files. ; Outputs calibrated data files. ; Input: met_eeprom_hsk_dtl_raw, Output: met_eeprom_hsk_dtl_calx. ; Input: met_ram_hsk_dtl_raw, Output: met_ram_hsk_dtl_calx. ; Input: met_eeprom_sci_raw, Output: met_eeprom_sci_calx. ; Input: met_ram_sci_fe_raw, Output: met_ram_sci_fe_calx. ; Input: met_ram_sci_dtl_raw, Output: met_ram_sci_dtl_calx. ; Calibration algorithms taken from 980129 - Plot Pkts. ; No data plotting. ; ____________________________________________________________________ tstart = systime(1.0) hskraw1 = dblarr(12,100) ; Raw EEPROM housekeeping data. hskraw2 = hskraw1 ; Raw RAM housekeeping data. sciraw1 = dblarr(4,300) ; Raw EEPROM science data. sciraw2 = dblarr(12,200) ; Raw RAM freefall and entry science data. sciraw3 = dblarr(12,300) ; Raw RAM descent,terminal and landing science data. hskcal1 = hskraw1 ; Calibrated EEPROM housekeeping data. hskcal2 = hskraw1 ; Calibrated RAM housekeeping data. scical1 = sciraw1 ; Calibrated EEPROM science data. scical2 = sciraw2 ; Calibrated RAM freefall and entry science data. scical3 = sciraw3 ; Calibrated RAM descent,terminal and landing science data. hskt1 = dblarr(100) ; Sckltime corresponding to hskraw1. hskt2 = hskt1 ; Sckltime corresponding to hskraw2. scit1 = dblarr(300) ; Sckltime corresponding to sciraw1. scit2 = dblarr(200) ; Sckltime corresponding to sciraw2. scit3 = dblarr(300) ; Sckltime corresponding to sciraw3. hsktmp = dblarr(13) scitmp1 = dblarr(5) scitmp2 = dblarr(13) skipline = ' ' print,'Mac(0) or Sun(1) ? read,im ; ---------------------------------------------------------------------------- ; Reads calibrates and outputs raw MET housekeeping data collected during ; the descent, terminal and landing phases of EDL in the EEPROM data stream. ; ---------------------------------------------------------------------------- ; ; Input Data Format:- ; ; Column 1 - Spacecraft SCLK time in seconds. ; Column 2 - +5 V reference voltage - Counts. ; Column 3 - +-12 V power supply voltage - Counts. ; Column 4 - +5 V analog to digital converter (ADC) voltage supply - ; Counts. ; Column 5 - -5 V analog to digital converter (ADC) voltage supply - ; Counts. ; Column 6 - Unscaled mast base isothermal block platinum resistance ; thermometer (PRT4) sensor voltage - Counts. ; Column 7 - Mast base isothermal block platinum resistance thermometer ; temperature (PRT4) - Counts. ; Column 8 - PRT4 drive current voltage - Counts. ; Column 9 - PRT5 drive current voltage - Counts. ; Column 10 - Wind sensor thermocouple temperature - Counts. ; Column 11 - Wind sensor current - Counts. ; Column 12 - Pressure sensor platinum resistance thermometer temperature ; (PRT5) - Counts. ; Column 13 - MET circuit board temperature - Counts. if (im eq 0) then openr,10,'Macintosh HD:Pathfinder EDL PDS:met_eeprom_hsk_dtl_raw' if (im eq 1) then begin print,'Input Filename ?' read,filename openr,10,filename endif i1=-1 for i =1,16 do readf,10,skipline ; Skips first 16 lines of text. while (EOF(10) eq 0) do begin if (EOF(10) eq 1) then goto,bail1 readf,10,hsktmp i1 = i1+1 ; print,i1,hsktmp hskt1(i1) = hsktmp(0) hskraw1(*,i1) = hsktmp(1:12) end bail1:close,10 hskraw1 = hskraw1(*,0:i1) hskt1 = hskt1(0:i1) hskt1 = hskt1 - 1246725418.00d+00 ; Time from start of EDL hskcal1 = hskraw1 atemp = where(hskraw1 ge 8192) hskcal1(atemp) = hskraw1(atemp) - 8192 ; Maps EDL to landed counts atemp = where(hskraw1 le 8191) hskcal1(atemp) = hskraw1(atemp) + 8192 ; Maps EDL to landed counts hskcal1 = 3.0*(hskcal1/2^13 - 1) ; Landed counts to volts (DFM 96-007) hskcal1(0,*) = 2.0*hskcal1(0,*) ; + 5 V Reference hskcal1(2,*) = 2.0*hskcal1(2,*) ; + 5 V ADC hskcal1(3,*) = 2.0*hskcal1(3,*) ; - 5 V ADC hskcal1(4,*) = hskcal1(4,*)/10.4455 ; Sense Voltage PRT4 hskcal1(5,*) = (0.210889+0.032413*hskcal1(5,*))/4.994E-4 ; PRT4 Resistance (Cal.Notes, 12/11/96) hskcal1(5,*) = 273.15-221.581+0.307818*hskcal1(5,*)+4.60188E-04*hskcal1(5,*)^2$ -5.00112E-7*hskcal1(5,*)^3+2.21663E-10*hskcal1(5,*)^4 ; PRT4 Temperature K. hskcal1(8,*) = 0.006062-2.198228*hskcal1(8,*) ; TC13 mV (Tprt4 reference) vprt4 = -1.06482E+1+2.11090E-02*hskcal1(5,*)+1.14319E-05*hskcal1(5,*)^2$ +4.51738E-07*hskcal1(5,*)^3-1.22001E-09*hskcal1(5,*)^4$ +1.06146E-12*hskcal1(5,*)^5 ; TC mV at Tprt4 (0 C reference). hskcal1(8,*) = hskcal1(8,*)+vprt4 ; TC13 mV (0 C reference). hskcal1(8,*) = 273.155+17.0634*hskcal1(8,*)-0.256265*hskcal1(8,*)^2+$ 0.0180272*hskcal1(8,*)^3-1.29807E-03*hskcal1(8,*)^4-$ 6.69391E-05*hskcal1(8,*)^5-3.95734E-06*hskcal1(8,*)^6+$ 2.19876E-06*hskcal1(8,*)^7 ; TC13 Temperature - Kelvin. hskcal1(9,*) = 1000.0*hskcal1(9,*)/22.10 ; Wind sensor current, mA - Low power hskcal1(10,*) = (0.243000+0.022025*hskcal1(10,*))/4.958E-4 ; PRT5 Resistance (Cal.Notes, 12/11/96) hskcal1(10,*) = -221.456+0.309646*hskcal1(10,*)+4.68740E-04*hskcal1(10,*)^2$ -5.12036E-07*hskcal1(10,*)^3+2.27997E-10*hskcal1(10,*)^4+273.15 ; PRT5 Temperature - Kelvin. hskcal1(11,*) = 273.15+100.0*hskcal1(11,*) ; HKBT Temperature - Kelvin. openw,11,'Macintosh HD:Pathfinder EDL PDS:met_eeprom_hsk_dtl_calx' for i=0,i1 do begin print,hskt1(i),hskcal1(*,i),format='(f10.4,4f8.4,f9.5,f8.3,2f8.4,4f8.3)' printf,11,hskt1(i),hskcal1(*,i),format='(f10.4,4f8.4,f9.5,f8.3,2f8.4,4f8.3)' endfor close,11 ; ---------------------------------------------------------------------------- ; Reads calibrates and outputs raw MET housekeeping data collected during ; the descent, terminal and landing phases of EDL in the RAM data stream. ; ---------------------------------------------------------------------------- ; Input data format same as for EEPROM housekeeping if (im eq 0) then openr,10,'Macintosh HD:Pathfinder EDL PDS:met_ram_hsk_dtl_raw' if (im eq 1) then begin print,'Input Filename ?' read,filename openr,10,filename endif i2=-1 for i =1,16 do readf,10,skipline ; Skips first 16 lines of text. while (EOF(10) eq 0) do begin if (EOF(10) eq 1) then goto,bail2 readf,10,hsktmp i2 = i2+1 ; print,i2,hsktmp hskt2(i2) = hsktmp(0) hskraw2(*,i2) = hsktmp(1:12) end bail2:close,10 hskraw2 = hskraw2(*,0:i2) hskt2 = hskt2(0:i2) hskt2 = hskt2 - 1246725418.00d+00 ; Time from start of EDL hskcal2 = hskraw2 atemp = where(hskraw2 ge 8192) hskcal2(atemp) = hskraw2(atemp) - 8192 ; Maps EDL to landed counts atemp = where(hskraw2 le 8191) hskcal2(atemp) = hskraw2(atemp) + 8192 ; Maps EDL to landed counts hskcal2 = 3.0*(hskcal2/2^13 - 1) ; Landed counts to volts (DFM 96-007) hskcal2(0,*) = 2.0*hskcal2(0,*) ; + 5 V Reference hskcal2(2,*) = 2.0*hskcal2(2,*) ; + 5 V ADC hskcal2(3,*) = 2.0*hskcal2(3,*) ; - 5 V ADC hskcal2(4,*) = hskcal2(4,*)/10.4455 ; Sense Voltage PRT4 hskcal2(5,*) = (0.210889+0.032413*hskcal2(5,*))/4.994E-4 ; PRT4 Resistance (Cal.Notes, 12/11/96) hskcal2(5,*) = 273.15-221.581+0.307818*hskcal2(5,*)+4.60188E-04*hskcal2(5,*)^2$ -5.00112E-7*hskcal2(5,*)^3+2.21663E-10*hskcal2(5,*)^4 ; PRT4 Temperature K. hskcal2(8,*) = 0.006062-2.198228*hskcal2(8,*) ; TC13 mV (Tprt4 reference) vprt4 = -1.06482E+1+2.11090E-02*hskcal2(5,*)+1.14319E-05*hskcal2(5,*)^2$ +4.51738E-07*hskcal2(5,*)^3-1.22001E-09*hskcal2(5,*)^4$ +1.06146E-12*hskcal2(5,*)^5 ; TC mV at Tprt4 (0 C reference). hskcal2(8,*) = hskcal2(8,*)+vprt4 ; TC13 mV (0 C reference). hskcal2(8,*) = 273.155+17.0634*hskcal2(8,*)-0.256265*hskcal2(8,*)^2+$ 0.0180272*hskcal2(8,*)^3-1.29807E-03*hskcal2(8,*)^4-$ 6.69391E-05*hskcal2(8,*)^5-3.95734E-06*hskcal2(8,*)^6+$ 2.19876E-06*hskcal2(8,*)^7 ; TC13 Temperature - Kelvin. hskcal2(9,*) = 1000.0*hskcal2(9,*)/22.10 ; Wind sensor current, mA - Low power hskcal2(10,*) = (0.243000+0.022025*hskcal2(10,*))/4.958E-4 ; PRT5 Resistance (Cal.Notes, 12/11/96) hskcal2(10,*) = -221.456+0.309646*hskcal2(10,*)+4.68740E-04*hskcal2(10,*)^2$ -5.12036E-07*hskcal2(10,*)^3+2.27997E-10*hskcal2(10,*)^4+273.15 ; PRT5 Temperature - Kelvin. hskcal2(11,*) = 273.15+100.0*hskcal2(11,*) ; HKBT Temperature - Kelvin. openw,11,'Macintosh HD:Pathfinder EDL PDS:met_ram_hsk_dtl_calx' for i=0,i2 do begin print,hskt2(i),hskcal2(*,i),format='(f10.4,4f8.4,f9.5,f8.3,2f8.4,4f8.3)' printf,11,hskt2(i),hskcal2(*,i),format='(f10.4,4f8.4,f9.5,f8.3,2f8.4,4f8.3)' endfor close,11 ; ---------------------------------------------------------------------------- ; Reads calibrates and outputs raw MET science data collected throughout ; EDL in the EEPROM data stream. ; ---------------------------------------------------------------------------- ; Input Data Format: ; Column 1 - Spacecraft SCLK time in seconds. ; Column 2 - Mast base isothermal block platinum resistance thermometer ; temperature (PRT4) - Counts. ; Column 3 - Pressure sensor platinum resistance thermometer temperature ; (PRT5) - Counts. ; Column 4 - Pressure (0-12 mbar range) - Counts. ; Column 5 - Descent thermocouple temperature - Counts. if (im eq 0) then openr,10,'Macintosh HD:Pathfinder EDL PDS:met_eeprom_sci_raw' if (im eq 1) then begin print,'Input Filename ?' read,filename openr,10,filename endif i3=-1 for i =1,8 do readf,10,skipline ; Skips first 8 lines of text. while (EOF(10) eq 0) do begin if (EOF(10) eq 1) then goto,bail3 readf,10,scitmp1 i3 = i3+1 ; print,i3,scitmp1 scit1(i3) = scitmp1(0) sciraw1(*,i3) = scitmp1(1:4) end bail3:close,10 sciraw1 = sciraw1(*,0:i3) scit1 = scit1(0:i3) scit1 = scit1 - 1246725418.00d+00 ; Time from start of EDL scical1 = sciraw1 atemp = where(sciraw1 ge 8192) scical1(atemp) = sciraw1(atemp) - 8192 ; Maps EDL to landed counts atemp = where(sciraw1 le 8191) scical1(atemp) = sciraw1(atemp) + 8192 ; Maps EDL to landed counts scical1 = 3.0*(scical1/2^13 - 1) ; Landed counts to volts (DFM 96-007) scical1(0,*) = (0.210889+0.032413*scical1(0,*))/4.994E-4 ; PRT4 Resistance (Cal.Notes, 12/11/96) scical1(0,*) = 273.15-221.581+0.307818*scical1(0,*)+4.60188E-04*scical1(0,*)^2$ -5.00112E-7*scical1(0,*)^3+2.21663E-10*scical1(0,*)^4 ; PRT4 Temperature - Kelvin. vprt4 = -1.06482E+1+2.11090E-02*scical1(0,*)+1.14319E-05*scical1(0,*)^2+4.51738E-07*scical1(0,*)^3-$ 1.22001E-09*scical1(0,*)^4+1.06146E-12*scical1(0,*)^5 ; TC mV at Tprt4 (0 C reference) scical1(3,*) = 0.007179-2.207124*scical1(3,*) + vprt4 ; TC Descent mv (0 C reference) scical1(3,*) = 273.155+17.0634*scical1(3,*)-0.256265*scical1(3,*)^2+$ 0.0180272*scical1(3,*)^3-1.29807E-03*scical1(3,*)^4-$ 6.69391E-05*scical1(3,*)^5-3.95734E-06*scical1(3,*)^6+$ 2.19876E-06*scical1(3,*)^7 ; TC Descent Temperature - Kelvin. scical1(1,*) = (0.243000+0.022025*scical1(1,*))/4.958E-4 ; PRT5 Resistance (Cal.Notes, 12/11/96) scical1(1,*) = -221.456+0.309646*scical1(1,*)+4.68740E-04*scical1(1,*)^2$ -5.12036E-07*scical1(1,*)^3+2.27997E-10*scical1(1,*)^4+273.15 ; PRT5 Temperature - Kelvin. ; Sets up coefficient tables for p = f(v,T) and v = f(p,T) vfptc = dblarr(4,4) vfptc(0,*) = [-3.89633536e+00, 5.26482984e-02,-2.28714911e-04, 3.21734518e-07] vfptc(1,*) = [ 4.78094488e-01,-3.68448731e-04, 3.55659580e-07, 7.15208837e-10] vfptc(2,*) = [-9.32868291e-03, 1.13915550e-04,-3.90968154e-07, 4.17508833e-10] vfptc(3,*) = [ 6.64441148e-04,-8.46487910e-06, 3.12074100e-08,-3.67690149e-11] pfvtc = dblarr(4,4) pfvtc(0,*) = [ 9.38929081e+00,-1.26658216e-01, 5.49595396e-04,-7.72481201e-07] pfvtc(1,*) = [ 1.93688595e+00, 3.66907474e-03,-8.98521012e-06, 5.86734394e-09] pfvtc(2,*) = [ 1.51190102e-01,-1.85472821e-03, 6.61191234e-06,-7.49290585e-09] pfvtc(3,*) = [-2.06737220e-02, 2.58260203e-04,-9.35214416e-07, 1.08286091e-09] coeff = dblarr(4,i3+1) scical1(2,*) = 2.30319-0.84706*scical1(2,*) ; Tavis O/P volts 0-12 mbar (Cal.Notes 12/13/96) ; Pressure calibration (See Calibration Notes, 29th June 1997). newoff = 1.4955 - 0.005625*scical1(1,*) ; -0.0135 mbar/K (Calibration Notes - 19th January 1997) coeff(0,*) = vfptc(0,0)+vfptc(0,1)*scical1(1,*)+vfptc(0,2)*scical1(1,*)^2+$ vfptc(0,3)*scical1(1,*)^3 ; Polynomial coeffs, v = f(p,Tprt5) oldoff = coeff(0,*) ; Tavis O/P offset voltage from Cal. for j=0,3 do begin ; Polynomial coeffs, p = f(v,Tprt5) coeff(j,*) = pfvtc(j,0)+pfvtc(j,1)*scical1(1,*)+pfvtc(j,2)*scical1(1,*)^2+$ pfvtc(j,3)*scical1(1,*)^3 endfor scical1(2,*) = scical1(2,*)+oldoff-newoff ; Correct cal. input for new offset. scical1(2,*) = coeff(0,*)+coeff(1,*)*scical1(2,*)+coeff(2,*)*scical1(2,*)^2+$ coeff(3,*)*scical1(2,*)^3 ; Convert voltage to pressure scical1(2,*) = scical1(2,*) - 0.0235 ; Calibration Tweak, EDL only (Notes - 4th Sept 1998) openw,11,'Macintosh HD:Pathfinder EDL PDS:met_eeprom_sci_calx' for i=0,i3 do begin print,scit1(i),scical1(*,i),format='(f10.4,2f8.3,f8.4,f8.3)' printf,11,scit1(i),scical1(*,i),format='(f10.4,2f8.3,f8.4,f8.3)' endfor close,11 ; ---------------------------------------------------------------------------- ; Reads calibrates and outputs raw MET science data collected during the ; freefall and entry phases of EDL in the RAM data stream. ; ---------------------------------------------------------------------------- ; Input Data Format: ; Column 1 - Spacecraft SCLK time in seconds. ; Column 2 - Wind sensor current - Counts. ; Column 3 - Middle mast thermocouple temperature - Counts. ; Column 4 - Mast base isothermal block platinum resistance thermometer ; temperature (PRT4) - Counts. ; Column 5 - Descent thermocouple temperature - Counts. ; Column 6 - Pressure sensor platinum resistance thermometer temperature ; (PRT5) - Counts. ; Column 7 - Pressure (0-12 mbar range) - Counts. ; Column 8 - Wind sensor element 1 temperature - Counts. ; Column 9 - Wind sensor element 2 temperature - Counts. ; Column 10 - Wind sensor element 3 temperature - Counts. ; Column 11 - Wind sensor element 4 temperature - Counts. ; Column 12 - Wind sensor element 5 temperature - Counts. ; Column 13 - Wind sensor element 6 temperature - Counts. if (im eq 0) then openr,10,'Macintosh HD:Pathfinder EDL PDS:met_ram_sci_fe_raw' if (im eq 1) then begin print,'Input Filename ?' read,filename openr,10,filename endif i4=-1 for i =1,16 do readf,10,skipline ; Skips first 16 lines of text. while (EOF(10) eq 0) do begin if (EOF(10) eq 1) then goto,bail4 readf,10,scitmp2 i4 = i4+1 ; print,i4,scitmp2 scit2(i4) = scitmp2(0) sciraw2(*,i4) = scitmp2(1:12) end bail4:close,10 sciraw2 = sciraw2(*,0:i4) scit2 = scit2(0:i4) scit2 = scit2 - 1246725418.00d+00 ; Time from start of EDL scical2 = sciraw2 atemp = where(sciraw2 ge 8192) scical2(atemp) = sciraw2(atemp) - 8192 ; Maps EDL to landed counts atemp = where(sciraw2 le 8191) scical2(atemp) = sciraw2(atemp) + 8192 ; Maps EDL to landed counts scical2 = 3.0*(scical2/2^13 - 1) ; Landed counts to volts (DFM 96-007) scical2(0,*) = 1000.0*scical2(0,*)/22.10 ; Wind sensor current, mA - Low power scical2(2,*) = (0.210889+0.032413*scical2(2,*))/4.994E-4 ; PRT4 Resistance (Cal.Notes, 12/11/96) scical2(2,*) = 273.15-221.581+0.307818*scical2(2,*)+4.60188E-04*scical2(2,*)^2$ -5.00112E-7*scical2(2,*)^3+2.21663E-10*scical2(2,*)^4 ; PRT4 Temperature - Kelvin. scical2(4,*) = (0.243000+0.022025*scical2(4,*))/4.958E-4 ; PRT5 Resistance (Cal.Notes, 12/11/96) scical2(4,*) = -221.456+0.309646*scical2(4,*)+4.68740E-04*scical2(4,*)^2$ -5.12036E-07*scical2(4,*)^3+2.27997E-10*scical2(4,*)^4+273.15 ; PRT5 Temperature - Kelvin. vprt4 = -1.06482E+1+2.11090E-02*scical2(2,*)+1.14319E-05*scical2(2,*)^2+4.51738E-07*scical2(2,*)^3-$ 1.22001E-09*scical2(2,*)^4+1.06146E-12*scical2(2,*)^5 ; TC mV at Tprt4 (0 C reference) scical2(1,*) = 0.007179-2.207124*scical2(1,*) + vprt4 ; TC Middle mv (0 C reference) scical2(1,*) = 273.155+17.0634*scical2(1,*)-0.256265*scical2(1,*)^2+$ 0.0180272*scical2(1,*)^3-1.29807E-03*scical2(1,*)^4-$ 6.69391E-05*scical2(1,*)^5-3.95734E-06*scical2(1,*)^6+$ 2.19876E-06*scical2(1,*)^7 ; TC Middle Temperature - Kelvin. scical2(3,*) = 0.007179-2.207124*scical2(3,*) + vprt4 ; TC Descent mv (0 C reference) scical2(3,*) = 273.155+17.0634*scical2(3,*)-0.256265*scical2(3,*)^2+$ 0.0180272*scical2(3,*)^3-1.29807E-03*scical2(3,*)^4-$ 6.69391E-05*scical2(3,*)^5-3.95734E-06*scical2(3,*)^6+$ 2.19876E-06*scical2(3,*)^7 ; TC Descent Temperature - Kelvin. coeff = dblarr(4,i4+1) scical2(5,*) = 2.30319-0.84706*scical2(5,*) ; Tavis O/P volts 0-12 mbar (Cal.Notes 12/13/96) ; Pressure calibration (See Calibration Notes, 29th June 1997). newoff = 1.4955 - 0.005625*scical2(4,*) ; -0.0135 mbar/K (Calibration Notes - 19th January 1997) coeff(0,*) = vfptc(0,0)+vfptc(0,1)*scical2(4,*)+vfptc(0,2)*scical2(4,*)^2+$ vfptc(0,3)*scical2(4,*)^3 ; Polynomial coeffs, v = f(p,Tprt5) oldoff = coeff(0,*) ; Tavis O/P offset voltage from Cal. for j=0,3 do begin ; Polynomial coeffs, p = f(v,Tprt5) coeff(j,*) = pfvtc(j,0)+pfvtc(j,1)*scical2(4,*)+pfvtc(j,2)*scical2(4,*)^2+$ pfvtc(j,3)*scical2(4,*)^3 endfor scical2(5,*) = scical2(5,*)+oldoff-newoff ; Correct cal. input for new offset. scical2(5,*) = coeff(0,*)+coeff(1,*)*scical2(5,*)+coeff(2,*)*scical2(5,*)^2+$ coeff(3,*)*scical2(5,*)^3 ; Convert voltage to pressure scical2(5,*) = scical2(5,*) - 0.0235 ; Calibration Tweak, EDL only (Notes - 4th Sept 1998) rfudge = [1.0014,1.0038,0.9835,0.9820,1.0089,0.9982] ; Wind sensor resistance fudge. scical2(6,*) = -0.942481+0.189187*scical2(6,*) ; Wind Sensor 1 Volts. scical2(7,*) = -0.944840+0.189114*scical2(7,*) ; Wind Sensor 2 Volts. scical2(8,*) = -0.944524+0.189213*scical2(8,*) ; Wind Sensor 3 Volts. scical2(9,*) = -0.943349+0.188587*scical2(9,*) ; Wind Sensor 4 Volts. scical2(10,*) = -0.944803+0.189279*scical2(10,*) ; Wind Sensor 5 Volts. scical2(11,*) = -0.942232+0.189093*scical2(11,*) ; Wind Sensor 6 Volts. scical2(6:11,*) = -scical2(6:11,*)/0.02061 ; Resistance, Low power, Ohms. scical2(6,*) = rfudge(0)*scical2(6,*) ; Resistance fudge. scical2(7,*) = rfudge(1)*scical2(7,*) ; Resistance fudge. scical2(8,*) = rfudge(2)*scical2(8,*) ; Resistance fudge. scical2(9,*) = rfudge(3)*scical2(9,*) ; Resistance fudge. scical2(10,*) = rfudge(4)*scical2(10,*) ; Resistance fudge. scical2(11,*) = rfudge(5)*scical2(11,*) ; Resistance fudge. scical2(6,*) = -8.76535E+02+9.27647E+01*scical2(6,*)-2.92776E+00*scical2(6,*)^2$ +4.70349E-02*scical2(6,*)^3 ; Wind Sensor 1 Volts to Temperature. scical2(7,*) = -9.09869E+02+9.62995E+01*scical2(7,*)-3.07051E+00*scical2(7,*)^2$ +4.88512E-02*scical2(7,*)^3 ; Wind Sensor 2 Volts to Temperature. scical2(8,*) = -9.32087E+02+1.01101E+02*scical2(8,*)-3.32448E+00*scical2(8,*)^2$ +5.36899E-02*scical2(8,*)^3 ; Wind Sensor 3 Volts to Temperature. scical2(9,*) = -9.46539E+02+1.03308E+02*scical2(9,*)-3.43254E+00*scical2(9,*)^2$ +5.56105E-02*scical2(9,*)^3 ; Wind Sensor 4 Volts to Temperature. scical2(10,*) = -9.13026E+02+9.78749E+01*scical2(10,*)-3.16499E+00*scical2(10,*)^2$ +5.08620E-02*scical2(10,*)^3 ; Wind Sensor 5 Volts to Temperature. scical2(11,*) = -8.71562E+02+9.15604E+01*scical2(11,*)-2.86480E+00*scical2(11,*)^2$ +4.58471E-02*scical2(11,*)^3 ; Wind Sensor 6 Volts to Temperature. openw,11,'Macintosh HD:Pathfinder EDL PDS:met_ram_sci_fe_calx' for i=0,i4 do begin print,scit2(i),scical2(*,i),format='(f10.4,5f8.3,f8.4,6f8.2)' printf,11,scit2(i),scical2(*,i),format='(f10.4,5f8.3,f8.4,6f8.2)' endfor close,11 ; ---------------------------------------------------------------------------- ; Reads calibrates and outputs raw MET science data collected during the ; descent, terminal, and landing phases of EDL in the RAM data stream. ; ---------------------------------------------------------------------------- ; Input Data Format: ; Column 1 - Spacecraft SCLK time in seconds. ; Column 2 - Top mast thermocouple temperature - Counts. ; Column 3 - Middle mast thermocouple temperature - Counts. ; Column 4 - Bottom mast thermocouple temperature - Counts. ; Column 5 - Descent thermocouple temperature - Counts. ; Column 6 - Pressure (6-10 mbar range) - Counts. ; Column 7 - Pressure (0-12 mbar range) - Counts. ; Column 8 - Wind sensor element 1 temperature - Counts. ; Column 9 - Wind sensor element 2 temperature - Counts. ; Column 10 - Wind sensor element 3 temperature - Counts. ; Column 11 - Wind sensor element 4 temperature - Counts. ; Column 12 - Wind sensor element 5 temperature - Counts. ; Column 13 - Wind sensor element 6 temperature - Counts. if (im eq 0) then openr,10,'Macintosh HD:Pathfinder EDL PDS:met_ram_sci_dtl_raw' if (im eq 1) then begin print,'Input Filename ?' read,filename openr,10,filename endif i5=-1 for i =1,16 do readf,10,skipline ; Skips first 16 lines of text. while (EOF(10) eq 0) do begin if (EOF(10) eq 1) then goto,bail5 readf,10,scitmp2 i5 = i5+1 ; print,i5,scitmp2 scit3(i5) = scitmp2(0) sciraw3(*,i5) = scitmp2(1:12) end bail5:close,10 sciraw3 = sciraw3(*,0:i5) scit3 = scit3(0:i5) scit3 = scit3 - 1246725418.00d+00 ; Time from start of EDL scical3 = sciraw3 atemp = where(sciraw3 ge 8192) scical3(atemp) = sciraw3(atemp) - 8192 ; Maps EDL to landed counts atemp = where(sciraw3 le 8191) scical3(atemp) = sciraw3(atemp) + 8192 ; Maps EDL to landed counts scical3 = 3.0*(scical3/2^13 - 1) ; Landed counts to volts (DFM 96-007) ; Creates linearly interpolated PRT4 temperatures at times scit3(*), using ; the EEPROM science PRT4 calibrated temperatures ; scical1(0,*). EEPROM has better time sampling than RAM housekeeping. tprt4 = dblarr(i5+1) ; Interpolated PRT4 temperatures. tprt5 = dblarr(i5+1) ; Interpolated PRT5 temperatures. iint = 1 for i=0,i5 do begin goto, test again:iint = iint+1 test:if (scit1(iint) lt scit3(i) and iint lt i3) then goto,again tprt4(i) = ((scit3(i)-scit1(iint-1))*scical1(0,iint)+(scit1(iint)-scit3(i))*scical1(0,iint-1))$ /(scit1(iint)-scit1(iint-1)) ; Linearly interpolated PRT4 temperature. tprt5(i) = ((scit3(i)-scit1(iint-1))*scical1(1,iint)+(scit1(iint)-scit3(i))*scical1(1,iint-1))$ /(scit1(iint)-scit1(iint-1)) ; Linearly interpolated PRT5 temperature. endfor vprt4 = -1.06482E+1+2.11090E-02*tprt4+1.14319E-05*tprt4^2+4.51738E-07*tprt4^3-$ 1.22001E-09*tprt4^4+1.06146E-12*tprt4^5 ; TC mV at Tprt4 (0 C reference) scical3(0,*) = 0.004816-2.197012*scical3(0,*)+vprt4 ; TC Top mv (0 C reference) scical3(1,*) = 0.006176-2.159250*scical3(1,*)+vprt4 ; TC Mid mv (0 C reference) scical3(2,*) = 0.009193-2.146410*scical3(2,*)+vprt4 ; TC Bottom mv (0 C reference) scical3(3,*) = 0.007179-2.207124*scical3(3,*)+vprt4 ; TC Descent mv (0 C reference) scical3(0:3,*) = 273.155+17.0634*scical3(0:3,*)-0.256265*scical3(0:3,*)^2+$ 0.0180272*scical3(0:3,*)^3-1.29807E-03*scical3(0:3,*)^4-$ 6.69391E-05*scical3(0:3,*)^5-3.95734E-06*scical3(0:3,*)^6+$ 2.19876E-06*scical3(0:3,*)^7 ; TC Temperatures - Kelvin. ; Pressure calibration (See Calibration Notes, 29th June 1997). scical3(4,*) = 3.3441-0.28793*scical3(4,*) ; Tavis O/P volts 6-10 mbar (Cal.Notes 12/13/96) scical3(5,*) = 2.30319-0.84706*scical3(5,*) ; Tavis O/P volts 0-12 mbar (Cal.Notes 12/13/96) coeff = dblarr(4,i5+1) newoff = 1.4955 - 0.005625*tprt5 ; -0.0135 mbar/K (Calibration Notes - 19th January 1997) ; Polynomial coeffs, v = f(p,Tprt5) coeff(0) = vfptc(0,0)+vfptc(0,1)*tprt5+vfptc(0,2)*tprt5^2+vfptc(0,3)*tprt5^3 oldoff = coeff(0) ; Tavis O/P offset voltage from Cal. for j=0,3 do begin ; Polynomial coeffs, p = f(v,Tprt5) coeff(j) = pfvtc(j,0)+pfvtc(j,1)*tprt5+pfvtc(j,2)*tprt5^2+pfvtc(j,3)*tprt5^3 endfor for i=4,5 do begin scical3(i,*) = scical3(i,*)+oldoff-newoff ; Correct cal. input for new offset. scical3(i,*) = coeff(0)+coeff(1)*scical3(i,*)+coeff(2)*scical3(i,*)^2+$ coeff(3)*scical3(i,*)^3 ; Convert voltage to pressure scical3(i,*) = scical3(i,*) - 0.0235 ; Calibration Tweak, EDL only (Notes - 4th Sept 1998) endfor scical3(6,*) = -0.942481+0.189187*scical3(6,*) ; Wind Sensor 1 Volts. scical3(7,*) = -0.944840+0.189114*scical3(7,*) ; Wind Sensor 2 Volts. scical3(8,*) = -0.944524+0.189213*scical3(8,*) ; Wind Sensor 3 Volts. scical3(9,*) = -0.943349+0.188587*scical3(9,*) ; Wind Sensor 4 Volts. scical3(10,*) = -0.944803+0.189279*scical3(10,*) ; Wind Sensor 5 Volts. scical3(11,*) = -0.942232+0.189093*scical3(11,*) ; Wind Sensor 6 Volts. scical3(6:11,*) = -scical3(6:11,*)/0.02061 ; Resistance, Low power, Ohms. scical3(6,*) = rfudge(0)*scical3(6,*) ; Resistance fudge. scical3(7,*) = rfudge(1)*scical3(7,*) ; Resistance fudge. scical3(8,*) = rfudge(2)*scical3(8,*) ; Resistance fudge. scical3(9,*) = rfudge(3)*scical3(9,*) ; Resistance fudge. scical3(10,*) = rfudge(4)*scical3(10,*) ; Resistance fudge. scical3(11,*) = rfudge(5)*scical3(11,*) ; Resistance fudge. scical3(6,*) = -8.76535E+02+9.27647E+01*scical3(6,*)-2.92776E+00*scical3(6,*)^2$ +4.70349E-02*scical3(6,*)^3 ; Wind Sensor 1 Volts to Temperature. scical3(7,*) = -9.09869E+02+9.62995E+01*scical3(7,*)-3.07051E+00*scical3(7,*)^2$ +4.88512E-02*scical3(7,*)^3 ; Wind Sensor 2 Volts to Temperature. scical3(8,*) = -9.32087E+02+1.01101E+02*scical3(8,*)-3.32448E+00*scical3(8,*)^2$ +5.36899E-02*scical3(8,*)^3 ; Wind Sensor 3 Volts to Temperature. scical3(9,*) = -9.46539E+02+1.03308E+02*scical3(9,*)-3.43254E+00*scical3(9,*)^2$ +5.56105E-02*scical3(9,*)^3 ; Wind Sensor 4 Volts to Temperature. scical3(10,*) = -9.13026E+02+9.78749E+01*scical3(10,*)-3.16499E+00*scical3(10,*)^2$ +5.08620E-02*scical3(10,*)^3 ; Wind Sensor 5 Volts to Temperature. scical3(11,*) = -8.71562E+02+9.15604E+01*scical3(11,*)-2.86480E+00*scical3(11,*)^2$ +4.58471E-02*scical3(11,*)^3 ; Wind Sensor 6 Volts to Temperature. openw,11,'Macintosh HD:Pathfinder EDL PDS:met_ram_sci_dtl_calx' for i=0,i5 do begin print,scit3(i),scical3(*,i),format='(f10.4,4f8.3,2f8.4,6f8.2)' printf,11,scit3(i),scical3(*,i),format='(f10.4,4f8.3,2f8.4,6f8.2)' endfor close,11 print,systime(1.0)-tstart end