Fits header of the first image of an image capture sequence often missing the same set of keywords

A place to report problems and bugs in SharpCap
Forum rules


If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs

Please also read about Troubleshooting USB Issues before posting.

*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***

Please include the following details in any bug report:

* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
Post Reply
cveillet
Posts: 8
Joined: Tue Jul 25, 2023 11:50 pm

Fits header of the first image of an image capture sequence often missing the same set of keywords

#1

Post by cveillet »

I am using SharpCap to take series of 2000 short 64x64 pixels fits images (most of the time 1ms exp time) for turbulence monitoring.

I was observing last night for the first time in a relatively intense way using the sequencer and launching a processing every 10 series (or 10,000 images), processing the data, and starting again...

Of the 2599 sequences of 2000 images (I know, it is a lot of images..), 1302 had their 1st image missing 14 keywords (always the same), including 41 also having the issue on the 2nd image too, and 2 also having the issue with the 3rd one. Beyond that, all images have their standard header

Here is a snippet of the headers of the first two images of a sequence showing what is missing in image, with the missing keywords highlighted in yellow and keeping the header keywords in their original order.
Screenshot 2023-10-23 171923.png
Screenshot 2023-10-23 171923.png (94.12 KiB) Viewed 5138 times
It is a bif of a bummer because I am assuming that all the images have the same header when I process the sequences. I can certainly implement a work around, but I thought I should let you know about the issue anyway...

A typical sequence of data grabbing looks like this:

Code: Select all

    LOOP 10 TIMES
        LOOP 10 TIMES
            CAPTURE 2000 LIVE FRAMES
        END LOOP
        PROMPT "Press OK is centering good enough!" ENABLECONTROLS False
    END LOOP
(skipping what it is happening outside of the data-taking loop)

Cheers from Mt Graham...
User avatar
admin
Site Admin
Posts: 13360
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Fits header of the first image of an image capture sequence often missing the same set of keywords

#2

Post by admin »

Hi,

this is a tricky one...

That data gets attached to the frame data shortly after the frame is captured. For performance reasons, SharpCap avoids doing that when the camera exposure is less than 100ms and the camera is not capturing (in those circumstances, why add the data as it isn't going to be used later).

When you start capturing, there are various tasks that SharpCap needs to do , and it's not until the 'set the flag that says we are capturing' job gets done that SharpCap will start adding that data to the frames as they are captured. It's quite possible that the first frame that gets saved got past the point of having the data added before the flag got set, so will have the data missing. At high frame rates there may be more than one.

I wasn't expect anyone to ever notice this, as you only see the data in FITS files and who would capture high frame rates in FITS? Ah well, I was wrong.

I'm reluctant to change the ordering of things in the start capture process, as I have broken things by making that sort of change in the past. I will have to think about whether the overhead of adding the data for all frames is acceptable.

cheers,

Robin
cveillet
Posts: 8
Joined: Tue Jul 25, 2023 11:50 pm

Re: Fits header of the first image of an image capture sequence often missing the same set of keywords

#3

Post by cveillet »

Hey Robin,

I found an easy work-around which was not too complicated to implement on the processing side. Instead of using the first frame to grab the header info, I now use the third one, which has not failed once yet (in spite of the huge number of sequences taken so far!) I don't think I will ever use a capture of a sequence of only one or two 1ms images!

I wrote my message mostly to let you know... It is indeed tricky to take care of a lot of things in a very short time at the beginning of a capture, and the header is definitely not the highest priority, especially when there are plenty of images coming to grab it from!

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

Re: Fits header of the first image of an image capture sequence often missing the same set of keywords

#4

Post by admin »

Hi Christian,

that's good to hear - you could also just use the last frame of the sequence too.

I'm probably going to leave this one - when I looked at the code that would need to be changed there were already comments along the lines of 'A needs to be done before B or XYZ will break', so I am keen to leave things as they are!

cheers,

Robin
Post Reply