Elixir Postrun Systems
The Elixir postrun system manages the end-of-run processing of the calibration and science data. The Elixir postrun system consists of a series of processing stages:

imstats process the unprocessed entries in the imstats database
mkdetrend run the mkdetrend system to generate the detrend data
mkfringe run the mkfringe system to generate the fringe data
ptolemy run the science images through the ptolemy system
standards process the standard stars and generate zero-point information
validate perform the image validation stages

These stages must be performed in sequence, and the postrun system automatically enforces the sequencing. At the beginning of a run, each of these stages are in the state 'init'. At any stage, the postrun system will attempt to identify the state of each of the processing stages, and run the first which is in the init state. While stages are running, elixir.postrun will set their state to 'running', and as the stages finish, they are set to the value 'done'. If any stages fail, they will be set to the 'fail' state, and the postrun system will not proceed until the error is cleared.

In fact, the description above is an ideal, but in practice, the elixir.postrun script does not quite follow these rules. For example, elixir.postrun will not run the mkdetrend or mkfringe systems; these must be run manually with the mkdetrend and mkfringe commands. In addition, the mkfringe and ptolemy systems are required to be run in sequence by elixir.postrun, but these do not really require this sequencing: ptolemy can be run independently of mkfringe since ptolemy does not require the fringe frames.

Furthermore, the error checking in the elixir.postrun system is not very well refined, and manual intervention is occasionally needed. It is possible, therefore, to set the state to appropriate values as needed and to run the specific stage manually.

elixir.postrun step-by-step

At the end of a camera run, it is time to run elixir.postrun. Currently, ert does not try to send any messages to say that the run is done and elixir.postrun should start. This should be added to the mkrun update command. In the steps listed below, the values (CAMERA) and (RUNID) should be set to 'megacam' and the camera run of interest.
  • mkrun sys postrun.camera (CAMERA)
  • mkrun sys postrun.runid (RUNID)
  • mkdetrend config (CAMERA) (RUNID)
  • mkdetrend reset hard
The commands above will set the necessary system variables and reset the mkdetrend state variables to 'init'. There are two ways to run the elixir.postrun process. You can specify the stages by hand, or you can use the 'update' command, and elixir.postrun will attempt to run through the stages by itself. In general, it is easier to use the 'update' method, and you have to use the command for elixir.postrun to calculate the update status, needed to move on to the next stages.
  • elixir.postrun update this runs the imstat system on the images which were missed in realtime. This may take an hour or so, depending on the number missed. You can monitor the progress with the status command elixir imstats and elixir imstats -time .
  • mkdetrend init
  • mkdetrend run When this completes, use the web page tool to adjust the input image selection, and run mkdetrend run again.
  • mkdetrend reg
  • mkfringe init
  • mkfringe run (Same process as mkdetrend)
  • mkfringe reg
  • elixir.postrun update This should run the ptolemy complete stage (use status : elixir complete to check).
  • elixir.postrun update This should run the standards and validation stages.
For some reason, the validation stage continues to return a state of fail. The results of the validation stage go into the directory /data/elixir2/datdir/RUNID/RUNID.val.N (N is sequence number if there are multiple runs). Check that this file has no (or only a few) invalid images. The validation processes sends validation information to the QSO database, so no further action is needed: valid images are now known by the DADS system.

Remember that at any time you can issue these commands to check the state of the specific system:

  • elixir.postrun state
  • mkdetrend state
  • mkfringe state