Changeset 567 for mystic/scripts


Ignore:
Timestamp:
09/21/12 15:17:14 (4 years ago)
Author:
mmckerns
Message:

added color scaling to support_hypercube

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mystic/scripts/support_hypercube.py

    r499 r567  
    5252                    metavar="INT",default=None, 
    5353                    help="id # of the nth simultaneous points to plot") 
     54  parser.add_option("-s","--scale",action="store",dest="scale",\ 
     55                    metavar="FLOAT",default=1.0, 
     56                    help="multiplier for scaling color of points in plot") 
    5457  parser.add_option("-f","--flat",action="store_true",dest="flatten",\ 
    5558                    default=False,help="show selected iterations in a single plot") 
     
    106109  except: 
    107110    id = None # i.e. 'all' **or** use id=0, which should be 'best' energy ? 
     111 
     112  try: # scale the color in plotting the weights 
     113    scale = float(parsed_opts.scale) 
     114  except: 
     115    scale = 1.0 # color = color**scale 
    108116 
    109117  # ensure all terms of bounds and xyz are tuples 
     
    202210 
    203211  # build all the plots 
    204   from numpy import inf 
     212  from numpy import inf, e 
     213  scale = e**(scale - 1.0) 
    205214  for v in range(len(steps)): 
    206215    if len(steps[v]) > 1: qp = float(max(steps[v])) 
    207216    else: qp = inf  
    208217    for s in steps[v]: 
    209       t = str(s/qp) # dot color determined by number of simultaneous iterations 
     218      # dot color determined by number of simultaneous iterations 
     219      t = str((s/qp)**scale) 
    210220      for i in eval("[params[q][%s] for q in xyz[0]]" % s): 
    211221        for j in eval("[params[q][%s] for q in xyz[1]]" % s): 
Note: See TracChangeset for help on using the changeset viewer.