Add epilogs to each OptionParser in pysawsim.
[sawsim.git] / pysawsim / parameter_scan.py
index 60c60f9bc92fb5faaf2b5f2d98ecd7a83863a10a..03cd99074980f94ac06b9332eff60e7eb00999ce 100644 (file)
@@ -114,8 +114,8 @@ class HistogramMatcher (object):
 
     The input `histogram_stream` should contain a series of
     experimental histograms with '#HISTOGRAM: <params>` lines starting
-    each histogram.  `<params>` should list the `sawsim` parameters
-    that are unique to that experiment.
+    each histogram.  `<params>` lists the `sawsim` parameters that are
+    unique to that experiment.
 
     >>> from .manager.thread import ThreadManager
     >>> velocity_stream = StringIO(EXAMPLE_HISTOGRAM_FILE_CONTENTS)
@@ -326,9 +326,29 @@ def main(argv=None):
 
     sr = SawsimRunner()
 
-    usage = "%prog [options] velocity_file"
-
-    parser = OptionParser(usage)
+    usage = '%prog [options] histogram_file'
+    epilog = '\n'.join([
+            'Compare simulated results against experimental values over a',
+            'range of parameters.  Generates a plot of fit quality over',
+            'the parameter space.  The histogram file should look something',
+            'like:',
+            '',
+            EXAMPLE_HISTOGRAM_FILE_CONTENTS,
+            ''
+            '`#HISTOGRAM: <params>` lines start each histogram.  `params`',
+            'lists the `sawsim` parameters that are unique to that',
+            'experiment.',
+            '',
+            'Each histogram line is of the format:',
+            '',
+            '<bin_edge><whitespace><count>',
+            '',
+            '`<bin_edge>` should mark the left-hand side of the bin, and',
+            'all bins should be of equal width (so we know where the last',
+            'one ends).',
+            ])
+    parser = OptionParser(usage, epilog=epilog)
+    parser.format_epilog = lambda formatter: epilog+'\n'
     for option in sr.optparse_options:
         if option.dest == 'param_string':
             continue