Пример #1
0
plt.yscale('symlog', linthreshy = 1.)
plt.xlim(xmin = -val_max['scatter'], xmax = val_max['scatter'])
plt.axvline(val_req['bias'], lw = 0.5, ls = 'solid', color = 'black')
plt.xticks(ytick['scatter'], fontsize = 10)

gs1 = gridspec.GridSpec(3, 1)
gs1.update(bottom = 0.05, top = 0.6, hspace=0, wspace=0) 

ax = plt.subplot(gs1[0])
i = 0
for o in od_cut:

	mask = od > o 	
	
	bias = pztls.Median(dz[mask])
	err_bias = pztls.errmedian(dz[mask])
	plt.errorbar(eff[i], bias_times * bias, bias_times * err_bias, c = cmap(tls.cmapind(eff_cut[i], eff_lim, id_lim)), mec = cmap(tls.cmapind(eff_cut[i], eff_lim, id_lim)), markersize = 3, fmt = 'o')
	i += 1

plt.setp( ax.get_xticklabels(), visible=False)
ax.yaxis.set_major_locator(MaxNLocator(prune = 'both'))
#plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0))
plt.xlim(xmin = 100, xmax = 0)
plt.axhline(val_req['bias'], lw = 0.5, ls = 'solid', color = 'black')
plt.ylabel(estim_label['bias'])
plt.ylim(ymin = -val_max['bias'], ymax = val_max['bias'])
plt.yticks(ytick['bias'])
plt.grid()

ax = plt.subplot(gs1[1])
i = 0
Пример #2
0
for o in od_cut:
	print "\nodds>",o

	cat = {}

	dz_all = cat_all['redshift'] - zt_all
	#dz_all = (cat_all['redshift'] - zt_all) / (1 + cat_all['redshift'])

	mask = od_all > o 	
	dz = dz_all[mask]
	

	sigma68_all = tls.Sigma68(dz)
	errsigma68_all = tls.errsigma68(dz)
	bias_all = tls.Median(dz)
	errbias_all = tls.errmedian(dz)
	comp_all, errcomp1_all, errcomp2_all = tls.Completeness(0,len(dz),len(dz_all))
	out_frac_all, errout_frac1_all, errout_frac2_all = tls.out_fract(dz, sigma68_all, 3)

	print "\nResults using the entire catalog:"
	print "Sigma68 = %.5f +/- %.5f" %(sigma68_all,errsigma68_all)
	print "Bias = %.5f +/- %.5f" %(bias_all,errbias_all)
	print "Completeness = %.5f +%.5f/-%.5f" %(comp_all, errcomp1_all, errcomp2_all)
	print "Outliers fraction = %.5f +%.5f/-%.5f\n" %(out_frac_all, errout_frac1_all, errout_frac2_all)
	print "Generation of plots...\n"

	
	i = 1
	for l in col_list:
		print "  %s" % l	
		cat[l] = cat_all[l][mask]