NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Data > Sdfits > OnlineSdfitsDesign
   Changes | Index | Contents | Search | Statistics | Jump to Topic

Online Sdfits Design



Introduction

Online Sdfits refers to the daemon, onlinesdfits responsible for filling all DCR, Spectral Processor, and Spectrometer data into Sdfits files. This filling happens at the end of each successfull scan.

GBTIDL

One of the main purposes of onlinesdfits is to provide the GBTIDL program access to current data, and provide the user with a quasi real-time display and data reduction environment. This is the reason why Index and Flag files are created. GBTIDL users cannot modify their FITS or Index files, but they can write to the Flag file, and thus are able to use all the flagging functionality in GBTIDL.

As GBTIDL evolves, the onlinesdfits filler will also have to adapt to meet GBTIDL's needs.

Architecture

Software

Overview

At the heart of the daemon onlinesdfits is a state engine that is capable of detecting scan transitions (when they begin and end), project transitions, and backends selected in the Scan Coordinator. When the end of a scan is detected, the sdfits program is called, via a system call, filling in the scan that just ended, as well as any scans that it may have missed while it was filling previous scans. A system call is used to avoid a memory leak in sdfits, which has since been fixed. This approach needs to be refactored to improve performance.

The state engine, communicating with M&C with Grail, provides the information needed to construct a command string for the sdfits program. This includes the current project, current scan, and backend used. The command used in the system call takes this form:

sdfits /home/gbtdata/project -backends=backend -scans=scan -append -debug /home/sdfits/project > /home/sdfits/sdfitsLog.txt

In addition to appending to an sdfits file to /home/sdfits, both an index file (for spectral line scans only) and a log file are updated at the end of each scan. When an sdfits file is first created, a symbolic link is created in /home/sdfits pointing to a blank GBTIDL flagging file created in /home/sdfits-flags. A lock file is also created and destroyed while the system call is blocking in /home/sdfits-locks. More on this below.

Classes

Products

The online filler produces a number of different files:

Sdfits files

A FITS file is produced for each backend used in a project:

To avoid the FITS files from being corrupted by an error with sdfits, backups are made before each new scan is filled. If the scan is not succesfully filled, the backup is copied back over to the original file. These backups all are labeled the same as above, except with the *.backup extension.

Index files

For spectral line data, that is, for the Spectrometer and Spectral Processor backends, GBTIDL compatible Index files are created and maintained along with the FITS file. These have the same form as the FITS files, except they have the *.index extension. GBTIDL can also produce Index files - these two pieces of code that must create identical products is something that must be managed carefully.

Flag Files

When a FITS file is first created by sdfits, it creates a link in /home/sdfits to an empty flag file, also created by sdfits in /home/sdfits-flags. This step is necessary so that GBTIDL users can modify the blank flag file (set a flag, for example), which they have permission to since it is in /home/sdfits-flags as opposed to /home/sdfits. Like the Index File, GBTIDL also contains code for producing flag files, and the maintanence of two pieces of code for producing the same product is troublesome.

Lock files

Before the system call to sdfits is made, a lock file is written to /home/sdfits-locks, of the form project.lock. This lock file is destroyed once the system call is done blocking. If onlinesdfits is ready to fill the latest scan, but there exists a project.lock file, it will wait until this lock file is removed before proceeding. There is a time-out period for this waiting, whereupon an excpetion will be raised and onlinesdfits will terminate.

This lock file can be used by any consumer of the FITS file in /home/sdfits, to know when the FITS file is in the process of being written to. The GBTIDL program formerly interacted with onlinesdfits through this lock file, but that practice has been terminated; the use of this lock file with onlinesdfits remains, however.

Log Files

Trouble Shooting

When you get a call in the middle of the night saying that gbtidl online isn't working or there's a problem with the online filler, how, generally, do you attack the problem? This hasn't happended in a long time, so I'm a bit rusty, but here's a quick brain dump:

-- PaulMarganian - 13 Apr 2006

Topic OnlineSdfitsDesign . { Edit | Attach | Ref-By | Printable | Diffs | r1.4 | > | r1.3 | > | r1.2 | More }
Revision r1.4 - 28 Apr 2008 - 20:36 GMT - AmyShelton
Parents: Sdfits
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.