PRO IMPACT200_TO_CDF, SCIDATA, DATESTRING, SCID ;+ ; Project : STEREO - IMPACT ; ; Name : IMPACT200_TO_CDF ; ; Purpose : Write IMPACT 200 data to CDF ; ; Category : STEREO, IMPACT ; ; Explanation : ; ; Syntax : IMPACT200_TO_CDF, SCIDATA, DATESTRING, SCID ; ; Examples : ; ; Inputs : SCIDATA - a structure including IMPACT 200 science data ; DATESTRING - the date string for the filename ; SCID - the spacecraft ID ; ; Opt. Inputs : None. ; ; Outputs : None. ; ; Opt. Outputs: None. ; ; Keywords : None ; ; Calls : None ; ; Common : None ; ; Restrictions: ; ; Side effects: None. ; ; Prev. Hist. : None. ; ; History : Version 1, 15-Aug-2008, Peter Schroeder, ; UC-Berkeley. ; ; Contact : peters@ssl.berkeley.edu ;- ; if (SCID eq 'EA'XU) then begin SOURCE_FILE = 'impact200a_v02.cdf' SCSTRING = 'STA' endif else begin SOURCE_FILE = 'impact200b_v02.cdf' SCSTRING = 'STB' endelse filename = SCSTRING+'_L1_IMPACT_HKP_'+DATESTRING+'_V02.cdf' SOURCE_FILE = concat_dir('$CORE_L1_CALIB_DATA', SOURCE_FILE) filematch = file_search(filename, count = filecount) if filecount eq 0 then file_copy, SOURCE_FILE, filename cdfid = cdf_open(filename) if filecount eq 0 then recstart = 0 else begin quiet=!quiet & !quiet=1 cdf_control, cdfid, get_var_info=info, variable='Epoch' !quiet=quiet recstart = info.maxrec+1 endelse utcpkttim = SCIDATA.TIME utc = anytim2utc(utcpkttim,/external) cdf_epoch, pktepoch, utc.year, utc.month, utc.day, utc.hour, utc.minute, $ utc.second, utc.millisecond,/compute_epoch cdf_varput, cdfid, 'Epoch', pktepoch, rec_start = recstart cdf_varput, cdfid, 'SampleTime', SCIDATA.SAMPLETIME, rec_start = recstart cdf_varput, cdfid, 'SoftwareVersion', SCIDATA.SOFTWAREVERSION, rec_start = recstart cdf_varput, cdfid, 'HardwareVersion', SCIDATA.HARDWAREVERSION, rec_start = recstart cdf_varput, cdfid, 'PollTimeMax', SCIDATA.POLLTIMEMAX, rec_start = recstart cdf_varput, cdfid, 'PollTimeAvg', SCIDATA.POLLTIMEAVG, rec_start = recstart cdf_varput, cdfid, 'TimeJitter', SCIDATA.TIMEJITTER, rec_start = recstart cdf_varput, cdfid, 'ErrorCode', SCIDATA.ERRORCODE, rec_start = recstart cdf_varput, cdfid, 'ErrorData', SCIDATA.ERRORDATA, rec_start = recstart cdf_varput, cdfid, 'ErrorCount', SCIDATA.ERRORCOUNT, rec_start = recstart cdf_varput, cdfid, 'CommandCount', SCIDATA.COMMANDCOUNT, rec_start = recstart cdf_varput, cdfid, 'CommandLastID', SCIDATA.COMMANDLASTID, rec_start = recstart cdf_varput, cdfid, 'CommandLastSeq', SCIDATA.COMMANDLASTSEQ, rec_start = recstart cdf_varput, cdfid, 'PCommandCount', SCIDATA.PCOMMANDCOUNT, rec_start = recstart cdf_varput, cdfid, 'PCommandLastID', SCIDATA.PCOMMANDLASTID, rec_start = recstart cdf_varput, cdfid, 'PCommandLastSeq', SCIDATA.PCOMMANDLASTSEQ, rec_start = recstart cdf_varput, cdfid, 'IMPACT_SSR', SCIDATA.IMPACT_SSR, rec_start = recstart cdf_varput, cdfid, 'PLASTIC_SSR', SCIDATA.PLASTIC_SSR, rec_start = recstart cdf_varput, cdfid, 'SCStatus', SCIDATA.SCSTATUS, rec_start = recstart cdf_varput, cdfid, 'BootSelect', SCIDATA.BOOTSELECT, rec_start = recstart cdf_varput, cdfid, 'CodePage', SCIDATA.CODEPAGE, rec_start = recstart cdf_varput, cdfid, 'CodePageStatus', SCIDATA.CODEPAGESTATUS, rec_start = recstart cdf_varput, cdfid, 'CmdSeqRunning', SCIDATA.CMDSEQRUNNING, rec_start = recstart cdf_varput, cdfid, 'InterfaceEnables', SCIDATA.INTERFACEENABLES, rec_start = recstart cdf_varput, cdfid, 'ITelemEnables', SCIDATA.TELEMENABLES, rec_start = recstart cdf_varput, cdfid, 'PTelemEnables', SCIDATA.PTELEMENABLES, rec_start = recstart cdf_varput, cdfid, 'InterfaceActive', SCIDATA.INTERFACEACTIVE, rec_start = recstart cdf_varput, cdfid, 'MaxIMPACTQ', SCIDATA.MAXIMPACTQ, rec_start = recstart cdf_varput, cdfid, 'MaxPLASTICQ', SCIDATA.MAXPLASTICQ, rec_start = recstart cdf_varput, cdfid, 'IMPACTBitrate', SCIDATA.IMPACTBITRATE, rec_start = recstart cdf_varput, cdfid, 'PLASTICBitrate', SCIDATA.PLASTICBitrate, rec_start = recstart cdf_varput, cdfid, 'CmdSeqMask', SCIDATA.CMDSEQMASK, rec_start = recstart cdf_varput, cdfid, 'BurstModeID', SCIDATA.BURSTMODEID, rec_start = recstart cdf_varput, cdfid, 'BurstCurCriteria', SCIDATA.BURSTCURCRITERIA, rec_start = recstart cdf_varput, cdfid, 'STEUDoorCount', SCIDATA.STEUDOORCOUNT, rec_start = recstart cdf_varput, cdfid, 'STEUDoorStart', SCIDATA.STEUDOORSTART, rec_start = recstart cdf_varput, cdfid, 'STEUDoorDone', SCIDATA.STEUDOORDONE, rec_start = recstart cdf_varput, cdfid, 'STEDDoorCount', SCIDATA.STEDDOORCOUNT, rec_start = recstart cdf_varput, cdfid, 'STEDDoorStart', SCIDATA.STEDDOORSTART, rec_start = recstart cdf_varput, cdfid, 'STEDDoorDone', SCIDATA.STEDDOORDONE, rec_start = recstart cdf_varput, cdfid, 'AutoLUT', SCIDATA.AUTOLUT, rec_start = recstart cdf_varput, cdfid, 'STEModeID', SCIDATA.STEMODEID, rec_start = recstart cdf_varput, cdfid, 'SWEAModeID', SCIDATA.SWEAMODEID, rec_start = recstart cdf_varput, cdfid, 'BurstSavePage', SCIDATA.BURSTSAVEPAGE, rec_start = recstart cdf_varput, cdfid, 'BurstSendPage', SCIDATA.BURSTSENDPAGE, rec_start = recstart cdf_varput, cdfid, 'BurstBestCriteria', SCIDATA.BURSTBESTCRITERIA, rec_start = recstart cdf_varput, cdfid, 'MAGHKP', SCIDATA.MAGHKP, rec_start = recstart cdf_varput, cdfid, 'MAGHeater', SCIDATA.MAGHEATER, rec_start = recstart cdf_varput, cdfid, 'MAGTemp', SCIDATA.MAGTEMP, rec_start = recstart cdf_varput, cdfid, 'STEUCur', SCIDATA.STEUCUR, rec_start = recstart cdf_varput, cdfid, 'STEUTemp', SCIDATA.STEUTEMP, rec_start = recstart cdf_varput, cdfid, 'STEUDACTemp', SCIDATA.STEUDACTEMP, rec_start = recstart cdf_varput, cdfid, 'STEUVCCA', SCIDATA.STEUVCCA, rec_start = recstart cdf_varput, cdfid, 'STEU5VD', SCIDATA.STEU5VD, rec_start = recstart cdf_varput, cdfid, 'STEUVCC1', SCIDATA.STEUVCC1, rec_start = recstart cdf_varput, cdfid, 'STEU5VA', SCIDATA.STEU5VA, rec_start = recstart cdf_varput, cdfid, 'STEU12V', SCIDATA.STEU12V, rec_start = recstart cdf_varput, cdfid, 'SWEAMCP', SCIDATA.SWEAMCP, rec_start = recstart cdf_varput, cdfid, 'SWEANR5V', SCIDATA.SWEANR5V, rec_start = recstart cdf_varput, cdfid, 'SWEAAnal', SCIDATA.SWEAANAL, rec_start = recstart cdf_varput, cdfid, 'SWEADefl1', SCIDATA.SWEADEFL1, rec_start = recstart cdf_varput, cdfid, 'SWEADefl2', SCIDATA.SWEADEFL2, rec_start = recstart cdf_varput, cdfid, 'SWEAV0', SCIDATA.SWEAV0, rec_start = recstart cdf_varput, cdfid, 'SWEAGND', SCIDATA.SWEAGND, rec_start = recstart cdf_varput, cdfid, 'SWEASTEDCur', SCIDATA.SWEASTEDCur, rec_start = recstart cdf_varput, cdfid, 'SWEAMCPTemp', SCIDATA.SWEAMCPTEMP, rec_start = recstart cdf_varput, cdfid, 'STEDTemp', SCIDATA.STEDTEMP, rec_start = recstart cdf_varput, cdfid, 'SWEADACTemp', SCIDATA.SWEADACTEMP, rec_start = recstart cdf_varput, cdfid, 'SWEASTEDVCCA', SCIDATA.SWEASTEDVCCA, rec_start = recstart cdf_varput, cdfid, 'SWEASTED5VD', SCIDATA.SWEASTED5VD, rec_start = recstart cdf_varput, cdfid, 'SWEASTEDVCC1', SCIDATA.SWEASTEDVCC1, rec_start = recstart cdf_varput, cdfid, 'SWEASTE5VA', SCIDATA.SWEASTE5VA, rec_start = recstart cdf_varput, cdfid, 'SWEASTE12V', SCIDATA.SWEASTE12V, rec_start = recstart cdf_varput, cdfid, 'STEUDig', SCIDATA.STEUDIG, rec_start = recstart cdf_varput, cdfid, 'SWEASTEDDig', SCIDATA.SWEASTEDDIG, rec_start = recstart cdf_varput, cdfid, 'BLK_ID', SCIDATA.BLK_ID, rec_start = recstart cdf_varput, cdfid, 'DEV_ID', SCIDATA.DEV_ID, rec_start = recstart cdf_varput, cdfid, 'PLRNM_SPARE', SCIDATA.PLRNM_SPARE, rec_start = recstart cdf_varput, cdfid, 'PLVC_N12V', SCIDATA.PLVC_N12V, rec_start = recstart cdf_varput, cdfid, 'PLVC_N5V', SCIDATA.PLVC_N5V, rec_start = recstart cdf_varput, cdfid, 'PESA_VM_POS', SCIDATA.PESA_VM_POS, rec_start = recstart cdf_varput, cdfid, 'PDFL_1_VM', SCIDATA.PDFL_1_VM, rec_start = recstart cdf_varput, cdfid, 'PDFL_1_TAP', SCIDATA.PDFL_1_TAP, rec_start = recstart cdf_varput, cdfid, 'PDFL_2_VM', SCIDATA.PDFL_2_VM, rec_start = recstart cdf_varput, cdfid, 'PDFL_2_TAP', SCIDATA.PDFL_2_TAP, rec_start = recstart cdf_varput, cdfid, 'PLVC_P2VB', SCIDATA.PLVC_P2VB, rec_start = recstart cdf_varput, cdfid, 'PPAC_CM_DC', SCIDATA.PPAC_CM_DC, rec_start = recstart cdf_varput, cdfid, 'PLVC_P12V', SCIDATA.PLVC_P12V, rec_start = recstart cdf_varput, cdfid, 'PLRPM_SPARE', SCIDATA.PLRPM_SPARE, rec_start = recstart cdf_varput, cdfid, 'PLVC_P2VA', SCIDATA.PLVC_P2VA, rec_start = recstart cdf_varput, cdfid, 'PLVC_P5V', SCIDATA.PLVC_P5V, rec_start = recstart cdf_varput, cdfid, 'PADC_AVDD', SCIDATA.PADC_AVDD, rec_start = recstart cdf_varput, cdfid, 'PADC_DVDD', SCIDATA.PADC_DVDD, rec_start = recstart cdf_varput, cdfid, 'PPAC_VM', SCIDATA.PPAC_VM, rec_start = recstart cdf_varput, cdfid, 'PCAL_VREF', SCIDATA.PCAL_VREF, rec_start = recstart cdf_varput, cdfid, 'PPAC_CM_AC', SCIDATA.PPAC_CM_AC, rec_start = recstart cdf_varput, cdfid, 'PMCP_VM', SCIDATA.PMCP_VM, rec_start = recstart cdf_varput, cdfid, 'PMCP_CM_DC', SCIDATA.PMCP_CM_DC, rec_start = recstart cdf_varput, cdfid, 'PMCP_CM_AC', SCIDATA.PMCP_CM_AC, rec_start = recstart cdf_varput, cdfid, 'PSSD_CM_DC', SCIDATA.PSSD_CM_DC, rec_start = recstart cdf_varput, cdfid, 'PS_CH_VM', SCIDATA.PS_CH_VM, rec_start = recstart cdf_varput, cdfid, 'PS_CH_VM_TAP', SCIDATA.PS_CH_VM_TAP, rec_start = recstart cdf_varput, cdfid, 'PS_CH_CM_DC', SCIDATA.PS_CH_CM_DC, rec_start = recstart cdf_varput, cdfid, 'PESA_VM_NEG', SCIDATA.PESA_VM_NEG, rec_start = recstart cdf_varput, cdfid, 'PESA_CM_DC', SCIDATA.PESA_CM_DC, rec_start = recstart cdf_varput, cdfid, 'PDFL_1_CM_DC', SCIDATA.PDFL_1_CM_DC, rec_start = recstart cdf_varput, cdfid, 'PDFL_2_CM_DC', SCIDATA.PDFL_2_CM_DC, rec_start = recstart cdf_varput, cdfid, 'PLVC_P2VB_IMON', SCIDATA.PLVC_P2VB_IMON, rec_start = recstart cdf_varput, cdfid, 'PLVC_P12V_IMON', SCIDATA.PLVC_P12V_IMON, rec_start = recstart cdf_varput, cdfid, 'PLVC_N12V_IMON', SCIDATA.PLVC_N12V_IMON, rec_start = recstart cdf_varput, cdfid, 'PLVC_P5V_IMON', SCIDATA.PLVC_P5V_IMON, rec_start = recstart cdf_varput, cdfid, 'PLVC_N5V_IMON', SCIDATA.PLVC_N5V_IMON, rec_start = recstart cdf_varput, cdfid, 'PLVC_P2VA_IMON', SCIDATA.PLVC_P2VA_IMON, rec_start = recstart cdf_varput, cdfid, 'PSSD_VM', SCIDATA.PSSD_VM, rec_start = recstart cdf_varput, cdfid, 'PPLUG_ID', SCIDATA.PPLUG_ID, rec_start = recstart cdf_varput, cdfid, 'PADC_LU_FLAG', SCIDATA.PADC_LU_FLAG, rec_start = recstart cdf_varput, cdfid, 'PDAC_STATUS', SCIDATA.PDAC_STATUS, rec_start = recstart cdf_varput, cdfid, 'PADC_LU_CTR', SCIDATA.PADC_LU_CTR, rec_start = recstart cdf_varput, cdfid, 'PDHK_SPARE', SCIDATA.PDHK_SPARE, rec_start = recstart cdf_varput, cdfid, 'PADC0_AGND', SCIDATA.PADC0_AGND, rec_start = recstart cdf_varput, cdfid, 'PADC1_AGND', SCIDATA.PADC1_AGND, rec_start = recstart cdf_varput, cdfid, 'PRA_E0', SCIDATA.PRA_E0, rec_start = recstart cdf_varput, cdfid, 'PRA_E1', SCIDATA.PRA_E1, rec_start = recstart cdf_varput, cdfid, 'PTAC0_TSP', SCIDATA.PTAC0_TSP, rec_start = recstart cdf_varput, cdfid, 'PTAC2_TSP', SCIDATA.PTAC2_TSP, rec_start = recstart cdf_varput, cdfid, 'PSB0_TSP', SCIDATA.PSB0_TSP, rec_start = recstart cdf_varput, cdfid, 'PSB1_TSP', SCIDATA.PSB1_TSP, rec_start = recstart cdf_varput, cdfid, 'PTOF_HV0_TSP', SCIDATA.PTOF_HV0_TSP, rec_start = recstart cdf_varput, cdfid, 'PTOF_HV1_TSP', SCIDATA.PTOF_HV1_TSP, rec_start = recstart cdf_varput, cdfid, 'PS_C_0_TSP', SCIDATA.PS_C_0_TSP, rec_start = recstart cdf_varput, cdfid, 'PS_C_1_TSP', SCIDATA.PS_C_1_TSP, rec_start = recstart cdf_varput, cdfid, 'PLVC0_TSP', SCIDATA.PLVC0_TSP, rec_start = recstart cdf_varput, cdfid, 'PLVC1_TSP', SCIDATA.PLVC1_TSP, rec_start = recstart cdf_varput, cdfid, 'PADC0_VREF', SCIDATA.PADC0_VREF, rec_start = recstart cdf_varput, cdfid, 'PADC1_VREF', SCIDATA.PADC1_VREF, rec_start = recstart cdf_varput, cdfid, 'PSSD_STATUS', SCIDATA.PSSD_STATUS, rec_start = recstart cdf_varput, cdfid, 'PSSD_V_POS_ANALOG', SCIDATA.PSSD_V_POS_ANALOG, rec_start = recstart cdf_varput, cdfid, 'PSSD_V_NEG_ANALOG', SCIDATA.PSSD_V_NEG_ANALOG, rec_start = recstart cdf_varput, cdfid, 'PSSD_HV_BIAS', SCIDATA.PSSD_HV_BIAS, rec_start = recstart cdf_varput, cdfid, 'PSSD_TC0', SCIDATA.PSSD_TC0, rec_start = recstart cdf_varput, cdfid, 'PSSD_TC1', SCIDATA.PSSD_TC1, rec_start = recstart cdf_varput, cdfid, 'PSSD_TC2', SCIDATA.PSSD_TC2, rec_start = recstart cdf_varput, cdfid, 'PSSD_V_POS_DIG', SCIDATA.PSSD_V_POS_DIG, rec_start = recstart cdf_close, cdfid return end