Hermes DRS  6.0
reduction software
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
hermes.pipeline.core.resultdict.ResultDict Class Reference
Inheritance diagram for hermes.pipeline.core.resultdict.ResultDict:

Public Member Functions

def __init__
 add the in and out paths More...
 
def __str__
 

Detailed Description

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"]

Constructor & Destructor Documentation

def hermes.pipeline.core.resultdict.ResultDict.__init__ (   self)

add the in and out paths

PURPOSE: initialize the object. Predefine an list of component
names (strings). This list will be accessed by each component
that modifies the contents of the result container.
Read the config file that contains the paths to in and out dirs.

Member Function Documentation

def hermes.pipeline.core.resultdict.ResultDict.__str__ (   self)
PURPOSE: this function implements what will appear when the container is
printed with the print command

EXAMPLE: >>> container = ResultDict()
>>> print container

The documentation for this class was generated from the following file: