Logging of data

hlogger is a python3 script which produces an html log of HiPERCAM observations that can be displayed in a web browser.

The hlogger script runs in real time on the DRPC. The script uses the FileServer to poll the directory containing the raw HiPERCAM data (usually /data on the rack PC) and extract information from the fits headers. Comments on each run are input using a comments file, an example of which can be found here. The first column must contain the run number, followed by a string of arbitrary length containing the run comments. Any keyboard character or html symbols/tags can be used, e.g. &lt; &gt; <b> <em>.

To run hlogger whilst observing on 2018_11_01, for example:

  • Open an xterm on the DRPC and type cd hlogger

  • Create the comments file for the night by copying a previous one, e.g. cp 2018_10_31_log.dat 2018_11_01_log.dat

  • Edit the comments file using your favourite editor, e.g. emacs 2018_11_01_log.dat & and add your comments.

  • Open a web browser, e.g. firefox &

  • Start hlogger by typing python3 hlogger_server.py GTC (or WHT, if observing there).

  • Once the script has polled the data directory once, open the resulting html file 2018_11_01_log.html in the web browser.

The script will run indefinitely, polling the data directory a few times times every minute and looking for changes in the data files or comments file. If it finds a change, it will update the html file.

The html file produced by hlogger auto-reloads in the browser every 10 seconds, thereby automatically displaying any changes that are made to the file. If this doesn’t work, try clicking the Auto-refresh button at the top of the page off and then on again, and also click the reload button of the web browser.

You can hide columns by clicking on the buttons at the top of each column, and restore any columns you have hidden by clicking the reload button of the web browser.

Many columns are hidden by default, and they can be revealed by clicking on the Restore columns button at the top of the page. To revert to the default column view, click the reload button of the web browser.

Sometimes, when you are inspecting the observing log and have carefully selected the most important columns, it can be annoying when the page auto-refreshes, as it reverts to the default column view. To prevent this from happening, disable the auto-refresh function by clicking on its button at the top of the page.

hlogger will definitely not work in two instances. First, if there are no run files in the /data directory. Second, if the FileServer, which is usually started by start_hicam, is not running. If you wish to run the file server without starting up the observing system (see Software startup), open an xterm on the rack PC and type: fileserver --dir /insroot/insuser/SYSTEM/DETDATA/.

To exit hlogger, just type crtl-c when it says it is safe to do so, as otherwise there is a risk the html log file may be truncated.

To view the observing log from a previous night, open a web browser on the DRPC and load the html log file, all of which are stored in /home/observer/hlogger.

To view the command-line options for hlogger, type:

> python3 hlogger_server.py -h
usage: hlogger_server.py [-h] [-d DIR] [-t TWAIT] [-p PATH] [-n NS] {WHT,GTC}

positional arguments:
  {WHT,GTC}             telescope on which HiPERCAM is mounted

optional arguments:
  -h, --help            show this help message and exit
  -d DIR, --dir DIR     sub-directory of /data, e.g. 2017_10_17
  -t TWAIT, --twait TWAIT
                        time to wait in secs between directory polls
  -p PATH, --path PATH  path to directory containing hand-written log and html
                        files
  -n NS, --nightstart NS
                        enter night start date if first run taken after
                        midnight, e.g. 2017_10_16

It is recommended that you open all of the hlogger windows in the upper-right virtual desktop of the DRPC. A screenshot of what the desktop should look like is shown below.

_images/hlogger_screenshot.png