Converting Analogue Video to FITS



Analogue video records that have been timestamped with a Video Time Inserter (VTI) such as IOTA-VTI can be converted to FITS. The user will need to provide some additional information in the process, such as the model of the video camera used in the recording. If Tangra is unable to automatically read the timestamps from the video, the user will also have to enter the timestamps of the first and last video frame manually. Astro-Analogue Video (AAV) files recorded with OccuRec or another software can also be converted to FITS. If the video is recorded in AVI format then it may first need to be converted to AAV format by Tangra, before converting it to FITS.

The steps for converting analogue video data into FITS format are outlined in the table below:

File Format Integration Step 1 Step 2
AVI No - Convert AVI to FITS
AVI Yes Convert AVI to AAV Convert AAV to FITS
AAV - - Convert AAV to FITS

Convert AVI to AAV

AVI records which are made with integrating video camera and using integration will first have to be converted to AAV format before they can be processed further. In this process Tangra will identify all repeated video frames which are part of the same integration interval and will stack them and save them as a single frame in the AAV file, while preseving the visual timestamps of the first and last video field in the process.

To convert an AVI file to AAV choose File -> Convert Video to AAV from the menu. The first step will be to define the location of the Video Time Inserter On-Screen Display (VTI-OSD) timestamp. During the convertion, similarly to OccuRec, Tangra will keep the selected VTI-OSD areas from the very first and the very last video field from each integration interval, while at the same time will stack the images from the integration interval. This will allow for the user to see and read the timestamps for the stacked frames which will not appear blurred.

Typically Tangra will be able to automatically detect the position of the VTI-OSD and will simply ask the user to confirm it (see Image 1 below). If it is unable to detect the VTI-OSD (for example with multi-line OSDs such as GPSBOXSPRITE), Tangra will show an error message and will ask the user to move the borders of the VTI-OSD area to the correct location (see Image 2 below). Clicking on the images below will enlarge them.

Image 1
Image 2
The green area can be dragged and also borders can be moved. If you need to manually select the VTI-OSD area make sure it is entirely inside the green area before continuing.

During the next step the user selects the range of the video that is to be converted to AAV. Typically this will be the entire video, but the conversion can be also limited to a smaller chunk if desired using the controls on Image 3 below.

Image 3

Next the user clicks the Detect Integration Rate button for Tangra to detect the integration rate. In most cases this will be successful. Tangra will display a plot with vertical green and red bars as the ones shown below. A green bar indicates a bigger change between the current frame and the previous one and is an indication of a potential boundary of an integration interval. Some times the pattern will be very clear as on Image 4 below, other times it will be with little uncertainly like Image 5 below and in rare cases it is possible to see two green lines next to each other or separated by one red bar appearing at each integration interval boundary - like the ones on Image 6 below.
Image 4
Image 5
Image 6
This last case shows a defect in the frame grabber where video fields have been combined incorrectly. In such a case use the Correct Interlaced Defects button and try vaious options until the patters on Image 6 becomes like that on Image 4.

In some cases, particulary with high gain and/or large amount of noise, Tangra may not be successful in determinging the integration rate. The pattern may look somethink like Image 7 below with no clear patern. In this case choose Reject and then manually specify the integration rate (Image 8 below) after you have stepped through the video in Tangra and confirmed the frame number of an integration rate boundary and the integration rate. If the used integration rate rate is x2 frames then it may need to be entered manually, too.

Image 7
Image 8
Once the integration interval has been confirgured, the last step is to confirm which is the smaller of the two fields (top or bottom one) and to also manually enter the used camera model and optionally the camera sensor (Image 9).
Image 9

Tangra will display the two video fields - one at the top and one at the bottom. The order of the fields can be determined either by the field number, when timestamped for example by IOTA-VTI, or by the timestamp itself. The first fields is either the one with the smaller number or the one with the smaller timestamp. The camera model can be picked up from a list which contains some of the more common models useds for astronomy or can be typed manually.

Once these settings have been confirmed press Convert. The very last thing you can do is to optionally speficy some headers to be saved in the AAV file. These include information about the observation and can also include up to 3 user specified headers (see Image 10). The observation headers will be copied later to the FITS files during the AAV-to-FITS conversion.
Image 10

Now wait for Tangra to complete the conversion of your video.

Convert AAV to FITS

