def mjd2et(mjd, tt2tdb): """ Convert from mjd utc to et using tempo2 out put tt2tdb """ mjdJ2000 = mp.mpf("51544.5") secDay = mp.mpf("86400.0") mjdTT = tc.mjd2tdt(mp.mpf(mjd)) # Convert mjdutc to mjdtdt using HP time convert lib # print "python ",mjdTT et = (mp.mpf(mjdTT) - mjdJ2000) * mp.mpf(86400.0) + mp.mpf(tt2tdb) return et
def mjd2et(mjd,tt2tdb): """ Convert from mjd utc to et using tempo2 out put tt2tdb """ mjdJ2000 = mp.mpf("51544.5") secDay = mp.mpf("86400.0") mjdTT = tc.mjd2tdt(mp.mpf(mjd)) # Convert mjdutc to mjdtdt using HP time convert lib # print "python ",mjdTT et = (mp.mpf(mjdTT)-mjdJ2000)*mp.mpf(86400.0)+mp.mpf(tt2tdb) return et
l = l.strip("\n") l = l.split() # Avoid the column that is not data try: m = float(l[0]) except: pass else: tt2tdb.append(l[-1]) earth1.append(l[0]) earth2.append(l[1]) earth3.append(l[2]) #### Testing toa mjd to tt tt = [] for i in range(len(toa)): tt.append(tc.mjd2tdt(mp.mpf(toa[i]))) # Testing Convert toa mjd to toa et et = [] for i in range(len(toa)): et.append(mjd2et(toa[i], tt2tdb[i])) ###### calculate earth position stateInterp = [] # interpolated earth position in (km) ltInterp = [] # interpolated earth to ssb light time in (sec) statespk = [] # Directlt calculated earth position in (km) ltspk = [] # Directly calculated earth to ssb lt time in (sec) # Calculating postion for time in et: state0, lt0, = spkInterp(float(time), 7) stateInterp.append(state0)
l = l.strip("\n") l = l.split() # Avoid the column that is not data try: m = float(l[0]) except: pass else: tt2tdb.append(l[-1]) earth1.append(l[0]) earth2.append(l[1]) earth3.append(l[2]) #### Testing toa mjd to tt tt = [] for i in range(len(toa)): tt.append(tc.mjd2tdt(mp.mpf(toa[i]))) # Testing Convert toa mjd to toa et et = [] for i in range(len(toa)): et.append(mjd2et(toa[i],tt2tdb[i])) ###### calculate earth position stateInterp = [] # interpolated earth position in (km) ltInterp = [] # interpolated earth to ssb light time in (sec) statespk = [] # Directlt calculated earth position in (km) ltspk = [] # Directly calculated earth to ssb lt time in (sec) # Calculating postion for time in et: state0,lt0, = spkInterp(float(time),7) stateInterp.append(state0)