Principle is very simple. The data processing task is divided in a series of simple steps. The only requirement is that each step need to have a well defined input and output structure. In addition, separate processors are needed for reading data from file, database or net, and for storing analysis results.
User defines what the program will do by selecting the processors in the XML steering file. The idea is to develope a large number of processors in GLORIA, doing many different tasks, so user is always able to find a set which matches his/her needs.
The main "working horse" of Luiza is luiza::ProcessorMgr class. It is used by Luiza to create a list of active processors (after parsing XML file), and setting values to parameters required by this processors (given in the same XML file). Same processor type (eg. processor reading fits images luiza::FitsImageReader) can be used many times: the instances are distinguished by a unique name given by user. Each instance has its own set of parameters (so one instance of image reader can be used to read dark frames used for calibration and another instance to read actual images).
After all processors are created and their parameters are set, luiza::ProcessorMgr is called to perform following analysis steps:
- init() method is called for all active processors
Processors can do required initialization. No data structures are initialized at this point yet.
- startAnalysis() method is called for all active processors
Pointer to GLORIA data structure is passed to the processor, so required data structures can be initialized or additional input read.
- processData() method is called in a loop for all active processors in an order specified by user.
One loop usually corresponds to analysis of one image, but it is also possible to analyze a set of images in one loop. The analysis is interrupted when all input files are closed (no more input) or the specified number of loops was reached.
After each processData() call check() method from the same processor is called to allow additional diagnostics, if not disabled in the steering file.
After data processing loop is finished, all data collections are cleared to allow reading and analyzing subsequent images. However, if image or table collection is declared permanent, then its contents is kept and can be accessed in next loops. This can be the case e.g. for calibration images (darks, flats) or for analysis results (reconstructed light curves etc.)
- concludeAnalysis() method is called for all active processors
Processors can perform final calculations, write results to files or print running statistics. In particular, results stored in permanent collections should be saved, as after this step all data stored in GLORIA data structure is lost.
- end() method is called for all active processors
Processors can close open files, clean temporary storage etc.
These six methods should be defined for each luiza::Processor. Processors supplying input for analysis (reading input files or downloading from the net) should be defined as luiza::DataSourceProcessor.