def addOptions(self):
     CommonPickledDataInput.addOptions(self)
Exemple #2
0
    def addOptions(self):
        CommonPickledDataInput.addOptions(self)

        output=OptionGroup(self.parser,
                           "2D Statistics output",
                           "Options that determine what should be output")
        self.parser.add_option_group(output)
        output.add_option("--field",
                          action="append",
                          default=[],
                          dest="field",
                          help="""\
Name of the field that should be printed. Can be specified more than once
""")
        output.add_option("--function",
                          action="append",
                          default=[],
                          dest="function",
                          help="""\ Name of a function that should be
calculated on the data. Either a function in the lambda-syntax or a
function from the math-module
""")
        output.add_option("--relative-error",
                          action="store_true",
                          default=False,
                          dest="relativeError",
                          help="""\
Print the relative error as calculated from the metrics and the compare-data
""")
        output.add_option("--range",
                          action="store_true",
                          default=False,
                          dest="range",
                          help="""\
Print the range (minimum and maximum) of the data
""")
        
        input=OptionGroup(self.parser,
                          "2D Statistics intput",
                          "Options that determine what should be used as input")
        self.parser.add_option_group(input)
        input.add_option("--metrics-name",
                          action="store",
                          default="metrics",
                          dest="metricsName",
                          help="""\
Name of the data metric (the main input). Default: %default
""")
        input.add_option("--compare-name",
                          action="store",
                          default="compare",
                          dest="compareName",
                          help="""\
Name of the comparison metric (the secondary input). Default:
%default. Ignored if not present in the data
""")

        parameters=OptionGroup(self.parser,
                               "2D Statistics Paramters",
                               "Options that determine the behaviour of the 2D statistics")
        self.parser.add_option_group(parameters)
        parameters.add_option("--small-threshold",
                              action="store",
                              default=1e-10,
                              type="float",
                              dest="smallThreshold",
                              help="""\
Value that is considered to be close enough to 0. Default:
%default. Used for instance for the relative error calculations
""")