Hi,
I have written some python code to convert a file of JD and magnitudes to BJD but I am not sure how to include the relativistic correction.
Since I have used coord.SkyCoord I think the relativistic correction should be included. I certainly seems to be very close to the OHIO university BJD which includes relativity effects.
from astropy import time, coordinates as coord, units as u
latitude = 50.725037
longitude = -0.792017
elv = 5
loc = coord.EarthLocation(lat = latitude*u.deg, lon = longitude*u.deg, height=elv*u.m)
V470Cam = coord.SkyCoord("07:10:42.07", "+66:55:43.6", unit=(u.hourangle, u.deg), frame='icrs')
f = open("C:/users/user/desktop/temp/save/V0470CAMVs.txt")
g = open("C:/users/user/desktop/temp/save/V0470CAMBJDVs.txt","w")
opf = f.readline()
ctr = 0
while opf:
print("_______________")
ctr = ctr + 1
print (str(ctr))
print(opf[0:14])
tx = float(opf[0:14])
print(str(tx))
times = time.Time([tx] , format='jd', scale='utc', location=loc)
ltt_bary = times.light_travel_time(V470Cam)
print(repr(ltt_bary))
ty = times.tdb + ltt_bary
print(str(ltt_bary))
ops = str(ty)
ops = ops.replace("[","")
ops = ops.replace("]","")
jlen = len(ops)
print(str(jlen))
g.write(ops)
for i in range (0 , (16-jlen)):
g.write("0")
print(ops)
g.write(" " + opf[15:22] )
g.write("\n")
opf = f.readline()
f.close()
g.close()
Thanks for any assistance.
John