Пример #1
0
fin.close()

# Print t raw, t/tBH 
#raw_t= master_sink.old_t[-master_sink.tnorm().size:].copy()
print "%s" % args.str_beta
print "mdotTime, tnorm()"
for raw_t,norm in zip(master_sink.mdotTime,master_sink.tnorm()):
	print raw_t,norm
print 'exiting early'
sys.exit()

#tend
print 'model: %s, last t/tBH= %.5f' % (args.str_beta,master_sink.tnorm()[-1])
if False: # print machrms at end
	t_end= min(20.,master_sink.tnorm()[-1])
	i_end= index_before_tBH(master_sink,t_end,units_tBH=True)
	mach_end= master_sink.f_rms_mach(master_sink.mdotTime[i_end])
	print 'model= %s, tsteady/tBH= %.2f, tend/tBH= %.2f, rms Mach end= %.2f' % \
			(args.str_beta, steady_state_begins(args.str_beta,True),t_end,mach_end) 
#corr mdots	
end_t,end_mach= t_rms_mach_near_end(args.str_beta)
master_sink.rm_mdot_systematics(end_t,end_mach)
#final PDF
final_pdf= dict(arr={},bins={},pdf={},cdf={})  #PDF USING, 64 pdf, over last 2tBH
low,hi= low_hi_mdot_all_models()
final_pdf['arr'][args.str_beta],final_pdf['bins'][args.str_beta],final_pdf['pdf'][args.str_beta],final_pdf['cdf'][args.str_beta]= pdf_for_model_64_x_N(master_sink,args.str_beta, low,hi,nsinks=64,corr=True,last_2tBH=True,dt=2.)
#make plots
just_median(master_sink,args)
median_and_when_equil_begins(master_sink,args)
steady_pdf_cdf(master_sink,args)
all_rates(master_sink,args,corr=True)  
Пример #2
0
for str_beta in args.str_beta:
    tsteady = steady_state_begins(str_beta, True)
    print "STEADY STATE: model=%s, t/tBH=%.2f, t/tABH=%.2f" % (str_beta, tsteady, tBH_to_tBHA(tsteady, str_beta))

sinks = {}
for fn, str_beta in zip(args.sinks, args.str_beta):
    fin = open(fn, "r")
    sinks[str_beta] = load(fin)
    fin.close()
    # corr mdots
    end_t, end_mach = stats.t_rms_mach_near_end(str_beta)
    sinks[str_beta].rm_mdot_systematics(end_t, end_mach)
# deterine min and max mdot of all models
low, hi = 100, 1.0e-10
for key in sinks.keys():
    istart = stats.index_before_tBH(sinks[key], steady_state_begins(key, True))
    iend = stats.index_before_tBH(sinks[key], 20.0)
    # print 'istart= ',istart,'iend= ',iend
    # print 'sinks[key].mdot.shae[istart:iend].shape= ',sinks[key].mdot[istart:iend].shape
    # print 'sinks[key].mdot[istart:iend].shape= ',sinks[key].mdot[istart:iend].shape
    gt_zero = sinks[key].mdot[:, istart:iend] > 0  # mdot < 0 when dt plummeted, huge vertical spike in mdot vs. t...
    new_low, new_hi = sinks[key].mdot[:, istart:iend][gt_zero].min(), sinks[key].mdot[:, istart:iend][gt_zero].max()
    print "model= %s: low,new_low,hi,new_hi= " % (key,), low, new_low, hi, new_hi
    low, hi = min(low, new_low), max(hi, new_hi)
print "----lowest and highest mdots for all models are: lo=", low, ", hi=", hi, " ----"
nsinks = 64  # for nsinks in [8,16,32,64]:
# first, store pdfs,cdfs b/c kaylans_pdf_one_model calls plot functions and messing up plot if make inside loop
final_pdf = dict(arr={}, bins={}, pdf={}, cdf={})  # PDF USING, 64 pdf, over last 2tBH
for mod in sinks.keys():
    # PDF for each model
    final_pdf["arr"][mod], final_pdf["bins"][mod], final_pdf["pdf"][mod], final_pdf["cdf"][