dz_all = np.copy(dz)
		
		_, X = np.loadtxt(file, usecols= (0, col_list[c]), unpack = True)
		X_all = np.copy(X)

		od = tls.od_renorm(od)
		od = tls.od2eff(od)

		mask = (od > 0.5)
		dz = dz[mask]
		X = X[mask]
		print 'Completness=', 100*float(len(X))/float(len(X_all))
		
		print len(dz), len(dz_all)

		dz_bin = pztls.binsplit(dz, X, binning[c])
		dz_bin_all = pztls.binsplit(dz_all, X_all, binning[c])
		k = 0
		for e in estim_list:
			print "    %s" % e
			
			val, err_val = pztls.estim(dz_bin,dz_bin_all,e)

			index = 1 + j + n_col * k
			print index

			a = plt.subplot(n_estim, n_col, index)
			x = binning[c][:-1] + 0.5 * (binning[c][1:] - binning[c][:-1])

			#plt.plot(x, val, color = colors[i])	
			if(f != '_default'): plt.errorbar(x, val, err_val, color = colors[i], label = filt_label[i])
示例#2
0

	#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 "2sig Outliers fraction (rms) = %.5f +%.5f/-%.5f" %(out_frac_all_rms_2, errout_frac1_all_rms_2, errout_frac2_all_rms_2)
	#print "3sig Outliers fraction (rms) = %.5f +%.5f/-%.5f\n" %(out_frac_all_rms_3, errout_frac1_all_rms_3, errout_frac2_all_rms_3)
	print "Generation of plots...\n"

	#Bin splitting......................
	i = 1
	for l in col_list:
		print "  %s" % l	
		cat[l] = cat_all[l][mask]
		dz_bin_all = pztls.binsplit(dz_all, cat_all[l], binning[l])
		dz_bin = pztls.binsplit(dz, cat[l], binning[l])
		
		j=0
		for e in estim_list:
			print "    %s" % e
			
			if(e == 'scatter'):
				id_od = np.argsort(od_all)
				a = plt.subplot(n_estim, n_val, i + n_val*j)
				#plt.scatter(cat_all[l][id_od],dz_all[id_od], c=cmap( (od_all[id_od] - od_cut.min()) / (od_cut.max() - od_cut.min()) ), marker = 'o', lw = 0, rasterized=True)	
				plt.scatter(cat_all[l][id_od],dz_all[id_od], c=cmap(tls.cmapind(od_all[id_od],eff_lim, id_lim)), marker = 'o', s = 2.5, lw = 0, rasterized=True)	
			else:
				val, err_val = pztls.estim(dz_bin, dz_bin_all, e)

				a = plt.subplot(n_estim, n_val, i + n_val*j)