PURPOSE: This class provides a mean to store the results of a component.
The same "result container" is then passed from component to
component. Results can be easily added to the container that is
implemented as a dictionary.
When initialized, the resultDict read the config file "hermesConfig.xml"
from the hermes directory. That config file should indicate four
paths as in the following sample :
<hermes>
<Nights>/nights</Nights>
<CurrentNight>20100731</Current>
<DebugPath>/hermes/tests/</DebugPath>
<AnalysesResults>hermes/results</AnalysesResults>
<Reduced>/hermesOut</Reduced>
</hermes>
This will build the paths as follows:
<DebugPath>/pipeline/components/tests/</DebugPath>
<DataInput>/nights/20100731/raw</DataInput>
<DataOutput>/hermesOut/20100731/reduced</DataOutput>
In that way, the resultDict carries the three paths that every
component can later access easily.
If that hermesConfig.xml file does not exist, it is created by the "setup"
utility from the "hermes" folder, automatically called from here with the
default values shown above.
One can easily read the contents of that file by running this component.
The user can always edit that file to point to its own in and out folders.
EXAMPLES: Much of the functionality comes from the dict superclass
. How to create a result container:
>>> container = ResultDict()
. How to check if a variable is in the container
>>> "myImage" in container # true/false
. How to get a list of the container contents
>>> container.keys()
. How to add, modify, retrieve and view results from the container
>>> container["myImage"] = x # add or modify
>>> container.update("myImage", x) # add or modify
>>> y = container["myImage"] # reference!
>>> print container["myImage"]