saved fits file timestamps date-obs and date-end

rm80
Posts: 5
Joined: Tue Nov 04, 2025 2:05 pm

saved fits file timestamps date-obs and date-end

#1

Post by rm80 »

Hi,

I am using Sharpcap 4.0.9571.0 and QHY 600 camera for asteroid and variable star observations.
I have noticed that the time recorded in the saved fits file in the corresponding fields is not as described in the associated comments, if you look at when the fits file is created it is correct, however it seems to save in that file the previous image from the buffer, so the actual time of DATE-OBS field is the end of exposure of the image and date-end is offset of course by the exposure time but in the current case it is meaningless.
Also, when setting a new exposure time there is a delay when the seconds counter actually turns negative, the image being returned corresponding to the previous frame coming from the buffer and not the last frame, this is easily seen as one moves the telescope, there is a one frame delay until the effect is visible on live capture.
Is this behavior normal? I am asking because due to the way most of the processing software are build, they take date-obs and date-end fields of an image fits as the beginning and the end of exposure, respectively and this leads to large errors in measurements, particularly regarding asteroids observations, so I am forced to adjust manually these fields or if the software settings allow it to specify which field exactly represents what point in time (usually they don't).
Is there a way to properly record the time in the fits header of the saved files?
User avatar
admin
Site Admin
Posts: 17597
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: saved fits file timestamps date-obs and date-end

#2

Post by admin »

Hi,

the first thing to suggest is to update to SharpCap 4.1 - lots of changes have happened and lots of bugs have been fixed since the SharpCap 4.0 version that you are using. We are not updating or bugfixing in SharpCap 4.0 any more.

The frame time counter going negative is normal in certain circumstances - it indicates that an expected frame from the camer is overdue. There are a few reasons why this can happen :

* The delay due to the frame data needing to be transferred to the PC after the exposure - this is usually a fraction of a second except for high resolution cameras on USB2

* The camera not starting the new frame when SharpCap thought it would - this could be what is happening when you are changing exposure

* A frame being lost somehow by the camera, in transfer to the PC or otherwise - in this case you may see the counter go negative by up to the exposure time, although SharpCap may give up waiting after about 10s and try to get the camera to start another new frame.

On the timestamps, the expected behaviour with a non-GPS camera is :

* DATE-END is set to the time point that SharpCap received the frame from the camera SDK - this will be later than the exposure end due to transfer time over USB and any processing time in the SDK.
* DATE-OBS is set to DATE-END less the exposure duration that has been set.

Unfortunately, without an external time source in view of the camera, there is no way to know how much of a delay is introduced by the USB transfer and other factors between the exposure ending and the frame data being delivered to SharpCap.

cheers,

Robin
rm80
Posts: 5
Joined: Tue Nov 04, 2025 2:05 pm

Re: saved fits file timestamps date-obs and date-end

#3

Post by rm80 »

Hi,
Thank you for your answer.
I will try the latest 4.1 with the latest SDK, the previous time I tried, it did not work so well.
Fortunately, I can adapt the software that I use to treat DATE-OBS as end-of-exposure, which in my case at least seems to be very precise.
rm80
Posts: 5
Joined: Tue Nov 04, 2025 2:05 pm

Re: saved fits file timestamps date-obs and date-end

#4

Post by rm80 »

I am coming back with an update.
I upgraded to version 4.1.13901.0 and with the QHY600 camera it's still the same issue, the DATE-OBS field records the end of exposure.
This is against the FITS standard interpretation for DATE-OBS and the comments section as the beginning of exposure and produces a lot of difficulty and frustration when using different reduction software, often requiring manual intervention to adjust the fits header value of DATE-OBS to a value of DATE-OBS minus EXPTIME field value. Please investigate and remediate this issue!
User avatar
admin
Site Admin
Posts: 17597
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: saved fits file timestamps date-obs and date-end

#5

Post by admin »

Hi,

can you share the exact FITS header line you are getting for DATE-OBS please (including the comment). The current version of the code will write the start time into DATE-OBS (either direct start time or estimated from time frame received minus exptime). The one exception is if for some reason the camera does not report an exposure length, but this is only likely to happen with some very cheap webcams, and in this case the comment is 'System Clock: Frame Received'.

Note that it is possible that there is a buffering of frames going on somewhere out of SharpCap's view (in the manufacturers camera control software). If that is happening, it could be that the frame SharpCap receives at a given instant isn't the one just taken but the one before that (or even more than one before that), with all frames being delayed as they work through the buffer queue. The details of this vary from manufacturer to manufacturer and model to model of camera. There is no real control over this typically, but this can usually be avoided by putting the camera into still mode. For QHY cameras there is a 'force still mode' control, otherwise put the whole of SharpCap into still mode instead of video mode.

cheers,

Robin
rm80
Posts: 5
Joined: Tue Nov 04, 2025 2:05 pm

Re: saved fits file timestamps date-obs and date-end

#6

Post by rm80 »

it looks like it is from the buffering, I will try to work with it in still mode and check the results.
User avatar
admin
Site Admin
Posts: 17597
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: saved fits file timestamps date-obs and date-end

#7

Post by admin »

Hi,

OK, good to know that we understand the source of this.

I realised that there is an (undocumented) API function 'SetQHYCCDBufferNumber' that might just help here, perhaps by setting the number to one or zero. Unfortunately there's no equivalent way to get the existing number of buffers, so we can't tell what the default is. The only references I have found to this online seem to suggest that increasing it improves frame rate on some systems. I will have a play with this to see if it has any effect with any cameras I have here.

cheers,

Robin
User avatar
admin
Site Admin
Posts: 17597
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: saved fits file timestamps date-obs and date-end

#8

Post by admin »

Hi,

just checked and the SetQHYCCDBufferNumber has no effect on the 1 frame delay (tested with a QHY294C-PRO).

You should be OK with setting 'Force Still Mode' to 'on', although on some cameras that changes the resolution by a few pixels in each direction. Alternatively try setting the DDR Buffer to off - for me that removed the 1 frame delay, but that might not work (or even be available) on all models.

cheers,

Robin
rm80
Posts: 5
Joined: Tue Nov 04, 2025 2:05 pm

Re: saved fits file timestamps date-obs and date-end

#9

Post by rm80 »

Hello,
I tried with still mode and it records correctly the timestamp for DATE-OBS. However, I have different full-frame resolution on still mode than on live view mode (9576x6388 on still mode vs 9600x6422) which introduces another complication related to acquiring another separate set of calibration frames. I don't know why the resolution between these different working modes is not the same...
Jean-Francois
Posts: 858
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: saved fits file timestamps date-obs and date-end

#10

Post by Jean-Francois »

Hello,

Yes ... annoying. Look here viewtopic.php?t=9219
You can find older messages concerning the same topic.

I would prefer a setting for pre/over scan of the detector for all capture mode.

By looking at the hot pixel, you can find the start pixel of the small area and then use a ROI on the larger images.

Jean-Francois
Post Reply