pro unh_timing ;Created: Mark Chutter, UNH ;Sep. 13, 2013 ; ;Modified: ;Oct. 01, 2013 MWC changed tt2000_offset to long64 to maintain ; precision ;Nov. 12, 2013 MWC updated DSP digital delays from Ivan ;Nov. 26, 2013 MWC changed routine name ;Sep. 3, 2014 MWC cleaned up AFG and DFG delay code ;Oct. 23, 2014 MWC new delays from Werner ;Nov. 18, 2014 MWC update for Dec64 from Werner ;Mar. 27, 2015 MWC DAH!!! to avoid repeating a mistake, changing ; name of delay_dsp to dsp_correction ;Sep. 28, 2015 MWC updated DFG timing for DEC 64 ; ;Description: ;This file defines the offset from TAI 0 to TT2000 and includes ;known most digital and analog delays common tt2000_offset, tt2000_offset common delay_afg, delay_afg_128, delay_afg_32, delay_afg_16, delay_afg_8 common delay_dfg, delay_dfg_rate common dsp_correction, dsp_correction common hsb_correction, hsb_correction common delay_edi, delay_edi ;IDL> print, cdf_parse_tt2000('01-Jan-1958 00:00:00.000') ; -1325419167816000000 ;IDL> print, cdf_parse_tt2000('01-Jan-2000 11:58:55.816') ; 0 ;TT = TAI + 32.184 seconds - already taken into account tt2000_offset = $;in nanoseconds cdf_parse_tt2000('01-Jan-1958 00:00:00.000') ;IWF supplied delay for each AFG sample rate, each OBS in seconds ;subtracting gives sample center time delay_afg_128 = [0.01196, 0.01157, 0.01009, 0.01166] delay_afg_32 = [0.19946, 0.19907, 0.19759, 0.19916] delay_afg_16 = [0.44946, 0.44907, 0.44759, 0.44916] delay_afg_8 = [0.94946, 0.94907, 0.94759, 0.94916] ;IWF supplied delay for each DFG sample rate in seconds ;[128/s, 32/s, 16/s, 8/s] for DEC 32, DEC64 is additional 7.81 ms ;subtracting gives sample center time delay_dfg_rate = [0.00834, 0.19584, 0.44584, 0.94584] ;Add the CDPU's 24 microseconds to DSP values. ;from 108328revE_MMS_DSP_CEB_ICD.pdf ;DSP frequency dependent filter delays for 16kss channels ;"The delay must be subtracted from the packet time-stamp" dsp_correction = dblarr(15) dsp_correction[0] = -0.000183d dsp_correction[1] = -0.000611d dsp_correction[2] = -0.001527d dsp_correction[3] = -0.003358d dsp_correction[4] = -0.00702d dsp_correction[5] = -0.01435d dsp_correction[6] = -0.02900d ;256 samples/s dsp_correction[7] = -0.05833d ;128 samples/s dsp_correction[8] = -0.1169d dsp_correction[9] = -0.2341d dsp_correction[10] = -0.4689d dsp_correction[11] = -0.9376d dsp_correction[12] = -1.877d dsp_correction[13] = -3.748d dsp_correction[14] = -7.495d ;filter delay + PPS delay + sample/hold delay + analog dsp_correction = dsp_correction + 0.0000237d - 0.0000033d - 0.0000606d ;DSP frequency dependent filter delays for 256kss channels hsb_correction = dblarr(6) hsb_correction[0] = -0.00001144d hsb_correction[1] = -0.00003814d hsb_correction[2] = -0.00009537d ;65536 samples/s hsb_correction[3] = -0.0002060d hsb_correction[4] = -0.0004272d hsb_correction[5] = -0.0009308d ;filter delay + PPS delay + sample/hold delay; no analog for HSB hsb_correction = hsb_correction + 0.0000237d - 0.0000033d delay_edi = 0.0000237d end