PRO IMPACT203_TO_CDF, SCIDATA, DATESTRING, SCID ;+ ; Project : STEREO - IMPACT ; ; Name : IMPACT203_TO_CDF ; ; Purpose : Write IMPACT 203 data to CDF ; ; Category : STEREO, IMPACT ; ; Explanation : ; ; Syntax : IMPACT203_TO_CDF, SCIDATA, DATESTRING, SCID ; ; Examples : ; ; Inputs : SCIDATA - a structure including IMPACT 203 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, 25-Feb-2008, Peter Schroeder, ; UC-Berkeley. ; ; Contact : peters@ssl.berkeley.edu ;- ; if (SCID eq 'EA'XU) then begin SOURCE_FILE = 'impact203a.cdf' SCSTRING = 'STA' endif else begin SOURCE_FILE = 'impact203b.cdf' SCSTRING = 'STB' endelse filename = SCSTRING+'_L1_IMPACT_BURST_'+DATESTRING+'_V01.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 for i=0,31 do begin utcsec = utc2sec(SCIDATA.TIME) utcpkttim = sec2utc(utcsec + 2d * double(i)) utc = anytim2utc(utcpkttim,/external) cdf_epoch, pktepoch, utc.year, utc.month, utc.day, utc.hour, utc.minute, $ utc.second, utc.millisecond,/compute_epoch if n_elements(pktepochs) eq 0 then $ pktepochs = [pktepoch] else $ pktepochs = [pktepochs, pktepoch] endfor cdf_varput, cdfid, 'Epoch', pktepochs, rec_start = recstart cdf_varput, cdfid, 'BurstTableID', replicate(SCIDATA.IMPACTMODEIDS.BURSTTABLEID,32), rec_start = recstart cdf_varput, cdfid, 'SWEAModeID', replicate(SCIDATA.IMPACTMODEIDS.SWEAMODEID,32), rec_start = recstart cdf_varput, cdfid, 'STEModeID', replicate(SCIDATA.IMPACTMODEIDS.STEMODEID,32), rec_start = recstart cdf_varput, cdfid, 'SWEARate', SCIDATA.IMPACTBURSTDATA.SWEARATE, rec_start = recstart cdf_varput, cdfid, 'STERate', SCIDATA.IMPACTBURSTDATA.STERATE, rec_start = recstart cdf_varput, cdfid, 'MAGDelB', SCIDATA.IMPACTBURSTDATA.MAGDELB, rec_start = recstart cdf_varput, cdfid, 'PLASTICDelV', SCIDATA.IMPACTBURSTDATA.PLASTICDELV, rec_start = recstart cdf_varput, cdfid, 'SWAVESNTDS', SCIDATA.IMPACTBURSTDATA.SWAVESNTDS, rec_start = recstart cdf_varput, cdfid, 'SWAVESPlasma', SCIDATA.IMPACTBURSTDATA.SWAVESPLASMA, rec_start = recstart cdf_varput, cdfid, 'SWAVESHFR1', SCIDATA.IMPACTBURSTDATA.SWAVESHFR1, rec_start = recstart cdf_varput, cdfid, 'SWAVESHFR2', SCIDATA.IMPACTBURSTDATA.SWAVESHFR2, rec_start = recstart cdf_close, cdfid return end