VIF2staging
"VIF2staging" is the first step of the process that creates the staging database. It is a perl script that extracts sample collection event information from video annotation files, merges them with navigation, frame-grabs, and other data, and creates a staging database. VIF2staging is designed to work on board the R/V Point Lobos (on either machine lobos or seaspray) after a dive has been completed, the VICKI annotation process finished, and a VIF file created. It has also been adjusted to work on shore on the video lab computer calypso after post-dive re-annotation.
User instructions for creating staging database:
» VIF2staging may be run on lobos or seaspray. This step occurs as part of the shipboard
process. The staging database HTML file automatically will be written to host ariel.
Log in as user 'vicki' and type:
VIF2staging <filename>
where <filename> is the name of the VIF file (eg., 1998023PV1.vif).
» VIF2staging may be run on host calypso as user 'vicki' by typing:
VIF2staging <filename>
where <filename> is the name of the VIF file (eg., 1998023PV1.vif).
The microwave connection to the ship must be good because the HTML files get written to host ariel. The VIF file must be in the same directory from which the command is typed.
» VIF2staging also may be run on calypso and the HTML file written on shore. This is recommended for post-dive processing so that the ship is not involved. In this example, the HTML file is written to the Sample Coordinator's internal web site (requires login as user 'paje') by typing:
/u/vicki/bin/VIF2staging <filename> /u/paje/mbari_html/stage/
Find the HTML file at http://mww.mbari.org/~paje/stage/.
VIF2staging process description
VIF2staging expects to see the VIF file in the current directory. It then parses the VIF
file, looking for ANNOTATION blocks that contain a "sampled-by" property. For
each sample, the following information is extracted from the VIF file:
| Concept of object that is sampled, e.g. mud (becomes CollectionVIMSConcept in database) | |
| Sampling equipment (becomes Equipment in database) | |
| Identity reference number (becomes CollectionRefName in database) | |
| Tape timecode, eg., video frame number (becomes TapeTimeCode in database) | |
| Interpreter name | |
| Time-unix |
The time/tape-timecode lookup file ('YYYYDDDvideologr.dat' files created by the pllogger application) is read and for each tape timecode extracted from the VIF file a binary search is done to find the corresponding UTC time. This file is first looked for on calypso in the /users/pllogger/data directory, if not found there then it searches /hosts/barnacle/ARCHIVE/pllogger. It will accept this file either uncompressed or compressed. VIF2staging will fail to interpolate the time properly if timecodes are out of order (e.g., if tapes rewind).
The ship navigation file is read, and for each UTC time found in the previous step the ROV latitude, longitude, and depth is extracted. For each of these lookups, a check is made for temporal proximity. If any of the results are more than 10 minutes away from the sample time then a warning is indicated in the staging database web page. Depth was the variable reported and archived before January 1998, but pressure is reported subsequently. For dives after January 1998, pressure is converted to depth by the routine "sub calcDepth", which is presented in the appendix.
Finally, all of the relevant information (database table field/value pairs) that needs to be loaded into the Samples Database is compiled into an HTML form, the staging database, viewable inside a web browser by anyone on our Intranet. The action for the form is an Active Server Page (loadcoll.asp) that loads the data into the production Samples Database; it is restricted to the Sample Coordinator.
VIF2staging structure
The following diagram shows the calling hierarchy of the subroutines within the
VIF2staging perl script:

Routines are called left-to-right and top down. Basically, the command line is processed, lookup files are read, annotation blocks are parsed with sample strings constructed for each sample, and finally the HTML file is written.
![]()
»Next: loadcoll.asp
Last updated: 10 February, 2005 by Jenny Paduan
Copyright © 1998 MBARI