You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Awesome package, thanks for all of your work! I am slowly migrating some routines in Python over to Julia and was wondering if there was already a way to convert between HJD <-> BJD, similarly to the astropy snippet I found here? https://gist.github.com/StuartLittlefair/4ab7bb8cf21862e250be8cb25f72bb7a
fromastropy.coordinatesimportSkyCoord, EarthLocationfromastropyimportunitsasufromastropy.timeimportTimedefhelio_to_bary(coords, hjd, obs_name):
helio=Time(hjd, scale='utc', format='jd')
obs=EarthLocation.of_site(obs_name)
star=SkyCoord(coords, unit=(u.hour, u.deg))
ltt=helio.light_travel_time(star, 'heliocentric', location=obs)
guess=helio-ltt# if we assume guess is correct - how far is heliocentric time away from true value?delta= (guess+guess.light_travel_time(star, 'heliocentric', obs)).jd-helio.jd# apply this correctionguess-=delta*u.dltt=guess.light_travel_time(star, 'barycentric', obs)
returnguess.tdb+lttdefbary_to_helio(coords, bjd, obs_name):
bary=Time(bjd, scale='tdb', format='jd')
obs=EarthLocation.of_site(obs_name)
star=SkyCoord(coords, unit=(u.hour, u.deg))
ltt=bary.light_travel_time(star, 'barycentric', location=obs)
guess=bary-lttdelta= (guess+guess.light_travel_time(star, 'barycentric', obs)).jd-bary.jdguess-=delta*u.dltt=guess.light_travel_time(star, 'heliocentric', obs)
returnguess.utc+ltt
which for example would return something like this:
Hi,
Awesome package, thanks for all of your work! I am slowly migrating some routines in Python over to Julia and was wondering if there was already a way to convert between HJD <-> BJD, similarly to the astropy snippet I found here? https://gist.github.com/StuartLittlefair/4ab7bb8cf21862e250be8cb25f72bb7a
which for example would return something like this:
Sorry if this is the wrong place to ask this!
The text was updated successfully, but these errors were encountered: