Removing make-plots support

Sat, 26 Feb 2011 23:29:31 +0100

author
Andy Buckley <andy@insectnation.org>
date
Sat, 26 Feb 2011 23:29:31 +0100
changeset 121
402d6abf64b7
parent 120
bffefe12df80
child 122
c8700617f20c

Removing make-plots support

ChangeLog file | annotate | diff | comparison | revisions
slhaplot file | annotate | diff | comparison | revisions
     1.1 --- a/ChangeLog	Sat Feb 26 23:21:12 2011 +0100
     1.2 +++ b/ChangeLog	Sat Feb 26 23:29:31 2011 +0100
     1.3 @@ -1,5 +1,10 @@
     1.4  2011-02-26  Andy Buckley  <andy@insectnation.org>
     1.5  
     1.6 +	* Removed make-plots output support... TikZ is just nicer and more
     1.7 +	widely supported, and I've not been bothering to test with
     1.8 +	make-plots anymore. It's there in the version history if anyone's
     1.9 +	interested!
    1.10 +
    1.11  	* Removing the --show-gravitino argument from slhaplot: I see no
    1.12  	reason to treat gravitinos specially and clutter the UI, so if the
    1.13  	gravitino is there, we plot it! Until we supply a
     2.1 --- a/slhaplot	Sat Feb 26 23:21:12 2011 +0100
     2.2 +++ b/slhaplot	Sat Feb 26 23:29:31 2011 +0100
     2.3 @@ -9,17 +9,18 @@
     2.4  filename ends with .isa, it will be assumed to be an ISAWIG file, otherwise
     2.5  it will be assumed to be an SLHA file (for which the normal extension is .spc).
     2.6  
     2.7 -Output is currently available as the make-plots .dat format or as LaTeX source
     2.8 -using the PGF/TikZ graphics package. Both may be processed to make EPS or PDF
     2.9 -images.
    2.10 +Output is currently rendered via the LaTeX PGF/TikZ graphics package: this may
    2.11 +be obtained as PDF (by default) or as LaTeX source which can be edited or
    2.12 +compiled into any LaTeX-supported form.
    2.13  
    2.14  TODOs:
    2.15 +  * Allow user to provide a file which defines the particle line x-positions, labels, etc.
    2.16 +  * Provide nicer format names than the "tikz"-oriented ones, now that make-plots isn't supported
    2.17    * Allow user control over aspect ratio / geometry
    2.18 -  * PNG output (use PIL if available?)
    2.19 +  * EPS and PNG output
    2.20    * Use proper distinction between physical, plot-logical, and plot output coords
    2.21    * Use scaling to allow the y coordinates to be in units of 100 GeV in TikZ output.
    2.22    * Distribute decay arrow start/end positions along mass lines rather than always to/from their centres?
    2.23 -  * Drop make-plots support?
    2.24  """
    2.25  
    2.26  class XEdges(object):
    2.27 @@ -117,13 +118,12 @@
    2.28                    help="write output to FILE",
    2.29                    dest="OUTFILE", default=None)
    2.30  parser.add_option("-f", "--format", metavar="FORMAT",
    2.31 -                  choices=["makeplots", "tikz", "tikzfrag", "tikzpdf"],
    2.32 +                  choices=["tikz", "tikzfrag", "tikzpdf"],
    2.33                    help="format in which to write output. 'tikz' produces LaTeX source using the "
    2.34                    "TikZ graphics package to render the plot, 'tikzfrag' produces the same but "
    2.35                    "with the LaTeX preamble and document lines commented out to make it directly "
    2.36 -                  "includeable as a code fragment in LaTeX document source, 'tikzpdf' produces a "
    2.37 -                  "PDF file created by running pdflatex and pdfcrop on the 'tikz' output, and "
    2.38 -                  "'makeplots' produces a .dat file for processing with the make-plots command. "
    2.39 +                  "includeable as a code fragment in LaTeX document source, and 'tikzpdf' produces "
    2.40 +                  "a PDF file created by running pdflatex and pdfcrop on the 'tikz' output"
    2.41                    "(default: %default)",
    2.42                    dest="FORMAT", default="tikzpdf")
    2.43  parser.add_option("--preamble", metavar="FILE",
    2.44 @@ -145,9 +145,6 @@
    2.45                    "comma-separated list, and 'shift' vertically shifts the clashing labels to avoid "
    2.46                    "collisions (default: %default)",
    2.47                    dest="PARTICLES_LABELS", default="shift")
    2.48 -# parser.add_option("--hide-gravitino", action="store_false",
    2.49 -#                   help="hide the gravitino",
    2.50 -#                   dest="SHOW_GRAVITINO", default=False)
    2.51  
    2.52  
    2.53  ## Run parser and sort out a few resulting details
    2.54 @@ -156,9 +153,6 @@
    2.55  opts.PARTICLES_LABELS_MERGE = (opts.PARTICLES_LABELS == "merge")
    2.56  opts.PARTICLES_LABELS_SHIFT = (opts.PARTICLES_LABELS == "shift")
    2.57  #
    2.58 -# if not opts.SHOW_GRAVITINO:
    2.59 -#     del PDETAILS[1000039]
    2.60 -#
    2.61  if opts.DECAYS_MINBR.endswith("%"):
    2.62      opts.DECAYS_MINBR = float(opts.DECAYS_MINBR[:-1]) / 100
    2.63  else:
    2.64 @@ -183,8 +177,6 @@
    2.65      suffix = ".tex"
    2.66      if "pdf" in opts.FORMAT:
    2.67          suffix = ".pdf"
    2.68 -    elif opts.FORMAT == "makeplots":
    2.69 -        suffix = ".dat"
    2.70      opts.OUTFILE = o + suffix
    2.71  
    2.72  
    2.73 @@ -330,68 +322,6 @@
    2.74          f.close()
    2.75  
    2.76  out = ""
    2.77 -## MAKE-PLOTS FORMAT
    2.78 -if opts.FORMAT == "makeplots":
    2.79 -
    2.80 -    ## Write plot header
    2.81 -    out += "# SUSY mass/decay spectrum plot, created by pyslha/slhaplot from %s\n" % opts.INFILE
    2.82 -    out += "# http://pypi.python.org/pypi/pyslha\n"
    2.83 -    out += "\n"
    2.84 -    out += "# BEGIN PLOT\n"
    2.85 -    if opts.PARTICLES_LABELS_MERGE:
    2.86 -        ## Need more space if labels are to be merged horizontally
    2.87 -        out += "XMin=-4\n"
    2.88 -        out += "XMax=20\n"
    2.89 -    else:
    2.90 -        out += "XMin=-3\n"
    2.91 -        out += "XMax=19\n"
    2.92 -    # if opts.LOGSCALE:
    2.93 -    #     out += "LogY=1\n"
    2.94 -    # else:
    2.95 -    #     out += "LogY=0\n"
    2.96 -        out += "YMin=0\n"
    2.97 -    out += "#XCustomTicks=1.0	Higgs	6.0	Sleptons	11.0	Gauginos	16.0	Squarks\n"
    2.98 -    out += "XCustomTicks=-10.0	~\n"
    2.99 -    out += "YLabel=Mass / GeV\n"
   2.100 -    out += "DrawSpecialFirst=1\n"
   2.101 -    out += "# END PLOT\n\n"
   2.102 -
   2.103 -
   2.104 -    ## Mass lines
   2.105 -    for pid, pdetail in sorted(PDETAILS.iteritems()):
   2.106 -        out += """
   2.107 -# BEGIN HISTOGRAM %s
   2.108 -ErrorBars=1
   2.109 -LineWidth=1pt
   2.110 -LineColor=%s
   2.111 -%f	%f	%e	0
   2.112 -# END HISTOGRAM\n""" % ("pid"+str(pid), pdetail.color,
   2.113 -                      pdetail.xedges.left, pdetail.xedges.right,
   2.114 -                      pdetail.mass)
   2.115 -    out += "\n"
   2.116 -
   2.117 -
   2.118 -    ## Decay arrows
   2.119 -    for pidfrom, todict in sorted(DDETAILS.iteritems()):
   2.120 -        for pidto, dd in sorted(todict.iteritems()):
   2.121 -            out += r"""
   2.122 -# BEGIN SPECIAL decay_%d_%d
   2.123 -\psset{arrowsize=0.1}
   2.124 -\psline[linestyle=dashed,dash=3px 2px,linecolor=%s]{->}\physicscoor(%f,%f)\physicscoor(%f,%f)
   2.125 -# END SPECIAL
   2.126 -""" % (dd.pidfrom, dd.pidto, dd.color, dd.xyfrom[0], dd.xyfrom[1], dd.xyto[0], dd.xyto[1])
   2.127 -
   2.128 -
   2.129 -    ## Particle labels
   2.130 -    out += "\n\n"
   2.131 -    out += "# BEGIN SPECIAL labels\n"
   2.132 -    for ld in PLABELS:
   2.133 -        out += r"\rput[%s]\physicscoor(%f,%f){\small %s}" % (ld.anchor, ld.xy[0], ld.xy[1], ld.texlabel) + "\n"
   2.134 -    out += "# END SPECIAL\n"
   2.135 -
   2.136 -    ## Write it out
   2.137 -    writeout(out)
   2.138 -
   2.139  
   2.140  ## TIKZ FORMAT
   2.141  if "tikz" in opts.FORMAT:

mercurial