TCS3 Position Logs - Programmer's Notes

Intro

This page explains how the tcs3 position logs works. So if something break, review this page so you can fix it.

Generating Data

The data is generated by the tcs3 main application's pfileio process. Every 5 minutes it appends a line to a YYMM/YYMMDD.log file in this directory.

Main Index

The main index page is produced by the make_yymm_index.tcl script. A cron job on irtfweb runs this script twice a day. Once right after midnight (when tcs3 will created the new directory ./YYMM/ ), an once at 7am (just in case the midnight one didn't work). This produces the ./index.html file

Daily Graphs

The graph.cshscript call make_graphs.tcl script produces the .html & graphs files for each .log file. The graph.csh looks for subdirectories, cd into them and calls make_graphs.tcl. The make_graphs.tcl can take a single argument (.log file) or no arguments. If a single argument is given, creates the .html for given .log file. If no arguments are given, it checks all .log files and generates the .html if it doesn't exist or if the .log file is older.

A cron job on the irtfweb runs graph.csh every hour (no arguments). So at most, the data on the web site should be at most 1 hour behind.

The make_graphs.tcl uses gnuplot to create the graphs. The commands to produce the .png graphs are given a .gp extension.

The tcs3 crontabs on IRTFweb should look like this

# twice daily: 12:01am  & 7am
1 0 * * * cd /home/tcs3/public_html/tcs3/Position_logs; ./make_yymm_index.tcl
1 7 * * * cd /home/tcs3/public_html/tcs3/Position_logs; ./make_yymm_index.tcl
# hourly (10 after every hour).
10 * * * * cd /home/tcs3/public_html/tcs3/Position_logs; ./graph.csh

Need more details...

Review the source code located in this directory.