Conversion of AAV file to FITS can be done with both natively recorded AAV files (e.g. by OccuRec) and AAV files generated by Tangra from AVI videos. The operation is triggered from the File -> Convert video to FITS menu item. At the time of the writing of this guide Tangra only supoports exporting to individual FITS images where each video frame is exported into its own FITS file. This is the reason why the FITS Cube option is currently disabled (see Image 11 below). Tangra may offer conversion to a single FITS Cube file in the future.
Image 11
Image 12
Tangra offers export of the entire video frame or export only of a Region of Interest (ROI) from the frame. To select a ROI for export select the Region of Interest radio button and then use the mouse to drag and resize the green area to define the ROI to be selected (see Image 12). In a typical conversion of occultation AAV video we would like to always export every frame, so make sure this setting is selected.

To continue with the conversion press the Convert button. Tangra will offer to automatically read the timestamp. This will only work for AAV version 2 videos and for supported video time inserters. Depending on the time inserter the user may have to also enter the date of the observation, when the date is not present in the VTI-OSD (for example for IOTA-VTI). In such a case Tangra will display the OCR-ed timestamp with the current date and will ask the user to set the actual UTC date of the observation (see Image 13).
Image 13
Image 14
Image 15
If Tangra is unable to read the timestamp automatically it will ask the user to enter manually the date and timestamp of the firist and last frame to be exported (see Image 14 and Image 15). The Show Fields/Show Frames buttons will toggle between split frame into two video fields and a full frame.

Once the timestamps have been set, Tangra is ready to begin the export. When exporting to a FITS sequence the user will be asked to select an output directory (see Image 16). New directory should be created by the user for each new export.
Image 16
Once the directory has been selected Tangra will go through all selected frames and will export them. A sample header from an exported FITS file is presented below:

Header Value Description
SIMPLE T C# FITS: 16/10/2018 10:23:02 PM
BITPIX -32  
NAXIS 2  
NAXIS1 720  
NAXIS2 576  
INSTDELY -1.084 Instr. delay in sec. for x64 frames integration
TELESCOP 12" LX-200 ACF Copied from AAV2 file headers
RA_OBJ   Copied from AAV2 file headers
OBSERVER Dave Gault Copied from AAV2 file headers
OBJECT Quaoar Copied from AAV2 file headers
LONGITUD   Copied from AAV2 file headers
LATITUDE   Copied from AAV2 file headers
DEC_OBJ   Copied from AAV2 file headers
REC-VER 3.6.17 Copied from AAV2 file headers
REC-SOFT Tangra Copied from AAV2 file headers
ADVLIB 2.0 Copied from AAV2 file headers
VIDEOFMT NTSC Native analogue video format
TANGRAVE Tangra v3.6.17 Tangra version
CAMERA WAT-910BD Video camera model (observer specified)
DATE-OBS 2018-08-26T15:03:21.670 Date and Time are user entered & computed
EXPOSURE 2.560 Exposure, seconds
NOTES No instrumental delay has been applied to DATE-OBS.  
FRAMENO 0  
EXTEND T Extensions are permitted
FILENAME 180726_Quaoar+.aav  
BSCALE 1  
BZERO 0  
INTGRRTE 64 Integration rate in video frames
Analogue video data will be exported as 32-bit floating point values in the range 0 to 255 ADU.

Convert AVI to FITS

Conversion of AVI file to FITS should be only done for videos recorded with no integration. If your video is recorded with integrating camera and using integration then first convert the AVI file to AAV.

To convert a non-integrated AVI file to FITS follow the same steps as per AAV-to-FITS conversion. The process is exactly the same with the only difference that some FITS headers will be missing from the exported FITS files. Sample AVI-to-FITS export FITS headers are listed below:

Header Value Description
SIMPLE T C# FITS: 19/10/2018 12:10:44 AM
BITPIX -32  
NAXIS 2  
NAXIS1 704  
NAXIS2 530  
BSCALE 1  
BZERO 0  
EXPOSURE 0.040 Exposure, seconds
EXTEND T Extensions are permitted
DATE-OBS 2017-03-25T20:59:56.596 Date and Time are ORC-ed
CAMERA   Video camera model (observer specified)
FILENAME 10636-25.03.17.avi  
FRAMENO 3  
NOTES Converted from AVI file.  
TANGRAVE Tangra v3.6.17 Tangra version