2 Attachment(s)
UserActions ImageEnd() function for converting JD-->HJD
Here's a javascript code block you can put into the ImageEnd() function of UserActions.wsc that will add two additional keywords and values to the FITS header of each image: the geocentric JD of the midpoint of the exposure, and the heliocentric JD (with respect to UTC) of the midpoint of the exposure. This does not compute the barycentric JD.
I've used this algorithm for many years outside of ACP. The computation has an accuracy of a few seconds or better, given the RA and DEC of the target and the UTC date/time of the start of the exposure.
For the moment, I have misplaced the original reference for the algorithm - possibly one of Meeus' algorithm books, or Arne Henden's Astronomical Photometry book. I'll provide the reference if I find it. In the meantime, there's some information on Wikipedia:
https://en.wikipedia.org/wiki/Heliocentric_Julian_Day
I will also rewrite and repost this code in VBS so it can be used with the VBS version of UserActions.wsc.
EDIT: Here are both versions - one for either the JS or the VBS version of UserActions.wsc.