Changeset 561


Ignore:
Timestamp:
09/17/12 10:29:41 (4 years ago)
Author:
mmckerns
Message:

added option to scale color intensity for weights in hypercube plot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mystic/scripts/support_hypercube_measures.py

    r499 r561  
    5959                    metavar="INT",default=None, 
    6060                    help="id # of the nth simultaneous points to plot") 
     61  parser.add_option("-s","--scale",action="store",dest="scale",\ 
     62                    metavar="FLOAT",default=1.0, 
     63                    help="multiplier for scaling color of weights in plot") 
    6164  parser.add_option("-f","--flat",action="store_true",dest="flatten",\ 
    6265                    default=False,help="show selected iterations in a single plot") 
     
    114117  except: 
    115118    id = None # i.e. 'all' **or** use id=0, which should be 'best' energy ? 
     119 
     120  try: # scale the color in plotting the weights 
     121    scale = float(parsed_opts.scale) 
     122  except: 
     123    scale = 1.0 # color = color**scale 
    116124 
    117125  # ensure all terms of bounds and xyz are tuples 
     
    219227    steps = [list(flatten(steps))] 
    220228 
     229  # adjust for logarithmic scaling of intensity 
     230  from numpy import e 
     231  scale = e**(scale - 1.0) 
     232 
    221233  # dot color is based on a product of weights 
    222234  t = [] 
     
    227239        for j in eval("[params[q][%s] for q in wxyz[1]]" % s): 
    228240          for k in eval("[params[q][%s] for q in wxyz[2]]" % s): 
    229             t[v].append([str(1.0 - i[q]*j[q]*k[q]) for q in range(len(i))]) 
     241            t[v].append([str((1.0 - i[q]*j[q]*k[q])**scale) for q in range(len(i))]) 
    230242            if float(t[v][-1][-1]) > 1.0 or float(t[v][-1][-1]) < 0.0: 
    231243              raise ValueError, "Weights must be in range 0-1. Check normalization and/or assignment." 
Note: See TracChangeset for help on using the changeset viewer.