RR_err = tal.tallies[tally_number].vals[dex]['err'][:-1] tally_number = 1 cos = 0 dex = tal.tallies[tally_number]._hash(cos=cos, obj=0, seg=0) incoming_dat = tal.tallies[tally_number].vals[dex]['data'][:-1] incoming_err = tal.tallies[tally_number].vals[dex]['err'][:-1] tally_number = 1 cos = 1 dex = tal.tallies[tally_number]._hash(cos=cos, obj=0, seg=0) outgoing_dat = tal.tallies[tally_number].vals[dex]['data'][:-1] outgoing_err = tal.tallies[tally_number].vals[dex]['err'][:-1] energies = tal.tallies[tally_number].energies[:-1] this_wvl = to_wavelength(energies) this_eff = numpy.divide(RR_dat, incoming_dat) this_eff_err = numpy.sqrt( numpy.add(numpy.multiply(RR_err, RR_err), numpy.multiply(incoming_err, incoming_err))) wvl[talname] = this_wvl[::-1] eff[talname] = this_eff[::-1] eff_err[talname] = this_eff_err[::-1] wvl[talname] = wvl[talname][:-1] eff[talname] = eff[talname][:-1] eff_err[talname] = eff_err[talname][:-1] mean_wvl = wvl['specified.m']
measurement[0].append(float(nums[0])) measurement[1].append(float(nums[1])) f.close() #path = '/home/l_bergmann/repos/ICON-brightness-parametric-19K-std/results/' path = '/home/l_bergmann/repos/ICON-brightness-parametric-24K-ike/results/' #path = '/home/l_bergmann/repos/ICON-brightness-parametric-19K-bar/results/' #path = '/home/l_bergmann/repos/ICON-brightness-parametric-23K-bar/results/' cases = os.listdir(path) cases.sort() bin_edges = {} bin_values = {} tal_num = 5 for case in cases: this_tal = mctal(path + case) wvl1 = to_wavelength(numpy.array(this_tal.tallies[tal_num].energies[:-1])) widths1 = -1.0 * numpy.diff(wvl1) dex = this_tal.tallies[tal_num]._hash(obj=0, cos=0) bin_edges[case] = wvl1 bin_values[case] = charge_per_milliamp * numpy.divide( this_tal.tallies[tal_num].vals[dex]['data'][:-1], widths1 * total_str) shift = -0.0 sa_measure = 6.28E-4 #2.0*numpy.pi*(1.0-101./numpy.sqrt(101.0*101.0+1.5*1.5)) meas_edge = numpy.array(measurement[0][:]) + shift measurement[1] = numpy.array(measurement[1]) meas_normed = numpy.multiply(measurement[1][:], sa_measure / total_str) case_min = '' valu_min = 99999999999999.0 norm_order = 2 #numpy.inf
cases.append('23 K, CAB') lines[cases[-1]] = [1, '-', 'b'] paths[cases[ -1]] = '/home/l_bergmann/repos/ICON-brightness-parametric-23K-bar/results/case028.mctal' cases.append('24 K, IKE') lines[cases[-1]] = [1, '--', 'b'] paths[cases[ -1]] = '/home/l_bergmann/repos/ICON-brightness-parametric-24K-ike/results/case028.mctal' # get index limits for sums tal_num = 5 xlims = [0.75, 12] this_tal = mctal( '/home/l_bergmann/repos/ICON-brightness-parametric-19K-std/results/case028.mctal' ) wvl = to_wavelength(numpy.array(this_tal.tallies[tal_num].energies[:-1])) index_xlims = numpy.multiply(wvl >= xlims[0], wvl <= xlims[1]) smooth_int = 1 smooth_string = 'smooth=%d' % smooth_int for case in cases: path = paths[case] this_tal = mctal(path) wvl1 = to_wavelength(numpy.array(this_tal.tallies[tal_num].energies[:-1])) widths1 = -1.0 * numpy.diff(wvl1) dex = this_tal.tallies[tal_num]._hash(obj=0, cos=0) bin_edges[case] = wvl1 bin_values[case] = charge_per_milliamp * numpy.divide( this_tal.tallies[tal_num].vals[dex]['data'][:-1], widths1 * total_str)
tal2 = new.tallies[tal_num].vals[dex]['data'][:-1] dex = inv.tallies[tal_num]._hash(obj=7) tal3 = inv.tallies[tal_num].vals[dex]['data'][:-1] ene4 = numpy.array(deg24.tallies[tal_num].energies[:-1]) dex = deg24.tallies[tal_num]._hash(obj=0, cos=0) tal4 = deg24.tallies[tal_num].vals[dex]['data'][:-1] dex = deg25.tallies[tal_num]._hash(obj=0, cos=0) tal5 = deg25.tallies[tal_num].vals[dex]['data'][:-1] dex = deg28.tallies[tal_num]._hash(obj=0, cos=0) tal6 = deg28.tallies[tal_num].vals[dex]['data'][:-1] wvl1 = to_wavelength(ene1) widths1 = -1.0 * numpy.diff(wvl1) wvl4 = to_wavelength(ene4) widths4 = -1.0 * numpy.diff(wvl4) #this_tal.plot(tal=[5],obj=[7]) ## compare PD and radiography print " ======== " print "PD total %6.4E" % this_tal.tallies[5].vals[dex]['data'][-1] print "Pinhole mean %6.4E" % (numpy.mean(img)) print "Pinhole sum %6.4E" % (numpy.sum(img)) ### solid angles sa_collimator = get_view_sa(b=0.1, l=10.1, thk=10.0) sa_cadmium = get_view_sa(b=0.05, l=0.1, thk=0.1) sa_sapphire = get_view_sa(b=1.0, l=41.835, thk=25.0)
ax.set_ylabel( r'Macroscopic Cross Section (with S($\alpha$,$\beta$)) (cm^{-1})') plt.show() al27_thk = 0.7 sapp_thk = 5.0 sapp_trans = numpy.exp(-sapp_total * sapp_thk) al27_trans = numpy.exp(-al27_total * al27_thk) total_trans_e = numpy.union1d(al27_total_e, sapp_total_e) total_trans = numpy.interp(total_trans_e, sapp_total_e, sapp_trans) * numpy.interp( total_trans_e, al27_total_e, al27_trans) f = plt.figure() ax = f.add_subplot(111) ax.semilogx(total_trans_e, total_trans, 'b') ax.grid('on') ax.set_xlabel(r'Energy (MeV)') ax.set_ylabel(r'Transmission') plt.show() f = plt.figure() ax = f.add_subplot(111) ax.plot(to_wavelength(total_trans_e), total_trans, 'b') ax.grid('on') ax.set_xlabel(r'Energy (MeV)') ax.set_ylabel(r'Transmission') ax.set_xlim([0, 11]) plt.show()