The Elixir postrun system (`elixir.postrun`) manages the end-of-run processing of the calibration and science data. The command `elixir.postrun` manages the stages of the processing. The elixir.postrun commands are as follows:
`

elixir.postrun state | check the current postrun status
elixir.postrun update | update the status, start the next stage
elixir.postrun set (entry) (value) | set the state for a specific entry
elixir.postrun (entry) | run a specific entry

`

The Elixir postrun system consists of a series of processing stages, illustrated by the command `elixir.postrun state` :
``

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 command `elixir.postrun update` will attempt to identify the state of each of the processing stages, and run the first which is ready 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'.

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 with the elixir.postrun set (entry) (value) command. Also, the elixir.postrun (entry) command can be used to run the specific stage manually.