areaDetector / ADAravis

areaDetector driver for GenICam cameras using the Aravis library on Linux.
https://areadetector.github.io/master/ADAravis/ADAravis.html
6 stars 8 forks source link

Incorrect dataTimeStamp #17

Open till-s opened 1 year ago

till-s commented 1 year ago

In ntndArrayConverter::fromDataTimeStamp() we find

// pvAccess uses Posix time, NDArray uses EPICS time, need to convert seconds += POSIX_TIME_AT_EPICS_EPOCH;

however, ADAravis passes the timestamp from the camera unmodified. Since there are probably not many cameras out there using timestamps based on the EPICS epoch this is guaranteed to be wrong. I would therefore suggest to let ADAravis convert the camera timestamp into an EPICS timestamp (by subtracting POSIX_TIME_AT_EPICS_EPOCH).

A bigger problem, unfortunately, is that GigE-Vision 2.0 cameras actually support PTP timestamps which use TAI; therefore, ADAravis should (at least optionally, if the camera supports PTP) convert TAI -> EPICS Time. The problem is that I know of no portable, efficient and automatic way to do that (while using a hack such as a global parameter that holds the 'current' offset and ignoring the fact that during a leap-second there my be inconsistent time stamps is easy).

Note that ADSpinnaker and ADVimba are also affected (I have seen that both vendors advertise GigE cameras with PTP support).