realz_dir = '/home/eugene/simulations/flash_runs/hybrid-cone/hddt/v3/profile75/ign_true/400k/analysis/cf_brendan_pbIgnRho-7.2' #pref = 'Realization_' pref = '400k_Tc7e8_co_wd_R' suff = '_ordered.dat' os.chdir(realz_dir) # Make a dictionary for the data ifd = IntegralFlashData() headers = [] shortheaders = [] rflist = glob.glob(pref + '*' + suff) N = len(rflist) print 'Found this many CO files: ' + str(N) cpick = ColorPicker() colors = cpick.pickColors(N) first = True for fn in rflist: print fn ni = int(fn.replace(pref,'').replace(suff,'')) ifd.readInts(fn) ifd.GramsToMsun() ifdk = 'co_' + str(ni) ifdata[ifdk] = ifd.getArrayData() if first: headers = ifdata[ifdk].keys() shortheaders = [hj.replace(' > ','>').replace(' ','_') for hj in headers] pfmt[ifdk] = {'color': 'blue', 'alpha': 0.75, 'marker': None, 'linestyle': '-',
import sys # Get the number of colors from one command line integer argument try: Nh = int(sys.argv[1]) Ns = int(sys.argv[2]) Nv = int(sys.argv[3]) N = Nh*Ns*Nv except: print 'Please enter three command line integers specifying the number of colors to generate in hsv.' exit() # Now get the colors cpick = ColorPicker() print 'hsv: ' + str(Nh) + ',' + str(Ns) + ',' + str(Nv) colors = cpick.pickColors(Nh,Ns,Nv) print colors # Generate sample data class Line: def __init__(self,x,a,b): self.x = np.array(x) self.y = a*self.x+b intercept = 0.0 npts = 10 xvector = np.linspace(0,1.0,npts,dtype=np.float64) data = [] for i in xrange(N): data.append(Line(xvector,float(i+1),intercept)) # Now make a sample plot!
realz_dir = '/home/eugene/simulations/flash_runs/hybrid-cone/hddt/v3/profile75/ign_true/400k/analysis/cf_brendan_pbIgnRho-7.2' #pref = 'Realization_' pref = '400k_Tc7e8_co_wd_R' suff = '_ordered.dat' os.chdir(realz_dir) # Make a dictionary for the data ifd = IntegralFlashData() headers = [] shortheaders = [] rflist = glob.glob(pref + '*' + suff) N = len(rflist) print 'Found this many CO files: ' + str(N) cpick = ColorPicker() colors = cpick.pickColors(N) first = True for fn in rflist: print fn ni = int(fn.replace(pref, '').replace(suff, '')) ifd.readInts(fn) ifd.GramsToMsun() ifdk = 'co_' + str(ni) ifdata[ifdk] = ifd.getArrayData() if first: headers = ifdata[ifdk].keys() shortheaders = [ hj.replace(' > ', '>').replace(' ', '_') for hj in headers ] pfmt[ifdk] = { 'color': 'blue',